Public Member Functions |
| String () |
| Construct empty.
|
| String (const String &str) |
| Construct from another string.
|
| String (const char *str) |
| Construct from a C string.
|
| String (char *str) |
| Construct from a C string.
|
| String (const char *str, unsigned length) |
| Construct from a char array and length.
|
| String (const wchar_t *str) |
| Construct from a null-terminated wide character array.
|
| String (wchar_t *str) |
| Construct from a null-terminated wide character array.
|
| String (const WString &str) |
| Construct from a wide character string.
|
| String (int value) |
| Construct from an integer.
|
| String (short value) |
| Construct from a short integer.
|
| String (unsigned value) |
| Construct from an unsigned integer.
|
| String (unsigned short value) |
| Construct from an unsigned short integer.
|
| String (float value) |
| Construct from a float.
|
| String (double value) |
| Construct from a double.
|
| String (bool value) |
| Construct from a bool.
|
| String (char value) |
| Construct from a character.
|
| String (char value, unsigned length) |
| Construct from a character and fill length.
|
template<class T > |
| String (const T &value) |
| Construct from a convertable value.
|
| ~String () |
| Destruct.
|
String & | operator= (const String &rhs) |
| Assign a string.
|
String & | operator= (const char *rhs) |
| Assign a C string.
|
String & | operator+= (const String &rhs) |
| Add-assign a string.
|
String & | operator+= (const char *rhs) |
| Add-assign a C string.
|
String & | operator+= (char rhs) |
| Add-assign a character.
|
String & | operator+= (int rhs) |
| Add-assign an integer.
|
String & | operator+= (short rhs) |
| Add-assign a short integer.
|
String & | operator+= (unsigned rhs) |
| Add-assign an unsigned integer.
|
String & | operator+= (unsigned short rhs) |
| Add-assign a short unsigned integer.
|
String & | operator+= (float rhs) |
| Add-assign a float.
|
String & | operator+= (bool rhs) |
| Add-assign a bool.
|
template<class T > |
String | operator+= (const T &rhs) |
| Add-assign an arbitraty type.
|
String | operator+ (const String &rhs) const |
| Add a string.
|
String | operator+ (const char *rhs) const |
| Add a C string.
|
String | operator+ (char rhs) const |
| Add a character.
|
bool | operator== (const String &rhs) const |
| Test for equality with another string.
|
bool | operator!= (const String &rhs) const |
| Test for inequality with another string.
|
bool | operator< (const String &rhs) const |
| Test if string is less than another string.
|
bool | operator> (const String &rhs) const |
| Test if string is greater than another string.
|
bool | operator== (const char *rhs) const |
| Test for equality with a C string.
|
bool | operator!= (const char *rhs) const |
| Test for inequality with a C string.
|
bool | operator< (const char *rhs) const |
| Test if string is less than a C string.
|
bool | operator> (const char *rhs) const |
| Test if string is greater than a C string.
|
char & | operator[] (unsigned index) |
| Return char at index.
|
const char & | operator[] (unsigned index) const |
| Return const char at index.
|
char & | At (unsigned index) |
| Return char at index.
|
const char & | At (unsigned index) const |
| Return const char at index.
|
void | Replace (char replaceThis, char replaceWith) |
| Replace all occurrences of a character.
|
void | Replace (const String &replaceThis, const String &replaceWith) |
| Replace all occurrences of a string.
|
void | Replace (unsigned pos, unsigned length, const String &replaceWith) |
| Replace a substring.
|
Iterator | Replace (const Iterator &start, const Iterator &end, const String &replaceWith) |
| Replace a substring by iterators.
|
String | Replaced (char replaceThis, char replaceWith) const |
| Return a string with all occurrences of a character replaced.
|
String | Replaced (const String &replaceThis, const String &replaceWith) const |
| Return a string with all occurrences of a string replaced.
|
void | Append (const String &str) |
| Append a string.
|
void | Append (const char *str) |
| Append a C string.
|
void | Append (char c) |
| Append a character.
|
void | Append (const char *str, unsigned length) |
| Append characters.
|
void | Insert (unsigned pos, const String &str) |
| Insert a string.
|
void | Insert (unsigned pos, char c) |
| Insert a character.
|
Iterator | Insert (const Iterator &dest, const String &str) |
| Insert a string using an iterator.
|
Iterator | Insert (const Iterator &dest, const Iterator &start, const Iterator &end) |
| Insert a string partially by iterators.
|
Iterator | Insert (const Iterator &dest, char c) |
| Insert a character using an iterator.
|
void | Erase (unsigned pos, unsigned length=1) |
| Erase a substring.
|
Iterator | Erase (const Iterator &it) |
| Erase a character by iterator.
|
Iterator | Erase (const Iterator &start, const Iterator &end) |
| Erase a substring by iterators.
|
void | Resize (unsigned newLength) |
| Resize the string.
|
void | Reserve (unsigned newCapacity) |
| Set new capacity.
|
void | Compact () |
| Reallocate so that no extra memory is used.
|
void | Clear () |
| Clear the string.
|
void | Swap (String &str) |
| Swap with another string.
|
Iterator | Begin () |
| Return iterator to the beginning.
|
ConstIterator | Begin () const |
| Return const iterator to the beginning.
|
Iterator | End () |
| Return iterator to the end.
|
ConstIterator | End () const |
| Return const iterator to the end.
|
char | Front () const |
| Return first char, or 0 if empty.
|
char | Back () const |
| Return last char, or 0 if empty.
|
String | Substring (unsigned pos) const |
| Return a substring from position to end.
|
String | Substring (unsigned pos, unsigned length) const |
| Return a substring with length from position.
|
String | Trimmed () const |
| Return string with whitespace trimmed from the beginning and the end.
|
String | ToUpper () const |
| Return string in uppercase.
|
String | ToLower () const |
| Return string in lowercase.
|
Vector< String > | Split (char separator) const |
| Return substrings split by a separator char.
|
unsigned | Find (const String &str, unsigned startPos=0) const |
| Return index to the first occurrence of a string, or NPOS if not found.
|
unsigned | Find (char c, unsigned startPos=0) const |
| Return index to the first occurrence of a character, or NPOS if not found.
|
unsigned | FindLast (const String &str, unsigned startPos=NPOS) const |
| Return index to the last occurrence of a string, or NPOS if not found.
|
unsigned | FindLast (char c, unsigned startPos=NPOS) const |
| Return index to the last occurrence of a character, or NPOS if not found.
|
bool | StartsWith (const String &str) const |
| Return whether starts with a string.
|
bool | EndsWith (const String &str) const |
| Return whether ends with a string.
|
const char * | CString () const |
| Return the C string.
|
unsigned | Length () const |
| Return length.
|
unsigned | Capacity () const |
| Return buffer capacity.
|
bool | Empty () const |
| Return whether the string is empty.
|
int | Compare (const String &str, bool caseSensitive=true) const |
| Return comparision result with a string.
|
int | Compare (const char *str, bool caseSensitive=true) const |
| Return comparision result with a C string.
|
bool | Contains (const String &str) const |
| Return whether contains a specific occurences of string.
|
bool | Contains (char c) const |
| Return whether contains a specific character.
|
void | SetUTF8FromLatin1 (const char *str) |
| Construct UTF8 content from Latin1.
|
void | SetUTF8FromWChar (const wchar_t *str) |
| Construct UTF8 content from wide characters.
|
unsigned | LengthUTF8 () const |
| Calculate number of characters in UTF8 content.
|
unsigned | ByteOffsetUTF8 (unsigned index) const |
| Return byte offset to char in UTF8 content.
|
unsigned | NextUTF8Char (unsigned &byteOffset) const |
| Return next Unicode character from UTF8 content and increase byte offset.
|
unsigned | AtUTF8 (unsigned index) const |
| Return Unicode character at index from UTF8 content.
|
void | ReplaceUTF8 (unsigned index, unsigned unicodeChar) |
| Replace Unicode character at index from UTF8 content.
|
void | AppendUTF8 (unsigned unicodeChar) |
| Append Unicode character at the end as UTF8.
|
String | SubstringUTF8 (unsigned pos) const |
| Return a UTF8 substring from position to end.
|
String | SubstringUTF8 (unsigned pos, unsigned length) const |
| Return a UTF8 substring with length from position.
|
unsigned | ToHash () const |
| Return hash value for HashSet & HashMap.
|
void | AppendWithFormat (const char *formatString,...) |
| Append to string using formatting.
|
void | AppendWithFormatArgs (const char *formatString, va_list args) |
| Append to string using variable arguments.
|