Open CASCADE Technology 7.8.0
|
This template class represent constant UTF-* string. String stored in memory continuously, always NULL-terminated and can be used as standard C-string using ToCString() method. More...
#include <NCollection_UtfString.hxx>
assign operators | |
const NCollection_UtfString & | Assign (const NCollection_UtfString &theOther) |
Copy from another string. | |
void | Swap (NCollection_UtfString &theOther) |
Exchange the data of two strings (without reallocating memory). | |
const NCollection_UtfString & | operator= (const NCollection_UtfString &theOther) |
Copy from another string. | |
NCollection_UtfString & | operator= (NCollection_UtfString &&theOther) |
Move assignment operator. | |
const NCollection_UtfString & | operator= (const char *theStringUtf8) |
Copy from UTF-8 NULL-terminated string. | |
const NCollection_UtfString & | operator= (const Standard_WideChar *theStringUtfWide) |
Copy from wchar_t UTF NULL-terminated string. | |
NCollection_UtfString & | operator+= (const NCollection_UtfString &theAppend) |
Join strings. | |
This template class represent constant UTF-* string. String stored in memory continuously, always NULL-terminated and can be used as standard C-string using ToCString() method.
Notice that changing the string is not allowed and any modifications should produce new string.
In comments to this class, terms "Unicode symbol" is used as synonym of "Unicode code point".
NCollection_UtfString< Type >::NCollection_UtfString | ( | ) |
Initialize empty string.
NCollection_UtfString< Type >::NCollection_UtfString | ( | const NCollection_UtfString< Type > & | theCopy | ) |
Copy constructor.
theCopy | string to copy. |
NCollection_UtfString< Type >::NCollection_UtfString | ( | NCollection_UtfString< Type > && | theOther | ) |
Move constructor.
NCollection_UtfString< Type >::NCollection_UtfString | ( | const char * | theCopyUtf8, |
const Standard_Integer | theLength = -1 |
||
) |
Copy constructor from UTF-8 string.
theCopyUtf8 | UTF-8 string to copy |
theLength | optional length limit in Unicode symbols (NOT bytes!) The string is copied till NULL symbol or, if theLength >0, till either NULL or theLength-th symbol (which comes first). |
NCollection_UtfString< Type >::NCollection_UtfString | ( | const Standard_Utf16Char * | theCopyUtf16, |
const Standard_Integer | theLength = -1 |
||
) |
Copy constructor from UTF-16 string.
theCopyUtf16 | UTF-16 string to copy |
theLength | the length limit in Unicode symbols (NOT bytes!) The string is copied till NULL symbol or, if theLength >0, till either NULL or theLength-th symbol (which comes first). |
NCollection_UtfString< Type >::NCollection_UtfString | ( | const Standard_Utf32Char * | theCopyUtf32, |
const Standard_Integer | theLength = -1 |
||
) |
Copy constructor from UTF-32 string.
theCopyUtf32 | UTF-32 string to copy |
theLength | the length limit in Unicode symbols (NOT bytes!) The string is copied till NULL symbol or, if theLength >0, till either NULL or theLength-th symbol (which comes first). |
NCollection_UtfString< Type >::NCollection_UtfString | ( | const Standard_WideChar * | theCopyUtfWide, |
const Standard_Integer | theLength = -1 |
||
) |
Copy constructor from wide UTF string.
theCopyUtfWide | wide UTF string to copy |
theLength | the length limit in Unicode symbols (NOT bytes!) The string is copied till NULL symbol or, if theLength >0, till either NULL or theLength-th symbol (which comes first). |
This constructor is undefined if Standard_WideChar is the same type as Standard_Utf16Char.
NCollection_UtfString< Type >::~NCollection_UtfString | ( | ) |
Destructor.
const NCollection_UtfString & NCollection_UtfString< Type >::Assign | ( | const NCollection_UtfString< Type > & | theOther | ) |
Copy from another string.
void NCollection_UtfString< Type >::Clear | ( | ) |
Zero string.
void NCollection_UtfString< Type >::FromLocale | ( | const char * | theString, |
const Standard_Integer | theLength = -1 |
||
) |
Copy from multibyte string in current system locale.
theString | multibyte string |
theLength | the length limit in Unicode symbols The string is copied till NULL symbol or, if theLength >0, till either NULL or theLength-th symbol (which comes first). |
|
inline |
Copy from Unicode string in UTF-8, UTF-16, or UTF-32 encoding, determined by size of TypeFrom character type.
theStringUtf | Unicode string |
theLength | the length limit in Unicode symbols The string is copied till NULL symbol or, if theLength >0, till either NULL or theLength-th symbol (which comes first). |
Standard_Utf32Char NCollection_UtfString< Type >::GetChar | ( | const Standard_Integer | theCharIndex | ) | const |
Retrieve Unicode symbol at specified position. Warning! This is a slow access. Iterator should be used for consecutive parsing.
theCharIndex | the index of the symbol, should be lesser than Length() |
const Type * NCollection_UtfString< Type >::GetCharBuffer | ( | const Standard_Integer | theCharIndex | ) | const |
Retrieve string buffer at specified position. Warning! This is a slow access. Iterator should be used for consecutive parsing.
theCharIndex | the index of the symbol, should be less than Length() (first symbol of the string has index 0) |
|
inline |
bool NCollection_UtfString< Type >::IsEqual | ( | const NCollection_UtfString< Type > & | theCompare | ) | const |
Compares this string with another one.
|
inline |
|
inline |
bool NCollection_UtfString< Type >::operator!= | ( | const NCollection_UtfString< Type > & | theCompare | ) | const |
NCollection_UtfString & NCollection_UtfString< Type >::operator+= | ( | const NCollection_UtfString< Type > & | theAppend | ) |
Join strings.
const NCollection_UtfString & NCollection_UtfString< Type >::operator= | ( | const char * | theStringUtf8 | ) |
Copy from UTF-8 NULL-terminated string.
|
inline |
Copy from another string.
const NCollection_UtfString & NCollection_UtfString< Type >::operator= | ( | const Standard_WideChar * | theStringUtfWide | ) |
Copy from wchar_t UTF NULL-terminated string.
|
inline |
Move assignment operator.
|
inline |
|
inline |
Retrieve Unicode symbol at specified position. Warning! This is a slow access. Iterator should be used for consecutive parsing.
|
inline |
NCollection_UtfString NCollection_UtfString< Type >::SubString | ( | const Standard_Integer | theStart, |
const Standard_Integer | theEnd | ||
) | const |
Returns the substring.
theStart | start index (inclusive) of subString |
theEnd | end index (exclusive) of subString |
void NCollection_UtfString< Type >::Swap | ( | NCollection_UtfString< Type > & | theOther | ) |
Exchange the data of two strings (without reallocating memory).
|
inline |
Returns NULL-terminated Unicode string. Should not be modified or deleted!
bool NCollection_UtfString< Type >::ToLocale | ( | char * | theBuffer, |
const Standard_Integer | theSizeBytes | ||
) | const |
Converts the string into string in the current system locale.
theBuffer | output buffer |
theSizeBytes | buffer size in bytes |
const NCollection_UtfString< Standard_Utf16Char > NCollection_UtfString< Type >::ToUtf16 | ( | ) | const |
const NCollection_UtfString< Standard_Utf32Char > NCollection_UtfString< Type >::ToUtf32 | ( | ) | const |
const NCollection_UtfString< Standard_Utf8Char > NCollection_UtfString< Type >::ToUtf8 | ( | ) | const |
const NCollection_UtfString< Standard_WideChar > NCollection_UtfString< Type >::ToUtfWide | ( | ) | const |