CORBA::string_dup

Overview Copies a string.
Original class CORBA


Intended Usage

This method is intended to be used by client and server applications to duplicate (copy) data of type CORBA::String. The resulting string should be subsequently freed using CORBA::string_free(). If the input value is NULL, the return value will be NULL.

Strings to be passed on remote method invocations or whose ownership is to be transferred from one library to another should be allocated using CORBA::string_alloc() or CORBA::string_dup() rather than the C++ new[] operator. This insures that string memory is deleted using the same C++ run time that originally allocated it.

Syntax

  static char* string_dup(const char* str);

Input parameters

str
The NULL-terminated string to be copied.

Return values

char*
A copy of the input string. This storage should be subsequently freed using CORBA::string_free() rather than the C++ delete[] operator. NULL is returned if the storage cannot be allocated.

Example

See the example for the CORBA::string_alloc method.


Related reference
CORBA module



Searchable topic ID:   rcor_modco6
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/ref/rcor_modco6.html

Library | Support | Terms of Use | Feedback