String data type.
Internally all strings are "null-terminated", i.e. the last byte of each string is zero.
Null strings and empty strings are not the same. Null strings are those for which the isNullString method returns true. Empty strings are non-null strings containing zero characters. This is useful for distinction between empty string values and undefined values.
Both null strings and empty strings are represented as a single byte containing zero. It is guaranteed that none of this class's methods will ever return a NULL pointer.
| String& |
Makes a copy of a string contained in a given String object. | |||
| String& |
Makes a copy of a given string. | |||
| operator const |
Returns a pointer to the string
contained in this String object. | |||
| const bool |
Performs symbol-by-symbol comparison
between the string contained in this String object
and a given string. | |||
| const bool |
Performs an alphabetic comparison
between the string contained in this String object
and a given string. | |||
| const bool |
Performs symbol-by-symbol comparison between
the string contained in this String object
and a string contained in a given String object. | |||
| const bool |
Performs symbol-by-symbol comparison between
the string contained in this String object
and a string contained in a given String object. | |||
| const char* |
Returns a pointer to the string contained in
this String object. | |||
| void |
Assigns a given string to this String object
without copying the string. | |||
| void |
Assigns a given string to this String object
without copying the string, but with granting
"the ownership" of the string to the String object. | |||
| void |
Assigns a given string to this String object
by creating a copy of the string. | |||
| static Ref<String> |
Creates a new String object and assigns
a given string to it as a static string. | |||
| static Ref<String> |
Creates a new String object and
assignes a given string to it by granting
"the ownership". | |||
| static Ref<String> |
Creates a new String object and initializes it
with a string formed according to the specified format. | |||
| static Ref<String> |
Returns a reference to the "null" string. | |||
| bool |
Determines whether this string is a "null" string
or not. | |||
The defaultl constructor. | ||||
The copying constructor. | ||||
The constructor. Assigns a given string to
the constructed String object. |
Makes a copy of a given string.
String& operator = (const char *str)
Returns a pointer to the string contained in this String object.
operator const char* () const
Performs symbol-by-symbol comparison between the string contained in this String object and a given string.
const bool operator == (const char *str)
Performs an alphabetic comparison between the string contained in this String object and a given string.
const bool operator > (const char *str)
Performs symbol-by-symbol comparison between the string contained in this String object and a string contained in a given String object.
const bool operator == (const String &s)
Performs symbol-by-symbol comparison between the string contained in this String object and a string contained in a given String object.
const bool operator > (const String &s)
Returns a pointer to the string contained in this String object.
const char* getData () const
Assigns a given string to this String object without copying the string.
The string must persist during lifetime of this String object until another string is asigned to it.
void setStatic (const char *str)
| str : | The string to be assigned to this String object, or NULL. |
Assigns a given string to this String object without copying the string, but with granting "the ownership" of the string to the String object.
void setOwn (const char *str, FreeCallback freeCallback = dynamicFreeCallback)
| str : | The string to be assigned to this String object, or NULL. |
| freeCallback : | The callback to be called when the string is no longer used by this String object. |
Assigns a given string to this String object by creating a copy of the string.
void set (const char *str, unsigned len = 0)
| str : | The string to be assigned to this String object, or NULL. |
| len : | The length of the string. 0 means that the string is zero-terminated. |
Creates a new String object and assigns a given string to it as a static string.
See setStatic method description for details.
| str : | The string to be assigned to the newly created String object. |
Creates a new String object and assignes a given string to it by granting "the ownership".
See setOwn method desecription for details.
| str : | The string to be assigned to the newly created String object. |
| freeCallback : | The callback to be called when the string is no longer used by the newly created String object. |
Creates a new String object and initializes it with a string formed according to the specified format.
The format is (almost) identical to that of the printf function. See "man printf" for details.
| fmt : | The format string. |
Returns a reference to the "null" string.
The null string is a global String object that represents a string with no associated string data. Its purpose is to differentiate null strings from empty strings.
Determines whether this string is a "null" string or not.
bool isNullString ()
The defaultl constructor.
String ()
The copying constructor.
String (String &str)
The constructor. Assigns a given string to the constructed String object.
A copy of the specified string is created. See set method description for details.
String (const char *str)
| str : | The string to be assigned to the constructed String object. |