arsa
2.7
|
UTF-16 string class. More...
#include <irrUString.h>
Classes | |
class | _ustring16_const_iterator |
Iterator to iterate through a UTF-16 string. More... | |
class | _ustring16_iterator |
Iterator to iterate through a UTF-16 string. More... | |
class | _ustring16_iterator_access |
Access an element in a unicode string, allowing one to change it. More... | |
Public Types | |
typedef ustring16< TAlloc >::_ustring16_iterator_access | access |
typedef ustring16< TAlloc >::_ustring16_iterator | iterator |
typedef ustring16< TAlloc >::_ustring16_const_iterator | const_iterator |
Public Member Functions | |
ustring16 () | |
Default constructor. More... | |
ustring16 (const ustring16< TAlloc > &other) | |
Constructor. More... | |
template<class B , class A > | |
ustring16 (const string< B, A > &other) | |
Constructor from other string types. More... | |
ustring16 (const char *const c) | |
Constructor for copying a character string from a pointer. More... | |
ustring16 (const char *const c, size_t length) | |
Constructor for copying a character string from a pointer with a given length. More... | |
ustring16 (const uchar8_t *const c) | |
Constructor for copying a UTF-8 string from a pointer. More... | |
ustring16 (const char c) | |
Constructor for copying a UTF-8 string from a single char. More... | |
ustring16 (const uchar8_t *const c, size_t length) | |
Constructor for copying a UTF-8 string from a pointer with a given length. More... | |
ustring16 (const uchar16_t *const c) | |
Constructor for copying a UTF-16 string from a pointer. More... | |
ustring16 (const uchar16_t *const c, size_t length) | |
Constructor for copying a UTF-16 string from a pointer with a given length. More... | |
ustring16 (const uchar32_t *const c) | |
Constructor for copying a UTF-32 string from a pointer. More... | |
ustring16 (const uchar32_t *const c, size_t length) | |
Constructor for copying a UTF-32 from a pointer with a given length. More... | |
ustring16 (const wchar_t *const c) | |
Constructor for copying a wchar_t string from a pointer. More... | |
ustring16 (const wchar_t *const c, size_t length) | |
Constructor for copying a wchar_t string from a pointer with a given length. More... | |
~ustring16 () | |
Destructor. More... | |
ustring16 & | operator= (const ustring16< TAlloc > &other) |
Assignment operator. More... | |
template<class B , class A > | |
ustring16< TAlloc > & | operator= (const string< B, A > &other) |
Assignment operator for other string types. More... | |
ustring16< TAlloc > & | operator= (const uchar8_t *const c) |
Assignment operator for UTF-8 strings. More... | |
ustring16< TAlloc > & | operator= (const uchar16_t *const c) |
Assignment operator for UTF-16 strings. More... | |
ustring16< TAlloc > & | operator= (const uchar32_t *const c) |
Assignment operator for UTF-32 strings. More... | |
ustring16< TAlloc > & | operator= (const wchar_t *const c) |
Assignment operator for wchar_t strings. More... | |
template<class B > | |
ustring16< TAlloc > & | operator= (const B *const c) |
Assignment operator for other strings. More... | |
access | operator [] (const size_t index) |
Direct access operator. More... | |
const access | operator [] (const size_t index) const |
Direct access operator. More... | |
bool | operator== (const uchar16_t *const str) const |
Equality operator. More... | |
bool | operator== (const ustring16< TAlloc > &other) const |
Equality operator. More... | |
bool | operator< (const ustring16< TAlloc > &other) const |
Is smaller comparator. More... | |
bool | operator != (const uchar16_t *const str) const |
Inequality operator. More... | |
bool | operator != (const ustring16< TAlloc > &other) const |
Inequality operator. More... | |
size_t | size () const |
bool | empty () const |
const uchar16_t * | c_str () const |
bool | equalsn (const ustring16< TAlloc > &other, size_t n) const |
bool | equalsn (const uchar16_t *const str, size_t n) const |
ustring16< TAlloc > & | append (uchar32_t character) |
ustring16< TAlloc > & | append (const uchar8_t *const other, size_t length=0xffffffff) |
ustring16< TAlloc > & | append (const uchar16_t *const other, size_t length=0xffffffff) |
ustring16< TAlloc > & | append (const uchar32_t *const other, size_t length=0xffffffff) |
ustring16< TAlloc > & | append (const ustring16< TAlloc > &other) |
ustring16< TAlloc > & | append (const ustring16< TAlloc > &other, size_t length) |
void | reserve (size_t count) |
size_t | findFirst (uchar32_t c) const |
size_t | findFirstChar (const uchar32_t *const c, size_t count=1) const |
size_t | findFirstCharNotInList (const uchar32_t *const c, size_t count=1) const |
size_t | findLastCharNotInList (const uchar32_t *const c, size_t count=1) const |
size_t | findNext (uchar32_t c, size_t startPos) const |
size_t | findLast (uchar32_t c, size_t start=ustring16< TAlloc >::npos) const |
size_t | findLastChar (const uchar32_t *const c, size_t count=1) const |
size_t | find (const ustring16< TAlloc > &str, const size_t start=0) const |
size_t | find_raw (const ustring16< TAlloc > &str, const size_t start=0) const |
ustring16< TAlloc > | subString (size_t begin, size_t length) const |
ustring16< TAlloc > & | operator+= (char c) |
ustring16< TAlloc > & | operator+= (uchar32_t c) |
ustring16< TAlloc > & | operator+= (short c) |
ustring16< TAlloc > & | operator+= (unsigned short c) |
ustring16< TAlloc > & | operator+= (long c) |
ustring16< TAlloc > & | operator+= (unsigned long c) |
ustring16< TAlloc > & | operator+= (double c) |
ustring16< TAlloc > & | operator+= (const uchar16_t *const c) |
ustring16< TAlloc > & | operator+= (const ustring16< TAlloc > &other) |
ustring16< TAlloc > & | replace (uchar32_t toReplace, uchar32_t replaceWith) |
ustring16< TAlloc > & | replace (const ustring16< TAlloc > &toReplace, const ustring16< TAlloc > &replaceWith) |
ustring16< TAlloc > & | remove (uchar32_t c) |
ustring16< TAlloc > & | remove (const ustring16< TAlloc > &toRemove) |
ustring16< TAlloc > & | removeChars (const ustring16< TAlloc > &characters) |
ustring16< TAlloc > & | trim (const ustring16< TAlloc > &whitespace=" \t\n\r") |
ustring16< TAlloc > & | erase (size_t index) |
ustring16< TAlloc > & | validate () |
uchar32_t | lastChar () const |
template<class container > | |
size_t | split (container &ret, const uchar32_t *const c, size_t count=1, bool ignoreEmptyTokens=true, bool keepSeparators=false) const |
Split the ustring16 into parts. More... | |
template<class container > | |
size_t | split (container &ret, const ustring16< TAlloc > &c, bool ignoreEmptyTokens=true, bool keepSeparators=false) const |
Split the ustring16 into parts. More... | |
size_t | capacity () const |
size_t | size_raw () const |
ustring16< TAlloc > & | insert (uchar32_t c, size_t pos) |
ustring16< TAlloc > & | insert (const ustring16< TAlloc > &c, size_t pos) |
ustring16< TAlloc > & | insert_raw (uchar16_t c, size_t pos) |
ustring16< TAlloc > & | erase_raw (size_t pos) |
ustring16< TAlloc > & | replace_raw (uchar16_t c, size_t pos) |
iterator | begin () |
const_iterator | begin () const |
const_iterator | cbegin () const |
iterator | end () |
const_iterator | end () const |
const_iterator | cend () const |
core::string< uchar8_t > | toUTF8_s (const bool addBOM=false) const |
core::array< uchar8_t > | toUTF8 (const bool addBOM=false) const |
core::array< uchar16_t > | toUTF16 (const unicode::EUTF_ENDIAN endian=unicode::EUTFEE_NATIVE, const bool addBOM=false) const |
core::array< uchar32_t > | toUTF32 (const unicode::EUTF_ENDIAN endian=unicode::EUTFEE_NATIVE, const bool addBOM=false) const |
core::string< wchar_t > | toWCHAR_s (const unicode::EUTF_ENDIAN endian=unicode::EUTFEE_NATIVE, const bool addBOM=false) const |
Converts the string to a wchar_t encoded string. More... | |
core::array< wchar_t > | toWCHAR (const unicode::EUTF_ENDIAN endian=unicode::EUTFEE_NATIVE, const bool addBOM=false) const |
Converts the string to a wchar_t encoded string array. More... | |
io::path | toPATH_s (const unicode::EUTF_ENDIAN endian=unicode::EUTFEE_NATIVE, const bool addBOM=false) const |
ustring16< TAlloc > & | loadDataStream (const char *data, size_t data_size) |
const unicode::EUTF_ENCODE | getEncoding () const |
const unicode::EUTF_ENDIAN | getEndianness () const |
Static Public Attributes | |
static const size_t | npos = -1 |
UTF-16 string class.
Definition at line 236 of file irrUString.h.
typedef ustring16<TAlloc>::_ustring16_iterator_access irr::core::ustring16< TAlloc >::access |
Definition at line 435 of file irrUString.h.
typedef ustring16<TAlloc>::_ustring16_const_iterator irr::core::ustring16< TAlloc >::const_iterator |
Definition at line 798 of file irrUString.h.
typedef ustring16<TAlloc>::_ustring16_iterator irr::core::ustring16< TAlloc >::iterator |
Definition at line 797 of file irrUString.h.
|
inline |
|
inline |
|
inline |
|
inline |
Constructor for copying a character string from a pointer.
Definition at line 888 of file irrUString.h.
|
inline |
Constructor for copying a character string from a pointer with a given length.
Definition at line 903 of file irrUString.h.
|
inline |
Constructor for copying a UTF-8 string from a pointer.
Definition at line 918 of file irrUString.h.
|
inline |
Constructor for copying a UTF-8 string from a single char.
Definition at line 932 of file irrUString.h.
|
inline |
Constructor for copying a UTF-8 string from a pointer with a given length.
Definition at line 946 of file irrUString.h.
|
inline |
Constructor for copying a UTF-16 string from a pointer.
Definition at line 960 of file irrUString.h.
|
inline |
Constructor for copying a UTF-16 string from a pointer with a given length.
Definition at line 974 of file irrUString.h.
|
inline |
Constructor for copying a UTF-32 string from a pointer.
Definition at line 988 of file irrUString.h.
|
inline |
Constructor for copying a UTF-32 from a pointer with a given length.
Definition at line 1002 of file irrUString.h.
|
inline |
Constructor for copying a wchar_t string from a pointer.
Definition at line 1016 of file irrUString.h.
|
inline |
Constructor for copying a wchar_t string from a pointer with a given length.
Definition at line 1035 of file irrUString.h.
|
inline |
|
inline |
Appends a character to this ustring16
character | The character to append. |
Definition at line 1360 of file irrUString.h.
|
inline |
Appends a UTF-8 string to this ustring16
other | The UTF-8 string to append. |
length | The length of the string to append. |
Definition at line 1391 of file irrUString.h.
|
inline |
Appends a UTF-16 string to this ustring16
other | The UTF-16 string to append. |
length | The length of the string to append. |
Definition at line 1567 of file irrUString.h.
|
inline |
Appends a UTF-32 string to this ustring16
other | The UTF-32 string to append. |
length | The length of the string to append. |
Definition at line 1632 of file irrUString.h.
|
inline |
Appends a ustring16 to this ustring16
other | The string to append to this one. |
Definition at line 1708 of file irrUString.h.
|
inline |
Appends a certain amount of characters of a ustring16 to this ustring16.
other | The string to append to this one. |
length | How many characters of the other string to add to this one. |
Definition at line 1731 of file irrUString.h.
|
inline |
Returns an iterator to the beginning of the string.
Definition at line 2741 of file irrUString.h.
|
inline |
Returns an iterator to the beginning of the string.
Definition at line 2750 of file irrUString.h.
|
inline |
Returns a pointer to the raw UTF-16 string data.
Definition at line 1314 of file irrUString.h.
|
inline |
Gets the size of the allocated memory buffer for the string.
Definition at line 2614 of file irrUString.h.
|
inline |
Returns an iterator to the beginning of the string.
Definition at line 2759 of file irrUString.h.
|
inline |
Returns an iterator to the end of the string.
Definition at line 2788 of file irrUString.h.
|
inline |
Informs if the ustring is empty or not.
Definition at line 1306 of file irrUString.h.
|
inline |
Returns an iterator to the end of the string.
Definition at line 2768 of file irrUString.h.
|
inline |
Returns an iterator to the end of the string.
Definition at line 2778 of file irrUString.h.
|
inline |
Compares the first n characters of this string with another.
other | Other string to compare to. |
n | Number of characters to compare. |
Definition at line 1324 of file irrUString.h.
|
inline |
Compares the first n characters of this string with another.
str | Other string to compare to. |
n | Number of characters to compare. |
Definition at line 1342 of file irrUString.h.
|
inline |
Erases a character from the ustring16. May be slow, because all elements following after the erased element have to be copied.
index | Index of element to be erased. |
Definition at line 2447 of file irrUString.h.
|
inline |
Removes a character from string.
pos | Position of the character to remove. |
Definition at line 2716 of file irrUString.h.
|
inline |
Finds another ustring16 in this ustring16.
str | The string to find. |
start | The start position of the search. |
Definition at line 1956 of file irrUString.h.
|
inline |
Finds another ustring16 in this ustring16.
str | The string to find. |
start | The start position of the search. |
Definition at line 1994 of file irrUString.h.
|
inline |
Finds first occurrence of character.
c | The character to search for. |
Definition at line 1773 of file irrUString.h.
|
inline |
Finds first occurrence of a character of a list.
c | A list of characters to find. For example if the method should find the first occurrence of 'a' or 'b', this parameter should be "ab". |
count | The amount of characters in the list. Usually, this should be strlen(c). |
Definition at line 1794 of file irrUString.h.
|
inline |
Finds first position of a character not in a given list.
c | A list of characters to NOT find. For example if the method should find the first occurrence of a character not 'a' or 'b', this parameter should be "ab". |
count | The amount of characters in the list. Usually, this should be strlen(c). |
Definition at line 1820 of file irrUString.h.
|
inline |
Finds last occurrence of character.
c | The character to search for. |
start | The start position of the reverse search ( default = ustring::npos, on end ). |
Definition at line 1905 of file irrUString.h.
|
inline |
Finds last occurrence of a character in a list.
c | A list of strings to find. For example if the method should find the last occurrence of 'a' or 'b', this parameter should be "ab". |
count | The amount of characters in the list. Usually, this should be strlen(c). |
Definition at line 1929 of file irrUString.h.
|
inline |
Finds last position of a character not in a given list.
c | A list of characters to NOT find. For example if the method should find the first occurrence of a character not 'a' or 'b', this parameter should be "ab". |
count | The amount of characters in the list. Usually, this should be strlen(c). |
Definition at line 1849 of file irrUString.h.
|
inline |
Finds next occurrence of character.
c | The character to search for. |
startPos | The position in the string to start searching. |
Definition at line 1883 of file irrUString.h.
|
inline |
Gets the encoding of the Unicode string this class contains.
Definition at line 3240 of file irrUString.h.
|
inline |
Gets the endianness of the Unicode string this class contains.
Definition at line 3247 of file irrUString.h.
|
inline |
Inserts a character into the string.
c | The character to insert. |
pos | The position to insert the character. |
Definition at line 2632 of file irrUString.h.
|
inline |
Inserts a string into the string.
c | The string to insert. |
pos | The position to insert the string. |
Definition at line 2667 of file irrUString.h.
|
inline |
Inserts a character into the string.
c | The character to insert. |
pos | The position to insert the character. |
Definition at line 2697 of file irrUString.h.
|
inline |
Gets the last char of the ustring16, or 0.
Definition at line 2504 of file irrUString.h.
|
inline |
Loads an unknown stream of data. Will attempt to determine if the stream is unicode data. Useful for loading from files.
data | The data stream to load from. |
data_size | The length of the data string. |
Definition at line 3207 of file irrUString.h.
|
inline |
Inequality operator.
Definition at line 1276 of file irrUString.h.
|
inline |
Inequality operator.
Definition at line 1283 of file irrUString.h.
|
inline |
Direct access operator.
Definition at line 1218 of file irrUString.h.
|
inline |
Direct access operator.
Definition at line 1227 of file irrUString.h.
|
inline |
Appends a character to this ustring16.
c | Character to append. |
Definition at line 2064 of file irrUString.h.
|
inline |
Appends a character to this ustring16.
c | Character to append. |
Definition at line 2074 of file irrUString.h.
|
inline |
Appends a number to this ustring16.
c | Number to append. |
Definition at line 2084 of file irrUString.h.
|
inline |
Appends a number to this ustring16.
c | Number to append. |
Definition at line 2094 of file irrUString.h.
|
inline |
Appends a number to this ustring16.
c | Number to append. |
Definition at line 2126 of file irrUString.h.
|
inline |
Appends a number to this ustring16.
c | Number to append. |
Definition at line 2136 of file irrUString.h.
|
inline |
Appends a number to this ustring16.
c | Number to append. |
Definition at line 2146 of file irrUString.h.
|
inline |
Appends a char ustring16 to this ustring16.
c | Char ustring16 to append. |
Definition at line 2156 of file irrUString.h.
|
inline |
Appends a ustring16 to this ustring16.
other | ustring16 to append. |
Definition at line 2166 of file irrUString.h.
|
inline |
|
inline |
|
inline |
Assignment operator for other string types.
Definition at line 1123 of file irrUString.h.
|
inline |
Assignment operator for UTF-8 strings.
Append our string now.
Definition at line 1131 of file irrUString.h.
|
inline |
Assignment operator for UTF-16 strings.
Append our string now.
Definition at line 1149 of file irrUString.h.
|
inline |
Assignment operator for UTF-32 strings.
Append our string now.
Definition at line 1167 of file irrUString.h.
|
inline |
Assignment operator for wchar_t strings.
Note that this assumes that a correct unicode string is stored in the wchar_t string. Since wchar_t changes depending on its platform, it could either be a UTF-8, -16, or -32 string. This function assumes you are storing the correct unicode encoding inside the wchar_t string.
Definition at line 1188 of file irrUString.h.
|
inline |
Assignment operator for other strings.
Note that this assumes that a correct unicode string is stored in the string.
Definition at line 1204 of file irrUString.h.
|
inline |
|
inline |
|
inline |
Removes characters from a ustring16..
c | The character to remove. |
Definition at line 2306 of file irrUString.h.
|
inline |
Removes a ustring16 from the ustring16.
toRemove | The string to remove. |
Definition at line 2342 of file irrUString.h.
|
inline |
Removes characters from the ustring16.
characters | The characters to remove. |
Definition at line 2377 of file irrUString.h.
|
inline |
Replaces all characters of a given type with another one.
toReplace | Character to replace. |
replaceWith | Character replacing the old one. |
Definition at line 2177 of file irrUString.h.
|
inline |
Replaces all instances of a string with another one.
toReplace | The string to replace. |
replaceWith | The string replacing the old one. |
Definition at line 2195 of file irrUString.h.
|
inline |
Replaces a character in the string.
c | The new character. |
pos | The position of the character to replace. |
Definition at line 2732 of file irrUString.h.
|
inline |
Reserves some memory.
count | The amount of characters to reserve. |
Definition at line 1761 of file irrUString.h.
|
inline |
Returns the length of a ustring16 in full characters.
Definition at line 1291 of file irrUString.h.
|
inline |
Returns the raw number of UTF-16 code points in the string which includes the individual surrogates.
Definition at line 2622 of file irrUString.h.
|
inline |
Split the ustring16 into parts.
This method will split a ustring16 at certain delimiter characters into the container passed in as reference. The type of the container has to be given as template parameter. It must provide a push_back and a size method.
ret | The result container |
c | C-style ustring16 of delimiter characters |
count | Number of delimiter characters |
ignoreEmptyTokens | Flag to avoid empty substrings in the result container. If two delimiters occur without a character in between, an empty substring would be placed in the result. If this flag is set, only non-empty strings are stored. |
keepSeparators | Flag which allows to add the separator to the result ustring16. If this flag is true, the concatenation of the substrings results in the original ustring16. Otherwise, only the characters between the delimiters are returned. |
Definition at line 2548 of file irrUString.h.
|
inline |
Split the ustring16 into parts.
This method will split a ustring16 at certain delimiter characters into the container passed in as reference. The type of the container has to be given as template parameter. It must provide a push_back and a size method.
ret | The result container |
c | A unicode string of delimiter characters |
ignoreEmptyTokens | Flag to avoid empty substrings in the result container. If two delimiters occur without a character in between, an empty substring would be placed in the result. If this flag is set, only non-empty strings are stored. |
keepSeparators | Flag which allows to add the separator to the result ustring16. If this flag is true, the concatenation of the substrings results in the original ustring16. Otherwise, only the characters between the delimiters are returned. |
Definition at line 2605 of file irrUString.h.
|
inline |
Returns a substring.
begin | Start of substring. |
length | Length of substring. |
Definition at line 2027 of file irrUString.h.
|
inline |
Converts the string to a properly encoded io::path string.
endian | The desired endianness of the string. |
addBOM | If true, the proper unicode byte-order mark will be prefixed to the string. |
Definition at line 3193 of file irrUString.h.
|
inline |
Converts the string to a UTF-16 encoded string array. Unfortunately, no toUTF16_s() version exists due to limitations with Irrlicht's string class.
endian | The desired endianness of the string. |
addBOM | If true, the proper unicode byte-order mark will be prefixed to the string. |
Definition at line 2956 of file irrUString.h.
|
inline |
Converts the string to a UTF-32 encoded string array. Unfortunately, no toUTF32_s() version exists due to limitations with Irrlicht's string class.
endian | The desired endianness of the string. |
addBOM | If true, the proper unicode byte-order mark will be prefixed to the string. |
Definition at line 3053 of file irrUString.h.
|
inline |
Converts the string to a UTF-8 encoded string array.
addBOM | If true, the proper unicode byte-order mark will be prefixed to the string. |
Definition at line 2856 of file irrUString.h.
|
inline |
Converts the string to a UTF-8 encoded string.
addBOM | If true, the proper unicode byte-order mark will be prefixed to the string. |
Definition at line 2799 of file irrUString.h.
|
inline |
Converts the string to a wchar_t encoded string array.
The size of a wchar_t changes depending on the platform. This function will store a correct UTF-8, -16, or -32 encoded string depending on the size of a wchar_t.
endian | The desired endianness of the string. |
addBOM | If true, the proper unicode byte-order mark will be prefixed to the string. |
Definition at line 3148 of file irrUString.h.
|
inline |
Converts the string to a wchar_t encoded string.
The size of a wchar_t changes depending on the platform. This function will store a correct UTF-8, -16, or -32 encoded string depending on the size of a wchar_t.
endian | The desired endianness of the string. |
addBOM | If true, the proper unicode byte-order mark will be prefixed to the string. |
Definition at line 3108 of file irrUString.h.
|
inline |
Trims the ustring16. Removes the specified characters (by default, Latin-1 whitespace) from the begining and the end of the ustring16.
whitespace | The characters that are to be considered as whitespace. |
Definition at line 2427 of file irrUString.h.
|
inline |
Validate the existing ustring16, checking for valid surrogate pairs and checking for proper termination.
Definition at line 2468 of file irrUString.h.
|
static |
-------------------—/// end iterator classes /// -------------------—/// ---------------—/// static variables /// ---------------—///
Definition at line 808 of file irrUString.h.