13.3.3 String vars
The String vars in the member functions described in this section and in the section Sequence vars have a TYPE of char *. String vars support additional member functions, as follows:
-
String_var(char * str) - This constructor makes a
String_varfrom a string. Thestrargument specifies the string that will be assumed. The user must not use thestrpointer to access data. -
String_var(const char * str) String_var(const String_var &var) - This constructor makes a
String_varfrom a const string. Thestrargument specifies the const string that will be copied. Thevarargument specifies a reference to the string to be copied. -
String_var &operator=(char * str) - This assignment operator first releases the contained string
using
CORBA::string_free, and then assumes ownership of the input string. Thestrargument specifies the string whose ownership will be assumed by thisString_varobject. -
String_var &operator=(const char * str) String_var &operator=(const String_var &var) - This assignment operator first releases the contained string
using
CORBA::string_free, and then copies the input string. TheDataargument specifies the string whose ownership will be assumed by thisString_varobject. -
char operator[] (Ulong Index) char operator[] (Ulong Index) const - These array operators are superscripting operators that provide access to characters within the string. The
Indexargument specifies the index of the array to use in accessing a particular character within the array. Zero-based indexing is used. The returned value of theChar operator[] (Ulong Index)function can be used as an lvalue. The returned value of theChar operator[] (Ulong Index) constfunction cannot be used as an lvalue.
Parent topic: Using var Classes