Minetest  5.4.0
irr::core::ustring16< TAlloc > Class Template Reference

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...
 
ustring16operator= (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_tc_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_ttoUTF8_s (const bool addBOM=false) const
 Converts the string to a UTF-8 encoded string. More...
 
core::array< uchar8_ttoUTF8 (const bool addBOM=false) const
 Converts the string to a UTF-8 encoded string array. More...
 
core::array< uchar16_ttoUTF16 (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_ttoUTF32 (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_tarray
 
unicode::EUTF_ENCODE encoding
 
u32 allocated
 
u32 used
 
TAlloc allocator
 

Detailed Description

template<typename TAlloc = irrAllocator<uchar16_t>>
class irr::core::ustring16< TAlloc >

UTF-16 string class.

Member Typedef Documentation

◆ access

template<typename TAlloc = irrAllocator<uchar16_t>>
typedef ustring16<TAlloc>::_ustring16_iterator_access irr::core::ustring16< TAlloc >::access

◆ const_iterator

template<typename TAlloc = irrAllocator<uchar16_t>>
typedef ustring16<TAlloc>::_ustring16_const_iterator irr::core::ustring16< TAlloc >::const_iterator

◆ iterator

template<typename TAlloc = irrAllocator<uchar16_t>>
typedef ustring16<TAlloc>::_ustring16_iterator irr::core::ustring16< TAlloc >::iterator

Constructor & Destructor Documentation

◆ ustring16() [1/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( )
inline

◆ ustring16() [2/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const ustring16< TAlloc > &  other)
inline

◆ ustring16() [3/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
template<class B , class A >
irr::core::ustring16< TAlloc >::ustring16 ( const string< B, A > &  other)
inline

◆ ustring16() [4/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
template<class B , class A , typename Alloc >
irr::core::ustring16< TAlloc >::ustring16 ( const std::basic_string< B, A, Alloc > &  other)
inline

◆ ustring16() [5/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
template<typename Itr >
irr::core::ustring16< TAlloc >::ustring16 ( Itr  first,
Itr  last 
)
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.

+ Here is the call graph for this function:

◆ ustring16() [6/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const char *const  c)
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().

+ Here is the call graph for this function:

◆ ustring16() [7/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const char *const  c,
u32  length 
)
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().

+ Here is the call graph for this function:

◆ ustring16() [8/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const uchar8_t *const  c)
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.

+ Here is the call graph for this function:

◆ ustring16() [9/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const char  c)
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.

+ Here is the call graph for this function:

◆ ustring16() [10/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const uchar8_t *const  c,
u32  length 
)
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.

+ Here is the call graph for this function:

◆ ustring16() [11/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const uchar16_t *const  c)
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.

+ Here is the call graph for this function:

◆ ustring16() [12/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const uchar16_t *const  c,
u32  length 
)
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.

+ Here is the call graph for this function:

◆ ustring16() [13/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const uchar32_t *const  c)
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.

+ Here is the call graph for this function:

◆ ustring16() [14/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const uchar32_t *const  c,
u32  length 
)
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.

+ Here is the call graph for this function:

◆ ustring16() [15/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const wchar_t *const  c)
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.

+ Here is the call graph for this function:

◆ ustring16() [16/16]

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::ustring16 ( const wchar_t *const  c,
u32  length 
)
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.

+ Here is the call graph for this function:

◆ ~ustring16()

template<typename TAlloc = irrAllocator<uchar16_t>>
irr::core::ustring16< TAlloc >::~ustring16 ( )
inline

Member Function Documentation

◆ append() [1/6]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::append ( const uchar16_t *const  other,
u32  length = 0xffffffff 
)
inline

◆ append() [2/6]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::append ( const uchar32_t *const  other,
u32  length = 0xffffffff 
)
inline

◆ append() [3/6]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::append ( const uchar8_t *const  other,
u32  length = 0xffffffff 
)
inline

Appends a UTF-8 string to this ustring16.

Parameters
otherThe UTF-8 string to append.
lengthThe length of the string to append.
Returns
A reference to our current string.

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().

+ Here is the call graph for this function:

◆ append() [4/6]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::append ( const ustring16< TAlloc > &  other)
inline

Appends a ustring16 to this ustring16.

Parameters
otherThe string to append to this one.
Returns
A reference to our current 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.

+ Here is the call graph for this function:

◆ append() [5/6]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::append ( const ustring16< TAlloc > &  other,
u32  length 
)
inline

Appends a certain amount of characters of a ustring16 to this ustring16.

Parameters
otherThe string to append to this one.
lengthHow many characters of the other string to add to this one.
Returns
A reference to our current string.

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.

+ Here is the call graph for this function:

◆ append() [6/6]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::append ( uchar32_t  character)
inline

Appends a character to this ustring16.

Parameters
characterThe character to append.
Returns
A reference to our current string.

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ begin() [1/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
iterator irr::core::ustring16< TAlloc >::begin ( )
inline

Returns an iterator to the beginning of the string.

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().

+ Here is the caller graph for this function:

◆ begin() [2/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
const_iterator irr::core::ustring16< TAlloc >::begin ( ) const
inline

Returns an iterator to the beginning of the string.

Returns
An iterator to the beginning of the string.

◆ c_str()

◆ capacity()

template<typename TAlloc = irrAllocator<uchar16_t>>
u32 irr::core::ustring16< TAlloc >::capacity ( ) const
inline

Gets the size of the allocated memory buffer for the string.

Returns
The size of the allocated memory buffer.

References irr::core::ustring16< TAlloc >::allocated.

◆ cbegin()

template<typename TAlloc = irrAllocator<uchar16_t>>
const_iterator irr::core::ustring16< TAlloc >::cbegin ( ) const
inline

Returns an iterator to the beginning of the string.

Returns
An iterator to the beginning of the string.

◆ cend()

template<typename TAlloc = irrAllocator<uchar16_t>>
const_iterator irr::core::ustring16< TAlloc >::cend ( ) const
inline

Returns an iterator to the end of the string.

Returns
An iterator to the end of the string.

◆ empty()

template<typename TAlloc = irrAllocator<uchar16_t>>
bool irr::core::ustring16< TAlloc >::empty ( ) const
inline

Informs if the ustring is empty or not.

Returns
True if the ustring is empty, false if not.

References irr::core::ustring16< TAlloc >::size_raw().

+ Here is the call graph for this function:

◆ end() [1/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
iterator irr::core::ustring16< TAlloc >::end ( )
inline

Returns an iterator to the end of the string.

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().

+ Here is the caller graph for this function:

◆ end() [2/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
const_iterator irr::core::ustring16< TAlloc >::end ( ) const
inline

Returns an iterator to the end of the string.

Returns
An iterator to the end of the string.

◆ equalsn() [1/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
bool irr::core::ustring16< TAlloc >::equalsn ( const uchar16_t *const  str,
u32  n 
) const
inline

Compares the first n characters of this string with another.

Parameters
strOther string to compare to.
nNumber of characters to compare.
Returns
True if the n first characters of both strings are equal.

References irr::core::ustring16< TAlloc >::array.

◆ equalsn() [2/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
bool irr::core::ustring16< TAlloc >::equalsn ( const ustring16< TAlloc > &  other,
u32  n 
) const
inline

Compares the first n characters of this string with another.

Parameters
otherOther string to compare to.
nNumber of characters to compare.
Returns
True if the n first characters of both strings are equal.

References irr::core::ustring16< TAlloc >::array, irr::core::ustring16< TAlloc >::c_str(), and irr::core::ustring16< TAlloc >::used.

+ Here is the call graph for this function:

◆ erase()

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::erase ( u32  index)
inline

Erases a character from the ustring16.

May be slow, because all elements following after the erased element have to be copied.

Parameters
indexIndex of element to be erased.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::used.

◆ erase_raw()

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::erase_raw ( u32  pos)
inline

Removes a character from string.

Parameters
posPosition of the character to remove.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::used.

Referenced by irr::core::ustring16< TAlloc >::_ustring16_iterator_access::_set().

+ Here is the caller graph for this function:

◆ find()

template<typename TAlloc = irrAllocator<uchar16_t>>
s32 irr::core::ustring16< TAlloc >::find ( const ustring16< TAlloc > &  str,
const u32  start = 0 
) const
inline

Finds another ustring16 in this ustring16.

Parameters
strThe string to find.
startThe start position of the search.
Returns
Positions where the ustring16 has been found, or -1 if not found.

References irr::core::ustring16< TAlloc >::size().

+ Here is the call graph for this function:

◆ find_raw()

template<typename TAlloc = irrAllocator<uchar16_t>>
s32 irr::core::ustring16< TAlloc >::find_raw ( const ustring16< TAlloc > &  str,
const u32  start = 0 
) const
inline

Finds another ustring16 in this ustring16.

Parameters
strThe string to find.
startThe start position of the search.
Returns
Positions where the string has been found, or -1 if not found.

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findFirst()

template<typename TAlloc = irrAllocator<uchar16_t>>
s32 irr::core::ustring16< TAlloc >::findFirst ( uchar32_t  c) const
inline

Finds first occurrence of character.

Parameters
cThe character to search for.
Returns
Position where the character has been found, or -1 if not found.

Referenced by irr::gui::CGUITTFont::draw().

+ Here is the caller graph for this function:

◆ findFirstChar()

template<typename TAlloc = irrAllocator<uchar16_t>>
s32 irr::core::ustring16< TAlloc >::findFirstChar ( const uchar32_t *const  c,
u32  count = 1 
) const
inline

Finds first occurrence of a character of a list.

Parameters
cA list of characters to find. For example if the method should find the first occurrence of 'a' or 'b', this parameter should be "ab".
countThe amount of characters in the list. Usually, this should be strlen(c).
Returns
Position where one of the characters has been found, or -1 if not found.

◆ findFirstCharNotInList()

template<typename TAlloc = irrAllocator<uchar16_t>>
s32 irr::core::ustring16< TAlloc >::findFirstCharNotInList ( const uchar32_t *const  c,
u32  count = 1 
) const
inline

Finds first position of a character not in a given list.

Parameters
cA 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".
countThe amount of characters in the list. Usually, this should be strlen(c).
Returns
Position where the character has been found, or -1 if not found.

Referenced by irr::core::ustring16< TAlloc >::trim().

+ Here is the caller graph for this function:

◆ findLast()

template<typename TAlloc = irrAllocator<uchar16_t>>
s32 irr::core::ustring16< TAlloc >::findLast ( uchar32_t  c,
s32  start = -1 
) const
inline

Finds last occurrence of character.

Parameters
cThe character to search for.
startThe start position of the reverse search ( default = -1, on end ).
Returns
Position where the character has been found, or -1 if not found.

References irr::core::ustring16< TAlloc >::size().

+ Here is the call graph for this function:

◆ findLastChar()

template<typename TAlloc = irrAllocator<uchar16_t>>
s32 irr::core::ustring16< TAlloc >::findLastChar ( const uchar32_t *const  c,
u32  count = 1 
) const
inline

Finds last occurrence of a character in a list.

Parameters
cA list of strings to find. For example if the method should find the last occurrence of 'a' or 'b', this parameter should be "ab".
countThe amount of characters in the list. Usually, this should be strlen(c).
Returns
Position where one of the characters has been found, or -1 if not found.

References irr::core::ustring16< TAlloc >::end(), and irr::core::ustring16< TAlloc >::size().

+ Here is the call graph for this function:

◆ findLastCharNotInList()

template<typename TAlloc = irrAllocator<uchar16_t>>
s32 irr::core::ustring16< TAlloc >::findLastCharNotInList ( const uchar32_t *const  c,
u32  count = 1 
) const
inline

Finds last position of a character not in a given list.

Parameters
cA 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".
countThe amount of characters in the list. Usually, this should be strlen(c).
Returns
Position where the character has been found, or -1 if not found.

References irr::core::ustring16< TAlloc >::end(), and irr::core::ustring16< TAlloc >::size().

Referenced by irr::core::ustring16< TAlloc >::trim().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findNext()

template<typename TAlloc = irrAllocator<uchar16_t>>
s32 irr::core::ustring16< TAlloc >::findNext ( uchar32_t  c,
u32  startPos 
) const
inline

Finds next occurrence of character.

Parameters
cThe character to search for.
startPosThe position in the string to start searching.
Returns
Position where the character has been found, or -1 if not found.

◆ getEncoding()

template<typename TAlloc = irrAllocator<uchar16_t>>
const unicode::EUTF_ENCODE irr::core::ustring16< TAlloc >::getEncoding ( ) const
inline

Gets the encoding of the Unicode string this class contains.

Returns
An enum describing the current encoding of this string.

References irr::core::ustring16< TAlloc >::encoding.

◆ getEndianness()

template<typename TAlloc = irrAllocator<uchar16_t>>
const unicode::EUTF_ENDIAN irr::core::ustring16< TAlloc >::getEndianness ( ) const
inline

Gets the endianness of the Unicode string this class contains.

Returns
An enum describing the endianness of this string.

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().

+ Here is the caller graph for this function:

◆ insert() [1/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::insert ( const ustring16< TAlloc > &  c,
u32  pos 
)
inline

Inserts a string into the string.

Parameters
cThe string to insert.
posThe position to insert the string.
Returns
A reference to our current 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.

+ Here is the call graph for this function:

◆ insert() [2/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::insert ( uchar32_t  c,
u32  pos 
)
inline

Inserts a character into the string.

Parameters
cThe character to insert.
posThe position to insert the character.
Returns
A reference to our current string.

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.

+ Here is the call graph for this function:

◆ insert_raw()

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::insert_raw ( uchar16_t  c,
u32  pos 
)
inline

Inserts a character into the string.

Parameters
cThe character to insert.
posThe position to insert the character.
Returns
A reference to our current string.

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lastChar()

template<typename TAlloc = irrAllocator<uchar16_t>>
uchar32_t irr::core::ustring16< TAlloc >::lastChar ( ) const
inline

Gets the last char of the ustring16, or 0.

Returns
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.

+ Here is the call graph for this function:

◆ loadDataStream()

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::loadDataStream ( const char *  data,
size_t  data_size 
)
inline

Loads an unknown stream of data.

Will attempt to determine if the stream is unicode data. Useful for loading from files.

Parameters
dataThe data stream to load from.
data_sizeThe length of the data string.
Returns
A reference to our current 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator!=() [1/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
bool irr::core::ustring16< TAlloc >::operator!= ( const uchar16_t *const  str) const
inline

Inequality operator.

◆ operator!=() [2/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
bool irr::core::ustring16< TAlloc >::operator!= ( const ustring16< TAlloc > &  other) const
inline

Inequality operator.

◆ operator+=() [1/9]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator+= ( char  c)
inline

Appends a character to this ustring16.

Parameters
cCharacter to append.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::append().

+ Here is the call graph for this function:

◆ operator+=() [2/9]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator+= ( const uchar16_t *const  c)
inline

Appends a char ustring16 to this ustring16.

Parameters
cChar ustring16 to append.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::append().

+ Here is the call graph for this function:

◆ operator+=() [3/9]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator+= ( const ustring16< TAlloc > &  other)
inline

Appends a ustring16 to this ustring16.

Parameters
otherustring16 to append.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::append().

+ Here is the call graph for this function:

◆ operator+=() [4/9]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator+= ( double  c)
inline

Appends a number to this ustring16.

Parameters
cNumber to append.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::append().

+ Here is the call graph for this function:

◆ operator+=() [5/9]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator+= ( long  c)
inline

Appends a number to this ustring16.

Parameters
cNumber to append.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::append().

+ Here is the call graph for this function:

◆ operator+=() [6/9]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator+= ( short  c)
inline

Appends a number to this ustring16.

Parameters
cNumber to append.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::append().

+ Here is the call graph for this function:

◆ operator+=() [7/9]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator+= ( uchar32_t  c)
inline

Appends a character to this ustring16.

Parameters
cCharacter to append.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::append().

+ Here is the call graph for this function:

◆ operator+=() [8/9]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator+= ( unsigned long  c)
inline

Appends a number to this ustring16.

Parameters
cNumber to append.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::append().

+ Here is the call graph for this function:

◆ operator+=() [9/9]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator+= ( unsigned short  c)
inline

Appends a number to this ustring16.

Parameters
cNumber to append.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::append().

+ Here is the call graph for this function:

◆ operator<()

template<typename TAlloc = irrAllocator<uchar16_t>>
bool irr::core::ustring16< TAlloc >::operator< ( const ustring16< TAlloc > &  other) const
inline

◆ operator=() [1/7]

template<typename TAlloc = irrAllocator<uchar16_t>>
template<class B >
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator= ( const B *const  c)
inline

Assignment operator for other strings.

Note that this assumes that a correct unicode string is stored in the string.

◆ operator=() [2/7]

template<typename TAlloc = irrAllocator<uchar16_t>>
template<class B , class A >
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator= ( const string< B, A > &  other)
inline

Assignment operator for other string types.

References irr::core::ustring16< TAlloc >::c_str().

+ Here is the call graph for this function:

◆ operator=() [3/7]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator= ( const uchar16_t *const  c)
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.

+ Here is the call graph for this function:

◆ operator=() [4/7]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator= ( const uchar32_t *const  c)
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.

+ Here is the call graph for this function:

◆ operator=() [5/7]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator= ( const uchar8_t *const  c)
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.

+ Here is the call graph for this function:

◆ operator=() [6/7]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16& irr::core::ustring16< TAlloc >::operator= ( const ustring16< TAlloc > &  other)
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().

+ Here is the call graph for this function:

◆ operator=() [7/7]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::operator= ( const wchar_t *const  c)
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.

◆ operator==() [1/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
bool irr::core::ustring16< TAlloc >::operator== ( const uchar16_t *const  str) const
inline

Equality operator.

References irr::core::ustring16< TAlloc >::array.

◆ operator==() [2/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
bool irr::core::ustring16< TAlloc >::operator== ( const ustring16< TAlloc > &  other) const
inline

◆ operator[]() [1/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
access irr::core::ustring16< TAlloc >::operator[] ( const u32  index)
inline

Direct access operator.

References irr::core::ustring16< TAlloc >::size().

+ Here is the call graph for this function:

◆ operator[]() [2/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
const access irr::core::ustring16< TAlloc >::operator[] ( const u32  index) const
inline

Direct access operator.

References irr::core::ustring16< TAlloc >::size().

+ Here is the call graph for this function:

◆ reallocate()

template<typename TAlloc = irrAllocator<uchar16_t>>
void irr::core::ustring16< TAlloc >::reallocate ( u32  new_size)
inlineprivate

Reallocate the string, making it bigger or smaller.

Parameters
new_sizeThe 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().

+ Here is the caller graph for this function:

◆ remove() [1/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::remove ( const ustring16< TAlloc > &  toRemove)
inline

Removes a ustring16 from the ustring16.

Parameters
toRemoveThe string to remove.
Returns
A reference to our current string.

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.

+ Here is the call graph for this function:

◆ remove() [2/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::remove ( uchar32_t  c)
inline

Removes characters from a ustring16.

Parameters
cThe character to remove.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::array, irr::core::unicode::toUTF32(), irr::core::ustring16< TAlloc >::used, and UTF16_IS_SURROGATE_HI.

+ Here is the call graph for this function:

◆ removeChars()

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::removeChars ( const ustring16< TAlloc > &  characters)
inline

Removes characters from the ustring16.

Parameters
charactersThe characters to remove.
Returns
A reference to our current string.

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.

+ Here is the call graph for this function:

◆ replace() [1/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::replace ( const ustring16< TAlloc > &  toReplace,
const ustring16< TAlloc > &  replaceWith 
)
inline

Replaces all instances of a string with another one.

Parameters
toReplaceThe string to replace.
replaceWithThe string replacing the old one.
Returns
A reference to our current string.

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.

+ Here is the call graph for this function:

◆ replace() [2/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::replace ( uchar32_t  toReplace,
uchar32_t  replaceWith 
)
inline

Replaces all characters of a given type with another one.

Parameters
toReplaceCharacter to replace.
replaceWithCharacter replacing the old one.
Returns
A reference to our current string.

Referenced by irr::core::ustring16< TAlloc >::replace().

+ Here is the caller graph for this function:

◆ replace_raw()

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::replace_raw ( uchar16_t  c,
u32  pos 
)
inline

Replaces a character in the string.

Parameters
cThe new character.
posThe position of the character to replace.
Returns
A reference to our current string.

References irr::core::ustring16< TAlloc >::array.

Referenced by irr::core::ustring16< TAlloc >::_ustring16_iterator_access::_set().

+ Here is the caller graph for this function:

◆ reserve()

template<typename TAlloc = irrAllocator<uchar16_t>>
void irr::core::ustring16< TAlloc >::reserve ( u32  count)
inline

Reserves some memory.

Parameters
countThe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

template<typename TAlloc = irrAllocator<uchar16_t>>
u32 irr::core::ustring16< TAlloc >::size ( ) const
inline

◆ size_raw()

◆ split() [1/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
template<class container >
u32 irr::core::ustring16< TAlloc >::split ( container &  ret,
const uchar32_t *const  c,
u32  count = 1,
bool  ignoreEmptyTokens = true,
bool  keepSeparators = false 
) const
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.

Parameters
retThe result container
cC-style ustring16 of delimiter characters
countNumber of delimiter characters
ignoreEmptyTokensFlag 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.
keepSeparatorsFlag 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.
Returns
The number of resulting substrings

References irr::core::ustring16< TAlloc >::array, and irr::core::ustring16< TAlloc >::size().

Referenced by irr::core::ustring16< TAlloc >::split().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ split() [2/2]

template<typename TAlloc = irrAllocator<uchar16_t>>
template<class container >
u32 irr::core::ustring16< TAlloc >::split ( container &  ret,
const ustring16< TAlloc > &  c,
bool  ignoreEmptyTokens = true,
bool  keepSeparators = false 
) const
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.

Parameters
retThe result container
cA unicode string of delimiter characters
ignoreEmptyTokensFlag 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.
keepSeparatorsFlag 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.
Returns
The number of resulting substrings

References irr::core::ustring16< TAlloc >::split(), and irr::core::ustring16< TAlloc >::toUTF32().

+ Here is the call graph for this function:

◆ subString()

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc> irr::core::ustring16< TAlloc >::subString ( u32  begin,
s32  length 
) const
inline

Returns a substring.

Parameters
beginStart of substring.
lengthLength of substring.
Returns
A reference to our current string.

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toPATH_s()

template<typename TAlloc = irrAllocator<uchar16_t>>
io::path irr::core::ustring16< TAlloc >::toPATH_s ( const unicode::EUTF_ENDIAN  endian = unicode::EUTFEE_NATIVE,
const bool  addBOM = false 
) const
inline

Converts the string to a properly encoded io::path string.

Parameters
endianThe desired endianness of the string.
addBOMIf true, the proper unicode byte-order mark will be prefixed to the string.
Returns
An io::path string containing the properly encoded string.

References irr::core::ustring16< TAlloc >::toUTF8_s(), and irr::core::ustring16< TAlloc >::toWCHAR_s().

+ Here is the call graph for this function:

◆ toUTF16()

template<typename TAlloc = irrAllocator<uchar16_t>>
core::array<uchar16_t> irr::core::ustring16< TAlloc >::toUTF16 ( const unicode::EUTF_ENDIAN  endian = unicode::EUTFEE_NATIVE,
const bool  addBOM = false 
) const
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.

Parameters
endianThe desired endianness of the string.
addBOMIf true, the proper unicode byte-order mark will be prefixed to the string.
Returns
An array containing the UTF-16 encoded 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toUTF32()

template<typename TAlloc = irrAllocator<uchar16_t>>
core::array<uchar32_t> irr::core::ustring16< TAlloc >::toUTF32 ( const unicode::EUTF_ENDIAN  endian = unicode::EUTFEE_NATIVE,
const bool  addBOM = false 
) const
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.

Parameters
endianThe desired endianness of the string.
addBOMIf true, the proper unicode byte-order mark will be prefixed to the string.
Returns
An array containing the UTF-32 encoded 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toUTF8()

template<typename TAlloc = irrAllocator<uchar16_t>>
core::array<uchar8_t> irr::core::ustring16< TAlloc >::toUTF8 ( const bool  addBOM = false) const
inline

Converts the string to a UTF-8 encoded string array.

Parameters
addBOMIf true, the proper unicode byte-order mark will be prefixed to the string.
Returns
An array containing the UTF-8 encoded 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().

+ Here is the caller graph for this function:

◆ toUTF8_s()

template<typename TAlloc = irrAllocator<uchar16_t>>
core::string<uchar8_t> irr::core::ustring16< TAlloc >::toUTF8_s ( const bool  addBOM = false) const
inline

Converts the string to a UTF-8 encoded string.

Parameters
addBOMIf true, the proper unicode byte-order mark will be prefixed to the string.
Returns
A string containing the UTF-8 encoded 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().

+ Here is the caller graph for this function:

◆ toWCHAR()

template<typename TAlloc = irrAllocator<uchar16_t>>
core::array<wchar_t> irr::core::ustring16< TAlloc >::toWCHAR ( const unicode::EUTF_ENDIAN  endian = unicode::EUTFEE_NATIVE,
const bool  addBOM = false 
) const
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.

Parameters
endianThe desired endianness of the string.
addBOMIf true, the proper unicode byte-order mark will be prefixed to the string.
Returns
An array containing the wchar_t encoded 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.

+ Here is the call graph for this function:

◆ toWCHAR_s()

template<typename TAlloc = irrAllocator<uchar16_t>>
core::string<wchar_t> irr::core::ustring16< TAlloc >::toWCHAR_s ( const unicode::EUTF_ENDIAN  endian = unicode::EUTFEE_NATIVE,
const bool  addBOM = false 
) const
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.

Parameters
endianThe desired endianness of the string.
addBOMIf true, the proper unicode byte-order mark will be prefixed to the string.
Returns
A string containing the wchar_t encoded 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trim()

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::trim ( const ustring16< TAlloc > &  whitespace = " \t\n\r")
inline

Trims the ustring16.

Removes the specified characters (by default, Latin-1 whitespace) from the begining and the end of the ustring16.

Parameters
whitespaceThe characters that are to be considered as whitespace.
Returns
A reference to our current string.

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().

+ Here is the call graph for this function:

◆ validate()

template<typename TAlloc = irrAllocator<uchar16_t>>
ustring16<TAlloc>& irr::core::ustring16< TAlloc >::validate ( )
inline

Validate the existing ustring16, checking for valid surrogate pairs and checking for proper termination.

Returns
A reference to our current string.

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=().

+ Here is the caller graph for this function:

Member Data Documentation

◆ allocated

◆ allocator

◆ array

◆ encoding

◆ used


The documentation for this class was generated from the following file: