Unicode String. More...
#include <decUnicodeString.h>
Public Member Functions | |
Accessors and Mutators | |
| int | GetLength () const |
| Retrieves the count of characters in the unicode string. | |
| int | GetCharacterAt (int position) const |
| Retrieves the unicode character at the given location. | |
| void | SetCharacterAt (int position, int character) |
| Sets the unicode character at the given location. | |
| void | GetLeft (int count, decUnicodeString &storage) const |
| Retrieves a new unicode string with the given number of characters starting from the beginning of the unicode string. | |
| void | GetRight (int count, decUnicodeString &storage) const |
| Retrieves a new unicode string with the given number of characters starting from the end of the unicode string. | |
| void | GetSubString (int position, int count, decUnicodeString &storage) const |
| Retrieves a new unicode string with the given number of characters starting from the given position in unicode string. | |
| void | Reverse (decUnicodeString &storage) const |
| Retrieves a new unicode string with the reversed order of characters. | |
Trimming | |
| void | TrimLeft (decUnicodeString &storage) const |
| Retrieves a new unicode string with all white spaces stripped from the beginning of the unicode string up to the first non white space character. | |
| void | TrimRight (decUnicodeString &storage) const |
| Retrieves a new unicode string with all white spaces stripped from the end of the unicode string up to the first non white space character. | |
| void | TrimBoth (decUnicodeString &storage) const |
| Retrieves a new unicode string with all white spaces stripped from the beginning and end of the unicode string up to the first non white space character. | |
| void | SetFromUTF8 (const char *string) |
| Set unicode string from the given utf8 encoded string. | |
| void | AppendFromUTF8 (const char *string) |
| Append unicode string from the given utf8 encoded string. | |
| void | AppendCharacter (int character) |
| Append unicode character. | |
Searching | |
| int | FindCharacter (int character, int position) const |
| Retrieves the position of the first occurance of the given character from the given position to the end or -1 if the character does not appear in the unicode string. | |
| int | FindCharacterReverse (int character, int position) const |
| Retrieves the position of the first occurance of the given character from the given position to the start or -1 if the character does not appear in the unicode string. | |
Comparison | |
| int | CompareTo (const decUnicodeString &string) const |
| Compares cases sensitive to another unicode string and return 0 if both are equal, 1 if the first differing character in this unicode string is larger or -1 if it is smaller. | |
| int | CompareToNoCase (const decUnicodeString &string) const |
| Compares cases insensitive to another unicode string and return 0 if both are equal, 1 if the first differing character in this unicode string is larger or -1 if it is smaller. | |
| int | GetHashCode () const |
| Retrieves the hash value of this unicode string ( TODO ). | |
Conversion | |
| void | ToLower (decUnicodeString &storage) const |
| Creates a new unicode string with all characters converted to lower case. | |
| void | ToUpper (decUnicodeString &storage) const |
| Creates a new unicode string with all characters converted to upper case. | |
| int | ToInt () const |
| Retrieves unicode string as integer if possible. | |
| float | ToFloat () const |
| Retrieves the string as floating point value if possible. | |
| int | ToUTF8 (char *storage, int length) const |
| Retrieves the string representation of the unicode string with is an UTF8 encoded string. | |
| void | ToUTF8 (decString &string) const |
| Retrieves the UTF8 representation of the unicode string. | |
| decString | ToUTF8 () const |
| Retrieves the UTF8 representation of the unicode string. | |
Operators | |
| int | operator[] (int position) const |
| Retrieves the character at the given index. | |
| bool | operator== (const decUnicodeString &string) const |
| Compares this two unicode strings case sensitive. | |
| decUnicodeString & | operator= (const decUnicodeString &string) |
| Copies the given unicode string into this string. | |
| decUnicodeString | operator+ (const decUnicodeString &string) const |
| Creates a new unicode string with the given unicode string appended to this one. | |
| decUnicodeString | operator+ (bool value) const |
| Creates a new unicode string with the given bool appended to this unicode string. | |
| decUnicodeString | operator+ (int value) const |
| Creates a new unicode string with the given integer appended to this unicode string. | |
| decUnicodeString | operator+ (float value) const |
| Creates a new unicode string with the given float appended to this unicode string. | |
| decUnicodeString & | operator+= (const decUnicodeString &string) |
| Stores a new unicode string with the given unicode string appended to this one. | |
| decUnicodeString & | operator+= (bool value) |
| Stores a new unicode string with the given bool appended to this unicode string. | |
| decUnicodeString & | operator+= (int value) |
| Stores a new unicode string with the given integer appended to this unicode string. | |
| decUnicodeString & | operator+= (float value) |
| Stores a new unicode string with the given float appended to this unicode string. | |
Constructors and Destructors | |
| decUnicodeString () | |
| Creates a new empty unicode string. | |
| decUnicodeString (const decUnicodeString &string) | |
| Creates a new unicode string as a copy of the given unicode string. | |
| decUnicodeString (int character) | |
| Creates a new unicode string from the given unicode character. | |
| ~decUnicodeString () | |
| Frees the unicode string. | |
| static decUnicodeString | NewFromUTF8 (const char *string) |
| Creates a new unicode string from the given utf8 encoded string. | |
Unicode String.
Manages a string in unicode format. Supports encoding and decoding UTF8 formatted strings.
| decUnicodeString::decUnicodeString | ( | ) |
Creates a new empty unicode string.
| decUnicodeString::decUnicodeString | ( | const decUnicodeString & | string ) |
Creates a new unicode string as a copy of the given unicode string.
| decUnicodeString::decUnicodeString | ( | int | character ) |
Creates a new unicode string from the given unicode character.
| decUnicodeString::~decUnicodeString | ( | ) |
Frees the unicode string.
| void decUnicodeString::AppendCharacter | ( | int | character ) |
Append unicode character.
| void decUnicodeString::AppendFromUTF8 | ( | const char * | string ) |
Append unicode string from the given utf8 encoded string.
| int decUnicodeString::CompareTo | ( | const decUnicodeString & | string ) | const |
Compares cases sensitive to another unicode string and return 0 if both are equal, 1 if the first differing character in this unicode string is larger or -1 if it is smaller.
| int decUnicodeString::CompareToNoCase | ( | const decUnicodeString & | string ) | const |
Compares cases insensitive to another unicode string and return 0 if both are equal, 1 if the first differing character in this unicode string is larger or -1 if it is smaller.
| int decUnicodeString::FindCharacter | ( | int | character, |
| int | position | ||
| ) | const |
Retrieves the position of the first occurance of the given character from the given position to the end or -1 if the character does not appear in the unicode string.
| int decUnicodeString::FindCharacterReverse | ( | int | character, |
| int | position | ||
| ) | const |
Retrieves the position of the first occurance of the given character from the given position to the start or -1 if the character does not appear in the unicode string.
| int decUnicodeString::GetCharacterAt | ( | int | position ) | const |
Retrieves the unicode character at the given location.
| int decUnicodeString::GetHashCode | ( | ) | const |
Retrieves the hash value of this unicode string ( TODO ).
| void decUnicodeString::GetLeft | ( | int | count, |
| decUnicodeString & | storage | ||
| ) | const |
Retrieves a new unicode string with the given number of characters starting from the beginning of the unicode string.
Stores the string into storage.
| int decUnicodeString::GetLength | ( | ) | const [inline] |
Retrieves the count of characters in the unicode string.
| void decUnicodeString::GetRight | ( | int | count, |
| decUnicodeString & | storage | ||
| ) | const |
Retrieves a new unicode string with the given number of characters starting from the end of the unicode string.
Stores the string into storage.
| void decUnicodeString::GetSubString | ( | int | position, |
| int | count, | ||
| decUnicodeString & | storage | ||
| ) | const |
Retrieves a new unicode string with the given number of characters starting from the given position in unicode string.
Stores the string into storage.
| static decUnicodeString decUnicodeString::NewFromUTF8 | ( | const char * | string ) | [static] |
Creates a new unicode string from the given utf8 encoded string.
| decUnicodeString decUnicodeString::operator+ | ( | bool | value ) | const |
Creates a new unicode string with the given bool appended to this unicode string.
| decUnicodeString decUnicodeString::operator+ | ( | float | value ) | const |
Creates a new unicode string with the given float appended to this unicode string.
| decUnicodeString decUnicodeString::operator+ | ( | int | value ) | const |
Creates a new unicode string with the given integer appended to this unicode string.
| decUnicodeString decUnicodeString::operator+ | ( | const decUnicodeString & | string ) | const |
Creates a new unicode string with the given unicode string appended to this one.
| decUnicodeString& decUnicodeString::operator+= | ( | const decUnicodeString & | string ) |
Stores a new unicode string with the given unicode string appended to this one.
| decUnicodeString& decUnicodeString::operator+= | ( | bool | value ) |
Stores a new unicode string with the given bool appended to this unicode string.
| decUnicodeString& decUnicodeString::operator+= | ( | int | value ) |
Stores a new unicode string with the given integer appended to this unicode string.
| decUnicodeString& decUnicodeString::operator+= | ( | float | value ) |
Stores a new unicode string with the given float appended to this unicode string.
| decUnicodeString& decUnicodeString::operator= | ( | const decUnicodeString & | string ) |
Copies the given unicode string into this string.
| bool decUnicodeString::operator== | ( | const decUnicodeString & | string ) | const |
Compares this two unicode strings case sensitive.
| int decUnicodeString::operator[] | ( | int | position ) | const |
Retrieves the character at the given index.
| void decUnicodeString::Reverse | ( | decUnicodeString & | storage ) | const |
Retrieves a new unicode string with the reversed order of characters.
Stores the string into storage.
| void decUnicodeString::SetCharacterAt | ( | int | position, |
| int | character | ||
| ) |
Sets the unicode character at the given location.
| void decUnicodeString::SetFromUTF8 | ( | const char * | string ) |
Set unicode string from the given utf8 encoded string.
| float decUnicodeString::ToFloat | ( | ) | const |
Retrieves the string as floating point value if possible.
| int decUnicodeString::ToInt | ( | ) | const |
Retrieves unicode string as integer if possible.
| void decUnicodeString::ToLower | ( | decUnicodeString & | storage ) | const |
Creates a new unicode string with all characters converted to lower case.
Stores the string into storage.
| void decUnicodeString::ToUpper | ( | decUnicodeString & | storage ) | const |
Creates a new unicode string with all characters converted to upper case.
Stores the string into storage.
| void decUnicodeString::ToUTF8 | ( | decString & | string ) | const |
Retrieves the UTF8 representation of the unicode string.
| int decUnicodeString::ToUTF8 | ( | char * | storage, |
| int | length | ||
| ) | const |
Retrieves the string representation of the unicode string with is an UTF8 encoded string.
This function works in two modes. If storage is NULL length is ignored and the required size for the string is returned. If storage is not NULL then the converted string is written into storage up to length bytes and the number of bytes written is returned. Remaining bytes will not be written. Should this happen the function makes sure only full characters are written so the converted string is valid.
| decString decUnicodeString::ToUTF8 | ( | ) | const |
Retrieves the UTF8 representation of the unicode string.
| void decUnicodeString::TrimBoth | ( | decUnicodeString & | storage ) | const |
Retrieves a new unicode string with all white spaces stripped from the beginning and end of the unicode string up to the first non white space character.
Stores the string into storage.
| void decUnicodeString::TrimLeft | ( | decUnicodeString & | storage ) | const |
Retrieves a new unicode string with all white spaces stripped from the beginning of the unicode string up to the first non white space character.
Stores the string into storage.
| void decUnicodeString::TrimRight | ( | decUnicodeString & | storage ) | const |
Retrieves a new unicode string with all white spaces stripped from the end of the unicode string up to the first non white space character.
Stores the string into storage.
1.7.2