|
| String () noexcept |
| Construct empty.
|
|
| String (const String &str) |
| Construct from another string.
|
|
| String (String &&str) noexcept |
| Move-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, i32 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 (long value) |
| Construct from a long integer.
|
|
| String (long long value) |
| Construct from a long long integer.
|
|
| String (unsigned value) |
| Construct from an unsigned integer.
|
|
| String (unsigned short value) |
| Construct from an unsigned short integer.
|
|
| String (unsigned long value) |
| Construct from an unsigned long integer.
|
|
| String (unsigned long long value) |
| Construct from an unsigned long long 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, i32 length) |
| Construct from a character and fill length.
|
|
template<class T > |
| String (const T &value) |
| Construct from a convertible value.
|
|
| ~String () |
| Destruct.
|
|
String & | operator= (const String &rhs) |
| Assign a string.
|
|
String & | operator= (String &&rhs) noexcept |
| Move-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 (concatenate as string) an integer.
|
|
String & | operator+= (short rhs) |
| Add-assign (concatenate as string) a short integer.
|
|
String & | operator+= (long rhs) |
| Add-assign (concatenate as string) a long integer.
|
|
String & | operator+= (long long rhs) |
| Add-assign (concatenate as string) a long long integer.
|
|
String & | operator+= (unsigned rhs) |
| Add-assign (concatenate as string) an unsigned integer.
|
|
String & | operator+= (unsigned short rhs) |
| Add-assign (concatenate as string) a short unsigned integer.
|
|
String & | operator+= (unsigned long rhs) |
| Add-assign (concatenate as string) a long unsigned integer.
|
|
String & | operator+= (unsigned long long rhs) |
| Add-assign (concatenate as string) a long long unsigned integer.
|
|
String & | operator+= (float rhs) |
| Add-assign (concatenate as string) a float.
|
|
String & | operator+= (bool rhs) |
| Add-assign (concatenate as string) a bool.
|
|
template<class T > |
String & | operator+= (const T &rhs) |
| Add-assign (concatenate as string) an arbitrary type.
|
|
String | operator+ (const String &rhs) const |
| Add a string.
|
|
String | operator+ (const char *rhs) const |
| Add a C string.
|
|
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[] (i32 index) |
| Return char at index.
|
|
const char & | operator[] (i32 index) const |
| Return const char at index.
|
|
char & | At (i32 index) |
| Return char at index.
|
|
const char & | At (i32 index) const |
| Return const char at index.
|
|
void | Replace (char replaceThis, char replaceWith, bool caseSensitive=true) |
| Replace all occurrences of a character.
|
|
void | Replace (const String &replaceThis, const String &replaceWith, bool caseSensitive=true) |
| Replace all occurrences of a string.
|
|
void | Replace (i32 pos, i32 length, const String &replaceWith) |
| Replace a substring.
|
|
void | Replace (i32 pos, i32 length, const char *replaceWith) |
| Replace a substring with a C string.
|
|
Iterator | Replace (const Iterator &start, const Iterator &end, const String &replaceWith) |
| Replace a substring by iterators.
|
|
String | Replaced (char replaceThis, char replaceWith, bool caseSensitive=true) const |
| Return a string with all occurrences of a character replaced.
|
|
String | Replaced (const String &replaceThis, const String &replaceWith, bool caseSensitive=true) const |
| Return a string with all occurrences of a string replaced.
|
|
String & | Append (const String &str) |
| Append a string.
|
|
String & | Append (const char *str) |
| Append a C string.
|
|
String & | Append (char c) |
| Append a character.
|
|
String & | Append (const char *str, i32 length) |
| Append characters.
|
|
void | Insert (i32 pos, const String &str) |
| Insert a string.
|
|
void | Insert (i32 pos, char c) |
| Insert a character.
|
|
Iterator | Insert (const Iterator &dest, const String &str) |
| Insert a string by 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 by iterator.
|
|
void | Erase (i32 pos, i32 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 (i32 newLength) |
| Resize the string. Can increase capacity, but never decrease.
|
|
void | Reserve (i32 newCapacity) |
| Set new capacity. New capacity may differ from requested.
|
|
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 (i32 pos) const |
| Return a substring from position to end.
|
|
String | Substring (i32 pos, i32 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, bool keepEmptyStrings=false) const |
| Return substrings split by a separator char. By default don't return empty strings.
|
|
void | Join (const Vector< String > &subStrings, const String &glue) |
| Join substrings with a 'glue' string.
|
|
i32 | Find (const String &str, i32 startPos=0, bool caseSensitive=true) const |
| Return index to the first occurrence of a string, or NPOS if not found.
|
|
i32 | Find (char c, i32 startPos=0, bool caseSensitive=true) const |
| Return index to the first occurrence of a character, or NPOS if not found.
|
|
i32 | FindLast (const String &str, i32 startPos=NPOS, bool caseSensitive=true) const |
| Return index to the last occurrence of a string, or NPOS if not found.
|
|
i32 | FindLast (char c, i32 startPos=NPOS, bool caseSensitive=true) const |
| Return index to the last occurrence of a character, or NPOS if not found.
|
|
bool | StartsWith (const String &str, bool caseSensitive=true) const |
| Return whether starts with a string.
|
|
bool | EndsWith (const String &str, bool caseSensitive=true) const |
| Return whether ends with a string.
|
|
char * | GetBuffer () |
| Return pointer to buffer.
|
|
const char * | GetBuffer () const |
| Return pointer to buffer.
|
|
const char * | CString () const |
| Return the C string.
|
|
i32 | Length () const |
| Return length.
|
|
i32 | Capacity () const |
| Return buffer capacity.
|
|
bool | Empty () const |
| Return whether the string is empty.
|
|
int | Compare (const String &str, bool caseSensitive=true) const |
| Return comparison result with a string.
|
|
int | Compare (const char *str, bool caseSensitive=true) const |
| Return comparison result with a C string.
|
|
bool | Contains (const String &str, bool caseSensitive=true) const |
| Return whether contains a specific occurrence of a string.
|
|
bool | Contains (char c, bool caseSensitive=true) 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.
|
|
i32 | LengthUTF8 () const |
| Calculate number of characters in UTF8 content.
|
|
i32 | ByteOffsetUTF8 (i32 index) const |
| Return byte offset to char in UTF8 content.
|
|
c32 | NextUTF8Char (i32 &byteOffset) const |
| Return next Unicode character from UTF8 content and increase byte offset.
|
|
c32 | AtUTF8 (i32 index) const |
| Return Unicode character at index from UTF8 content.
|
|
void | ReplaceUTF8 (i32 index, c32 unicodeChar) |
| Replace Unicode character at index from UTF8 content.
|
|
String & | AppendUTF8 (c32 unicodeChar) |
| Append Unicode character at the end as UTF8.
|
|
String | SubstringUTF8 (i32 pos) const |
| Return a UTF8 substring from position to end.
|
|
String | SubstringUTF8 (i32 pos, i32 length) const |
| Return a UTF8 substring with length from position.
|
|
hash32 | ToHash () const |
| Return hash value for HashSet & HashMap.
|
|
String & | AppendWithFormat (const char *formatString,...) |
| Append to string using formatting.
|
|
String & | AppendWithFormatArgs (const char *formatString, va_list args) |
| Append to string using variable arguments.
|
|
bool | IsShort () const |
| Is the string stored on the stack?
|
|