The exom framework provide its own string class, to be independent from any other library as well from the STL providing std::string. Its behavior (in time complexity) is similar to std::string.
The internal representation is realized with char* terminated with 0 accessible by cstr(). The terminating 0 will always set by the class when changing the size of the string.
The empty string "" is implementented internally by pointing to the prepared string define with
|
Public Member Functions |
| int | GetSize () const |
| | Return the number of characters including the terminating 0.
|
|
int | GetCapacity () const |
| | Return the number of characters reserved by the container.
|
|
void | SetGrowOnly (bool flag) |
| | Enable/disable the possibility to reduced its capacity.
|
|
bool | GetGrowOnly () const |
| | Return true, if vector can't reduced its capacity.
|
|
char * | cstr () const |
| | Return the pointer to the internal string representation.
|
|
| XmString () |
| | Construct an empty string "".
|
|
| XmString (const XmString &a) |
| | Copy constructor for a string.
|
|
| ~XmString () |
| | Destructor.
|
|
XmString & | operator= (const XmString &a) |
| | string assignment
|
|
void | Reserve (int abs) |
| | Reserve the absolute number of charachters, if current GetCapacity() is smaller.
|
|
void | SetSize (int iSize) |
| | Set the string size, without copying any characters.
|
|
void | Resize (int iSize) |
| | Set the string size by adding or removing charcters at the end of the vector.
|
|
void | AddSize (int iNum, int growSize) |
| | Change the string size by adding the specified number of characters.
|
|
| XmString (const char *str) |
| | Construct a string with given string.
|
|
int | GetLen () const |
| | Return the string length without the terminating 0.
|
|
void | AssignStr (const XmString &str) |
| | Assign another string to this string instance.
|
|
void | AssignStr (const char *str) |
| | Assign the given 0 terminated string to this instance.
|
|
void | AssignStr (const char *str, int len) |
| | Assign the given string using the specified length.
|
|
void | Clear () |
| | Clear the string to "".
|
|
void | AppendStr (const XmString &str) |
| | Append the given string.
|
|
void | AppendStr (const char *str) |
| | Append the given 0 terminated string.
|
|
void | AppendStr (const char *str, int len) |
| | Append given string using the specified length.
|
|
void | AppendChar (char c) |
| | Append a character.
|
|
bool | TextSet () const |
| | Return true, if string is not empty (!= "").
|
|
bool | operator== (const char *str) const |
| | Return true if strings are equal.
|
|
bool | operator!= (const char *str) const |
| | Return true if strings are not equal.
|
|
bool | operator== (const XmString &str) const |
| | Return true if strings are equal.
|
|
bool | operator!= (const XmString &str) const |
| | Return true if strings are not equal.
|
|
xmUInt32 | HashCode () const |
| | Return a hash code of the string.
|
Static Public Member Functions |
|
static xmUInt32 | StrHashCode (const char *str) |
| | Return a hash code of the given string.
|
|
static xmUInt32 | StrHashCode (const char *str, int len) |
| | Return a hash code of the given string.
|