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_var
from a string. Thestr
argument specifies the string that will be assumed. The user must not use thestr
pointer to access data. -
String_var(const char * str) String_var(const String_var &var)
- This constructor makes a
String_var
from a const string. Thestr
argument specifies the const string that will be copied. Thevar
argument 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. Thestr
argument specifies the string whose ownership will be assumed by thisString_var
object. -
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. TheData
argument specifies the string whose ownership will be assumed by thisString_var
object. -
char operator[] (Ulong Index) char operator[] (Ulong Index) const
- These array operators are superscripting operators that provide access to characters within the string. The
Index
argument 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) const
function cannot be used as an lvalue.
Parent topic: Using var Classes