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 |
---------------—/// iterator classes /// ---------------—/// 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 () | |
-------------------—/// end iterator classes /// -------------------—/// 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... | |
template<class B , class A , typename Alloc > | |
ustring16 (const std::basic_string< B, A, Alloc > &other) | |
Constructor from std::string. More... | |
template<typename Itr > | |
ustring16 (Itr first, Itr last) | |
Constructor from iterator. More... | |
ustring16 (const char *const c) | |
Constructor for copying a character string from a pointer. More... | |
ustring16 (const char *const c, u32 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, u32 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, u32 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, u32 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, u32 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 u32 index) |
Direct access operator. More... | |
const access | operator[] (const u32 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... | |
u32 | size () const |
Returns the length of a ustring16 in full characters. More... | |
bool | empty () const |
Informs if the ustring is empty or not. More... | |
const uchar16_t * | c_str () const |
Returns a pointer to the raw UTF-16 string data. More... | |
bool | equalsn (const ustring16< TAlloc > &other, u32 n) const |
Compares the first n characters of this string with another. More... | |
bool | equalsn (const uchar16_t *const str, u32 n) const |
Compares the first n characters of this string with another. More... | |
ustring16< TAlloc > & | append (uchar32_t character) |
Appends a character to this ustring16. More... | |
ustring16< TAlloc > & | append (const uchar8_t *const other, u32 length=0xffffffff) |
Appends a UTF-8 string to this ustring16. More... | |
ustring16< TAlloc > & | append (const uchar16_t *const other, u32 length=0xffffffff) |
Appends a UTF-16 string to this ustring16. More... | |
ustring16< TAlloc > & | append (const uchar32_t *const other, u32 length=0xffffffff) |
Appends a UTF-32 string to this ustring16. More... | |
ustring16< TAlloc > & | append (const ustring16< TAlloc > &other) |
Appends a ustring16 to this ustring16. More... | |
ustring16< TAlloc > & | append (const ustring16< TAlloc > &other, u32 length) |
Appends a certain amount of characters of a ustring16 to this ustring16. More... | |
void | reserve (u32 count) |
Reserves some memory. More... | |
s32 | findFirst (uchar32_t c) const |
Finds first occurrence of character. More... | |
s32 | findFirstChar (const uchar32_t *const c, u32 count=1) const |
Finds first occurrence of a character of a list. More... | |
s32 | findFirstCharNotInList (const uchar32_t *const c, u32 count=1) const |
Finds first position of a character not in a given list. More... | |
s32 | findLastCharNotInList (const uchar32_t *const c, u32 count=1) const |
Finds last position of a character not in a given list. More... | |
s32 | findNext (uchar32_t c, u32 startPos) const |
Finds next occurrence of character. More... | |
s32 | findLast (uchar32_t c, s32 start=-1) const |
Finds last occurrence of character. More... | |
s32 | findLastChar (const uchar32_t *const c, u32 count=1) const |
Finds last occurrence of a character in a list. More... | |
s32 | find (const ustring16< TAlloc > &str, const u32 start=0) const |
Finds another ustring16 in this ustring16. More... | |
s32 | find_raw (const ustring16< TAlloc > &str, const u32 start=0) const |
Finds another ustring16 in this ustring16. More... | |
ustring16< TAlloc > | subString (u32 begin, s32 length) const |
Returns a substring. More... | |
ustring16< TAlloc > & | operator+= (char c) |
Appends a character to this ustring16. More... | |
ustring16< TAlloc > & | operator+= (uchar32_t c) |
Appends a character to this ustring16. More... | |
ustring16< TAlloc > & | operator+= (short c) |
Appends a number to this ustring16. More... | |
ustring16< TAlloc > & | operator+= (unsigned short c) |
Appends a number to this ustring16. More... | |
ustring16< TAlloc > & | operator+= (long c) |
Appends a number to this ustring16. More... | |
ustring16< TAlloc > & | operator+= (unsigned long c) |
Appends a number to this ustring16. More... | |
ustring16< TAlloc > & | operator+= (double c) |
Appends a number to this ustring16. More... | |
ustring16< TAlloc > & | operator+= (const uchar16_t *const c) |
Appends a char ustring16 to this ustring16. More... | |
ustring16< TAlloc > & | operator+= (const ustring16< TAlloc > &other) |
Appends a ustring16 to this ustring16. More... | |
ustring16< TAlloc > & | replace (uchar32_t toReplace, uchar32_t replaceWith) |
Replaces all characters of a given type with another one. More... | |
ustring16< TAlloc > & | replace (const ustring16< TAlloc > &toReplace, const ustring16< TAlloc > &replaceWith) |
Replaces all instances of a string with another one. More... | |
ustring16< TAlloc > & | remove (uchar32_t c) |
Removes characters from a ustring16. More... | |
ustring16< TAlloc > & | remove (const ustring16< TAlloc > &toRemove) |
Removes a ustring16 from the ustring16. More... | |
ustring16< TAlloc > & | removeChars (const ustring16< TAlloc > &characters) |
Removes characters from the ustring16. More... | |
ustring16< TAlloc > & | trim (const ustring16< TAlloc > &whitespace=" \t\n\r") |
Trims the ustring16. More... | |
ustring16< TAlloc > & | erase (u32 index) |
Erases a character from the ustring16. More... | |
ustring16< TAlloc > & | validate () |
Validate the existing ustring16, checking for valid surrogate pairs and checking for proper termination. More... | |
uchar32_t | lastChar () const |
Gets the last char of the ustring16, or 0. More... | |
template<class container > | |
u32 | split (container &ret, const uchar32_t *const c, u32 count=1, bool ignoreEmptyTokens=true, bool keepSeparators=false) const |
Split the ustring16 into parts. More... | |
template<class container > | |
u32 | split (container &ret, const ustring16< TAlloc > &c, bool ignoreEmptyTokens=true, bool keepSeparators=false) const |
Split the ustring16 into parts. More... | |
u32 | capacity () const |
Gets the size of the allocated memory buffer for the string. More... | |
u32 | size_raw () const |
Returns the raw number of UTF-16 code points in the string which includes the individual surrogates. More... | |
ustring16< TAlloc > & | insert (uchar32_t c, u32 pos) |
Inserts a character into the string. More... | |
ustring16< TAlloc > & | insert (const ustring16< TAlloc > &c, u32 pos) |
Inserts a string into the string. More... | |
ustring16< TAlloc > & | insert_raw (uchar16_t c, u32 pos) |
Inserts a character into the string. More... | |
ustring16< TAlloc > & | erase_raw (u32 pos) |
Removes a character from string. More... | |
ustring16< TAlloc > & | replace_raw (uchar16_t c, u32 pos) |
Replaces a character in the string. More... | |
iterator | begin () |
Returns an iterator to the beginning of the string. More... | |
const_iterator | begin () const |
Returns an iterator to the beginning of the string. More... | |
const_iterator | cbegin () const |
Returns an iterator to the beginning of the string. More... | |
iterator | end () |
Returns an iterator to the end of the string. More... | |
const_iterator | end () const |
Returns an iterator to the end of the string. More... | |
const_iterator | cend () const |
Returns an iterator to the end of the string. More... | |
core::string< uchar8_t > | toUTF8_s (const bool addBOM=false) const |
Converts the string to a UTF-8 encoded string. More... | |
core::array< uchar8_t > | toUTF8 (const bool addBOM=false) const |
Converts the string to a UTF-8 encoded string array. More... | |
core::array< uchar16_t > | toUTF16 (const unicode::EUTF_ENDIAN endian=unicode::EUTFEE_NATIVE, const bool addBOM=false) const |
Converts the string to a UTF-16 encoded string array. More... | |
core::array< uchar32_t > | toUTF32 (const unicode::EUTF_ENDIAN endian=unicode::EUTFEE_NATIVE, const bool addBOM=false) const |
Converts the string to a UTF-32 encoded string array. More... | |
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 |
Converts the string to a properly encoded io::path string. More... | |
ustring16< TAlloc > & | loadDataStream (const char *data, size_t data_size) |
Loads an unknown stream of data. More... | |
const unicode::EUTF_ENCODE | getEncoding () const |
Gets the encoding of the Unicode string this class contains. More... | |
const unicode::EUTF_ENDIAN | getEndianness () const |
Gets the endianness of the Unicode string this class contains. More... | |
Private Member Functions | |
void | reallocate (u32 new_size) |
Reallocate the string, making it bigger or smaller. More... | |
Private Attributes | |
uchar16_t * | array |
unicode::EUTF_ENCODE | encoding |
u32 | allocated |
u32 | used |
TAlloc | allocator |
UTF-16 string class.
typedef ustring16<TAlloc>::_ustring16_iterator_access irr::core::ustring16< TAlloc >::access |
typedef ustring16<TAlloc>::_ustring16_const_iterator irr::core::ustring16< TAlloc >::const_iterator |
typedef ustring16<TAlloc>::_ustring16_iterator irr::core::ustring16< TAlloc >::iterator |
|
inline |
-------------------—/// end iterator classes /// -------------------—///
Default constructor
References irr::core::ustring16< TAlloc >::allocator, irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor.
References irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor from other string types.
References irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor from std::string.
References irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor from iterator.
References irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, irr::core::unicode::EUTFE_UTF16_LE, irr::core::ustring16< TAlloc >::reserve(), and irr::core::ustring16< TAlloc >::used.
|
inline |
Constructor for copying a character string from a pointer.
References irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, irr::core::unicode::EUTFE_UTF16_LE, and irr::core::ustring16< TAlloc >::loadDataStream().
|
inline |
Constructor for copying a character string from a pointer with a given length.
References irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, irr::core::unicode::EUTFE_UTF16_LE, and irr::core::ustring16< TAlloc >::loadDataStream().
|
inline |
Constructor for copying a UTF-8 string from a pointer.
References irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor for copying a UTF-8 string from a single char.
References irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor for copying a UTF-8 string from a pointer with a given length.
References irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor for copying a UTF-16 string from a pointer.
References irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor for copying a UTF-16 string from a pointer with a given length.
References irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor for copying a UTF-32 string from a pointer.
References irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor for copying a UTF-32 from a pointer with a given length.
References irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor for copying a wchar_t string from a pointer.
References irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Constructor for copying a wchar_t string from a pointer with a given length.
References irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_BE, and irr::core::unicode::EUTFE_UTF16_LE.
|
inline |
Destructor.
References irr::core::ustring16< TAlloc >::allocator, and irr::core::ustring16< TAlloc >::array.
|
inline |
Appends a UTF-16 string to this ustring16.
other | The UTF-16 string to append. |
length | The length of the string to append. |
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::array, irr::core::unicode::BOM_ENCODE_UTF16_BE, irr::core::unicode::BOM_ENCODE_UTF16_LE, irr::core::unicode::BOM_ENCODE_UTF16_LEN, irr::core::unicode::BOM_UTF16_LEN, irr::core::unicode::EUTFEE_BIG, irr::core::unicode::EUTFEE_LITTLE, irr::core::unicode::EUTFEE_NATIVE, irr::core::ustring16< TAlloc >::getEndianness(), p(), irr::core::ustring16< TAlloc >::reallocate(), irr::core::unicode::swapEndian16(), irr::core::ustring16< TAlloc >::used, and irr::core::ustring16< TAlloc >::validate().
|
inline |
Appends a UTF-32 string to this ustring16.
other | The UTF-32 string to append. |
length | The length of the string to append. |
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::array, irr::core::unicode::BOM_ENCODE_UTF32_BE, irr::core::unicode::BOM_ENCODE_UTF32_LE, irr::core::unicode::BOM_ENCODE_UTF32_LEN, irr::core::unicode::BOM_UTF32_LEN, irr::core::unicode::EUTFEE_BIG, irr::core::unicode::EUTFEE_LITTLE, irr::core::unicode::EUTFEE_NATIVE, irr::core::ustring16< TAlloc >::getEndianness(), p(), irr::core::ustring16< TAlloc >::reallocate(), irr::core::unicode::swapEndian32(), irr::core::ustring16< TAlloc >::used, UTF16_HI_SURROGATE, UTF16_LO_SURROGATE, irr::core::unicode::UTF_REPLACEMENT_CHARACTER, and irr::core::ustring16< TAlloc >::validate().
|
inline |
Appends a UTF-8 string to this ustring16.
other | The UTF-8 string to append. |
length | The length of the string to append. |
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::array, irr::core::unicode::BOM_ENCODE_UTF8, irr::core::unicode::BOM_ENCODE_UTF8_LEN, irr::core::unicode::BOM_UTF8_LEN, irr::core::unicode::EUTFE_NONE, irr::core::unicode::EUTFE_UTF8, p(), irr::core::ustring16< TAlloc >::reallocate(), irr::core::ustring16< TAlloc >::used, UTF16_HI_SURROGATE, UTF16_LO_SURROGATE, irr::core::unicode::UTF_REPLACEMENT_CHARACTER, and irr::core::ustring16< TAlloc >::validate().
|
inline |
Appends a ustring16 to this ustring16.
other | The string to append to this one. |
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::c_str(), irr::core::ustring16< TAlloc >::reallocate(), irr::core::ustring16< TAlloc >::size_raw(), and irr::core::ustring16< TAlloc >::used.
|
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. |
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::reallocate(), irr::core::ustring16< TAlloc >::size(), and irr::core::ustring16< TAlloc >::used.
|
inline |
Appends a character to this ustring16.
character | The character to append. |
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::reallocate(), irr::core::ustring16< TAlloc >::used, UTF16_HI_SURROGATE, and UTF16_LO_SURROGATE.
Referenced by irr::core::ustring16< TAlloc >::ustring16(), irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::loadDataStream(), irr::core::ustring16< TAlloc >::operator+=(), irr::core::ustring16< TAlloc >::operator=(), and irr::core::ustring16< TAlloc >::subString().
|
inline |
Returns an iterator to the beginning of the string.
Referenced by irr::gui::CGUITTFont::getCharacterFromPos(), irr::gui::CGUITTFont::getDimension(), irr::core::unicode::hash::operator()(), irr::core::ustring16< TAlloc >::subString(), and irr::core::ustring16< TAlloc >::trim().
|
inline |
Returns an iterator to the beginning of the string.
|
inline |
Returns a pointer to the raw UTF-16 string data.
References irr::core::ustring16< TAlloc >::array.
Referenced by irr::core::ustring16< TAlloc >::_ustring16_const_iterator::_ustring16_const_iterator(), irr::core::ustring16< TAlloc >::_ustring16_iterator_access::_get(), irr::core::ustring16< TAlloc >::_ustring16_iterator_access::_set(), irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::_ustring16_const_iterator::atEnd(), irr::core::ustring16< TAlloc >::equalsn(), irr::core::ustring16< TAlloc >::find_raw(), irr::core::ustring16< TAlloc >::insert(), irr::core::ustring16< TAlloc >::_ustring16_const_iterator::operator*(), irr::core::ustring16< TAlloc >::_ustring16_iterator::operator*(), irr::core::ustring16< TAlloc >::_ustring16_const_iterator::operator++(), irr::core::ustring16< TAlloc >::_ustring16_const_iterator::operator+=(), irr::core::ustring16< TAlloc >::_ustring16_const_iterator::operator--(), irr::core::ustring16< TAlloc >::_ustring16_const_iterator::operator-=(), irr::core::ustring16< TAlloc >::operator=(), irr::core::ustring16< TAlloc >::remove(), and irr::core::ustring16< TAlloc >::replace().
|
inline |
Gets the size of the allocated memory buffer for the string.
References irr::core::ustring16< TAlloc >::allocated.
|
inline |
Returns an iterator to the beginning of the string.
|
inline |
Returns an iterator to the end of the string.
|
inline |
Informs if the ustring is empty or not.
References irr::core::ustring16< TAlloc >::size_raw().
|
inline |
Returns an iterator to the end of the string.
Referenced by irr::core::ustring16< TAlloc >::findLastChar(), irr::core::ustring16< TAlloc >::findLastCharNotInList(), irr::core::unicode::hash::operator()(), irr::core::ustring16< TAlloc >::replace(), and irr::core::ustring16< TAlloc >::trim().
|
inline |
Returns an iterator to the end of the string.
|
inline |
Compares the first n characters of this string with another.
str | Other string to compare to. |
n | Number of characters to compare. |
References irr::core::ustring16< TAlloc >::array.
|
inline |
Compares the first n characters of this string with another.
other | Other string to compare to. |
n | Number of characters to compare. |
References irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::c_str(), and irr::core::ustring16< TAlloc >::used.
|
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. |
References irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::used.
|
inline |
Removes a character from string.
pos | Position of the character to remove. |
References irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::used.
Referenced by irr::core::ustring16< TAlloc >::_ustring16_iterator_access::_set().
|
inline |
Finds another ustring16 in this ustring16.
str | The string to find. |
start | The start position of the search. |
References irr::core::ustring16< TAlloc >::size().
|
inline |
Finds another ustring16 in this ustring16.
str | The string to find. |
start | The start position of the search. |
References irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::c_str(), and irr::core::ustring16< TAlloc >::used.
Referenced by irr::core::ustring16< TAlloc >::replace().
|
inline |
Finds first occurrence of character.
c | The character to search for. |
Referenced by irr::gui::CGUITTFont::draw().
|
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). |
|
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). |
Referenced by irr::core::ustring16< TAlloc >::trim().
|
inline |
Finds last occurrence of character.
c | The character to search for. |
start | The start position of the reverse search ( default = -1, on end ). |
References irr::core::ustring16< TAlloc >::size().
|
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). |
References irr::core::ustring16< TAlloc >::end(), and irr::core::ustring16< TAlloc >::size().
|
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). |
References irr::core::ustring16< TAlloc >::end(), and irr::core::ustring16< TAlloc >::size().
Referenced by irr::core::ustring16< TAlloc >::trim().
|
inline |
Finds next occurrence of character.
c | The character to search for. |
startPos | The position in the string to start searching. |
|
inline |
Gets the encoding of the Unicode string this class contains.
References irr::core::ustring16< TAlloc >::encoding.
|
inline |
Gets the endianness of the Unicode string this class contains.
References irr::core::ustring16< TAlloc >::encoding, irr::core::unicode::EUTFE_UTF16_LE, irr::core::unicode::EUTFE_UTF32_LE, irr::core::unicode::EUTFEE_BIG, and irr::core::unicode::EUTFEE_LITTLE.
Referenced by irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::toUTF16(), and irr::core::ustring16< TAlloc >::toUTF32().
|
inline |
Inserts a string into the string.
c | The string to insert. |
pos | The position to insert the string. |
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::c_str(), irr::core::ustring16< TAlloc >::reallocate(), irr::core::ustring16< TAlloc >::size_raw(), and irr::core::ustring16< TAlloc >::used.
|
inline |
Inserts a character into the string.
c | The character to insert. |
pos | The position to insert the character. |
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::reallocate(), irr::core::ustring16< TAlloc >::used, UTF16_HI_SURROGATE, and UTF16_LO_SURROGATE.
|
inline |
Inserts a character into the string.
c | The character to insert. |
pos | The position to insert the character. |
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::reallocate(), and irr::core::ustring16< TAlloc >::used.
Referenced by irr::core::ustring16< TAlloc >::_ustring16_iterator_access::_set().
|
inline |
Gets the last char of the ustring16, or 0.
References irr::core::ustring16< TAlloc >::array, irr::core::unicode::toUTF32(), irr::core::ustring16< TAlloc >::used, UTF16_IS_SURROGATE_HI, and UTF16_IS_SURROGATE_LO.
|
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. |
References irr::core::ustring16< TAlloc >::append(), irr::core::unicode::determineUnicodeBOM(), irr::core::unicode::EUTFE_UTF16, irr::core::unicode::EUTFE_UTF16_BE, irr::core::unicode::EUTFE_UTF16_LE, irr::core::unicode::EUTFE_UTF32, irr::core::unicode::EUTFE_UTF32_BE, irr::core::unicode::EUTFE_UTF32_LE, and irr::core::unicode::EUTFE_UTF8.
Referenced by irr::core::ustring16< TAlloc >::ustring16().
|
inline |
Inequality operator.
|
inline |
Inequality operator.
|
inline |
Appends a character to this ustring16.
c | Character to append. |
References irr::core::ustring16< TAlloc >::append().
|
inline |
Appends a char ustring16 to this ustring16.
c | Char ustring16 to append. |
References irr::core::ustring16< TAlloc >::append().
|
inline |
Appends a ustring16 to this ustring16.
other | ustring16 to append. |
References irr::core::ustring16< TAlloc >::append().
|
inline |
Appends a number to this ustring16.
c | Number to append. |
References irr::core::ustring16< TAlloc >::append().
|
inline |
Appends a number to this ustring16.
c | Number to append. |
References irr::core::ustring16< TAlloc >::append().
|
inline |
Appends a number to this ustring16.
c | Number to append. |
References irr::core::ustring16< TAlloc >::append().
|
inline |
Appends a character to this ustring16.
c | Character to append. |
References irr::core::ustring16< TAlloc >::append().
|
inline |
Appends a number to this ustring16.
c | Number to append. |
References irr::core::ustring16< TAlloc >::append().
|
inline |
Appends a number to this ustring16.
c | Number to append. |
References irr::core::ustring16< TAlloc >::append().
|
inline |
Is smaller comparator.
References irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::used.
|
inline |
Assignment operator for other strings.
Note that this assumes that a correct unicode string is stored in the string.
|
inline |
Assignment operator for other string types.
References irr::core::ustring16< TAlloc >::c_str().
|
inline |
Assignment operator for UTF-16 strings.
Append our string now.
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::allocator, irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::used.
|
inline |
Assignment operator for UTF-32 strings.
Append our string now.
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::allocator, irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::used.
|
inline |
Assignment operator for UTF-8 strings.
Append our string now.
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::allocator, irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::used.
|
inline |
Assignment operator.
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::allocator, irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::c_str(), p(), irr::core::ustring16< TAlloc >::size_raw(), irr::core::ustring16< TAlloc >::used, and irr::core::ustring16< TAlloc >::validate().
|
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.
|
inline |
Equality operator.
References irr::core::ustring16< TAlloc >::array.
|
inline |
Equality operator.
References irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::used.
|
inline |
Direct access operator.
References irr::core::ustring16< TAlloc >::size().
|
inline |
Direct access operator.
References irr::core::ustring16< TAlloc >::size().
|
inlineprivate |
Reallocate the string, making it bigger or smaller.
new_size | The new size of the string. |
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::allocator, irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::used.
Referenced by irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::insert(), irr::core::ustring16< TAlloc >::insert_raw(), irr::core::ustring16< TAlloc >::replace(), and irr::core::ustring16< TAlloc >::reserve().
|
inline |
Removes a ustring16 from the ustring16.
toRemove | The string to remove. |
References irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::c_str(), irr::core::ustring16< TAlloc >::size(), irr::core::ustring16< TAlloc >::size_raw(), and irr::core::ustring16< TAlloc >::used.
|
inline |
Removes characters from a ustring16.
c | The character to remove. |
References irr::core::ustring16< TAlloc >::array, irr::core::unicode::toUTF32(), irr::core::ustring16< TAlloc >::used, and UTF16_IS_SURROGATE_HI.
|
inline |
Removes characters from the ustring16.
characters | The characters to remove. |
References irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::size_raw(), irr::core::unicode::toUTF32(), irr::core::ustring16< TAlloc >::used, and UTF16_IS_SURROGATE_HI.
|
inline |
Replaces all instances of a string with another one.
toReplace | The string to replace. |
replaceWith | The string replacing the old one. |
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::c_str(), irr::core::ustring16< TAlloc >::end(), irr::core::ustring16< TAlloc >::find_raw(), irr::core::ustring16< TAlloc >::reallocate(), irr::core::ustring16< TAlloc >::replace(), irr::core::ustring16< TAlloc >::size(), irr::core::ustring16< TAlloc >::size_raw(), and irr::core::ustring16< TAlloc >::used.
|
inline |
Replaces all characters of a given type with another one.
toReplace | Character to replace. |
replaceWith | Character replacing the old one. |
Referenced by irr::core::ustring16< TAlloc >::replace().
|
inline |
Replaces a character in the string.
c | The new character. |
pos | The position of the character to replace. |
References irr::core::ustring16< TAlloc >::array.
Referenced by irr::core::ustring16< TAlloc >::_ustring16_iterator_access::_set().
|
inline |
Reserves some memory.
count | The amount of characters to reserve. |
References irr::core::ustring16< TAlloc >::allocated, and irr::core::ustring16< TAlloc >::reallocate().
Referenced by irr::core::ustring16< TAlloc >::ustring16(), and irr::core::ustring16< TAlloc >::subString().
|
inline |
Returns the length of a ustring16 in full characters.
Referenced by irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::find(), irr::core::ustring16< TAlloc >::findLast(), irr::core::ustring16< TAlloc >::findLastChar(), irr::core::ustring16< TAlloc >::findLastCharNotInList(), irr::core::ustring16< TAlloc >::operator[](), irr::core::ustring16< TAlloc >::remove(), irr::core::ustring16< TAlloc >::replace(), irr::core::ustring16< TAlloc >::split(), irr::core::ustring16< TAlloc >::subString(), and irr::core::ustring16< TAlloc >::toUTF32().
|
inline |
Returns the raw number of UTF-16 code points in the string which includes the individual surrogates.
References irr::core::ustring16< TAlloc >::used.
Referenced by irr::core::ustring16< TAlloc >::_ustring16_const_iterator::_ustring16_const_iterator(), irr::core::ustring16< TAlloc >::_ustring16_iterator_access::_get(), irr::core::ustring16< TAlloc >::_ustring16_iterator_access::_set(), irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::_ustring16_const_iterator::atEnd(), irr::core::ustring16< TAlloc >::empty(), irr::core::ustring16< TAlloc >::insert(), irr::core::unicode::hash::operator()(), irr::core::ustring16< TAlloc >::_ustring16_const_iterator::operator*(), irr::core::ustring16< TAlloc >::_ustring16_iterator::operator*(), irr::core::ustring16< TAlloc >::_ustring16_const_iterator::operator++(), irr::core::ustring16< TAlloc >::_ustring16_const_iterator::operator+=(), irr::core::ustring16< TAlloc >::operator=(), irr::core::ustring16< TAlloc >::remove(), irr::core::ustring16< TAlloc >::removeChars(), irr::core::ustring16< TAlloc >::replace(), and irr::core::ustring16< TAlloc >::_ustring16_const_iterator::toEnd().
|
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. |
References irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::size().
Referenced by irr::core::ustring16< TAlloc >::split().
|
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. |
References irr::core::ustring16< TAlloc >::split(), and irr::core::ustring16< TAlloc >::toUTF32().
|
inline |
Returns a substring.
begin | Start of substring. |
length | Length of substring. |
References irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::begin(), irr::core::ustring16< TAlloc >::reserve(), and irr::core::ustring16< TAlloc >::size().
Referenced by irr::core::ustring16< TAlloc >::trim().
|
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. |
References irr::core::ustring16< TAlloc >::toUTF8_s(), and irr::core::ustring16< TAlloc >::toWCHAR_s().
|
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. |
References irr::core::ustring16< TAlloc >::array, irr::core::unicode::BOM, irr::core::unicode::BOM_ENCODE_UTF16_BE, irr::core::unicode::BOM_ENCODE_UTF16_LE, irr::core::unicode::BOM_UTF16_LEN, irr::core::unicode::EUTFEE_LITTLE, irr::core::unicode::EUTFEE_NATIVE, irr::core::ustring16< TAlloc >::getEndianness(), irr::core::unicode::swapEndian16(), and irr::core::ustring16< TAlloc >::used.
Referenced by irr::core::ustring16< TAlloc >::toWCHAR(), and irr::core::ustring16< TAlloc >::toWCHAR_s().
|
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. |
References irr::core::unicode::BOM, irr::core::unicode::BOM_ENCODE_UTF32_BE, irr::core::unicode::BOM_ENCODE_UTF32_LE, irr::core::unicode::BOM_UTF32_LEN, irr::core::unicode::EUTFEE_LITTLE, irr::core::unicode::EUTFEE_NATIVE, irr::core::ustring16< TAlloc >::getEndianness(), irr::core::ustring16< TAlloc >::size(), and irr::core::unicode::swapEndian32().
Referenced by irr::core::ustring16< TAlloc >::split(), irr::core::ustring16< TAlloc >::toWCHAR(), irr::core::ustring16< TAlloc >::toWCHAR_s(), and irr::core::ustring16< TAlloc >::trim().
|
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. |
References irr::core::unicode::BOM_ENCODE_UTF8, irr::core::unicode::BOM_UTF8_LEN, and irr::core::ustring16< TAlloc >::used.
Referenced by irr::core::ustring16< TAlloc >::toWCHAR(), and irr::core::ustring16< TAlloc >::toWCHAR_s().
|
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. |
References irr::core::unicode::BOM_ENCODE_UTF8, irr::core::unicode::BOM_UTF8_LEN, and irr::core::ustring16< TAlloc >::used.
Referenced by irr::gui::CGUITTFont::load(), irr::core::operator<<(), and irr::core::ustring16< TAlloc >::toPATH_s().
|
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. |
References irr::core::ustring16< TAlloc >::array, irr::core::unicode::EUTFEE_NATIVE, irr::core::ustring16< TAlloc >::toUTF16(), irr::core::ustring16< TAlloc >::toUTF32(), irr::core::ustring16< TAlloc >::toUTF8(), and irr::core::ustring16< TAlloc >::used.
|
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. |
References irr::core::ustring16< TAlloc >::array, irr::core::unicode::EUTFEE_NATIVE, irr::core::ustring16< TAlloc >::toUTF16(), irr::core::ustring16< TAlloc >::toUTF32(), and irr::core::ustring16< TAlloc >::toUTF8().
Referenced by irr::core::operator<<(), and irr::core::ustring16< TAlloc >::toPATH_s().
|
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. |
References irr::core::ustring16< TAlloc >::begin(), irr::core::ustring16< TAlloc >::end(), irr::core::ustring16< TAlloc >::findFirstCharNotInList(), irr::core::ustring16< TAlloc >::findLastCharNotInList(), irr::core::ustring16< TAlloc >::subString(), and irr::core::ustring16< TAlloc >::toUTF32().
|
inline |
Validate the existing ustring16, checking for valid surrogate pairs and checking for proper termination.
References irr::core::ustring16< TAlloc >::allocated, irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::used, UTF16_IS_SURROGATE, UTF16_IS_SURROGATE_HI, UTF16_IS_SURROGATE_LO, and irr::core::unicode::UTF_REPLACEMENT_CHARACTER.
Referenced by irr::core::ustring16< TAlloc >::append(), and irr::core::ustring16< TAlloc >::operator=().
|
private |
Referenced by irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::capacity(), irr::core::ustring16< TAlloc >::insert(), irr::core::ustring16< TAlloc >::insert_raw(), irr::core::ustring16< TAlloc >::operator=(), irr::core::ustring16< TAlloc >::reallocate(), irr::core::ustring16< TAlloc >::replace(), irr::core::ustring16< TAlloc >::reserve(), and irr::core::ustring16< TAlloc >::validate().
|
private |
|
private |
Referenced by irr::core::ustring16< TAlloc >::ustring16(), irr::core::ustring16< TAlloc >::~ustring16(), irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::c_str(), irr::core::ustring16< TAlloc >::equalsn(), irr::core::ustring16< TAlloc >::erase(), irr::core::ustring16< TAlloc >::erase_raw(), irr::core::ustring16< TAlloc >::find_raw(), irr::core::ustring16< TAlloc >::insert(), irr::core::ustring16< TAlloc >::insert_raw(), irr::core::ustring16< TAlloc >::lastChar(), irr::core::ustring16< TAlloc >::operator<(), irr::core::ustring16< TAlloc >::operator=(), irr::core::ustring16< TAlloc >::operator==(), irr::core::ustring16< TAlloc >::reallocate(), irr::core::ustring16< TAlloc >::remove(), irr::core::ustring16< TAlloc >::removeChars(), irr::core::ustring16< TAlloc >::replace(), irr::core::ustring16< TAlloc >::replace_raw(), irr::core::ustring16< TAlloc >::split(), irr::core::ustring16< TAlloc >::toUTF16(), irr::core::ustring16< TAlloc >::toWCHAR(), irr::core::ustring16< TAlloc >::toWCHAR_s(), and irr::core::ustring16< TAlloc >::validate().
|
private |
|
private |
Referenced by irr::core::ustring16< TAlloc >::ustring16(), irr::core::ustring16< TAlloc >::append(), irr::core::ustring16< TAlloc >::equalsn(), irr::core::ustring16< TAlloc >::erase(), irr::core::ustring16< TAlloc >::erase_raw(), irr::core::ustring16< TAlloc >::find_raw(), irr::core::ustring16< TAlloc >::insert(), irr::core::ustring16< TAlloc >::insert_raw(), irr::core::ustring16< TAlloc >::lastChar(), irr::core::ustring16< TAlloc >::operator<(), irr::core::ustring16< TAlloc >::operator=(), irr::core::ustring16< TAlloc >::operator==(), irr::core::ustring16< TAlloc >::reallocate(), irr::core::ustring16< TAlloc >::remove(), irr::core::ustring16< TAlloc >::removeChars(), irr::core::ustring16< TAlloc >::replace(), irr::core::ustring16< TAlloc >::size_raw(), irr::core::ustring16< TAlloc >::toUTF16(), irr::core::ustring16< TAlloc >::toUTF8(), irr::core::ustring16< TAlloc >::toUTF8_s(), irr::core::ustring16< TAlloc >::toWCHAR(), and irr::core::ustring16< TAlloc >::validate().