|
Ultralight C++ API 2.0.0
|
#include <Ultralight/String16.h>
A null-terminated UTF-16 string container.
Public Types | |
| typedef Char16 | CharType |
| Native character type. | |
Public Member Functions | |
| String16 () | |
| Make an empty String16. | |
| String16 (const Char16 *str, size_t len) | |
| Make a String16 from raw UTF-16 buffer with certain length. | |
| String16 (const unsigned short *str, size_t len) | |
| Make a String16 from raw unsigned short UTF-16 buffer with certain length. | |
| String16 (const String16 &other) | |
| Make a deep copy of String16. | |
| String16 (String16 &&other) | |
| Move constructor. | |
| ~String16 () | |
| Destructor. | |
| String16 & | operator= (const String16 &other) |
| Assign a String16 to this one, deep copy is made. | |
| String16 & | operator= (String16 &&other) |
| Move assignment operator. | |
| String16 & | operator+= (const String16 &other) |
| Append a String16 to this one. | |
| Char16 * | data () |
| Get raw UTF-16 data. | |
| const Char16 * | data () const |
| Get raw UTF-16 data (const). | |
| unsigned short * | udata () |
| Get raw UTF-16 data as unsigned short. | |
| const unsigned short * | udata () const |
| Get raw UTF-16 data as unsigned short (const). | |
| size_t | length () const |
| Get length in UTF-16 code units (not including null terminator). | |
| size_t | size () const |
| Get size in UTF-16 code units (synonym for length()). | |
| size_t | sizeBytes () const |
| Get size in bytes. | |
| bool | empty () const |
| Check if string is empty. | |
| Char16 & | operator[] (size_t pos) |
| Get character at specific position. | |
| const Char16 & | operator[] (size_t pos) const |
| Get character at specific position (const). | |
| String8 | utf8 () const |
| Get a UTF-8 copy of this string. | |
| String32 | utf32 () const |
| Get a UTF-32 copy of this string. | |
| size_t | Hash () const |
| Hash function. | |
| bool | operator< (const String16 &other) const |
| Comparison operator. | |
| bool | operator== (const String16 &other) const |
| Equality operator. | |
| bool | operator!= (const String16 &other) const |
| Inequality operator. | |
Friends | |
| String16 | operator+ (String16 lhs, const String16 &rhs) |
| Concatenation operator. | |
| String16 | ( | ) |
Make an empty String16.
| String16 | ( | const Char16 * | str, |
| size_t | len ) |
Make a String16 from raw UTF-16 buffer with certain length.
| String16 | ( | const unsigned short * | str, |
| size_t | len ) |
Make a String16 from raw unsigned short UTF-16 buffer with certain length.
Useful on Windows when native support for wchar_t is disabled (eg, /Zc:wchar_t-).
| String16 | ( | const String16 & | other | ) |
Make a deep copy of String16.
| String16 | ( | String16 && | other | ) |
Move constructor.
| ~String16 | ( | ) |
Destructor.
|
inline |
Get raw UTF-16 data.
|
inline |
Get raw UTF-16 data (const).
|
inline |
Check if string is empty.
| size_t Hash | ( | ) | const |
Hash function.
|
inline |
Get length in UTF-16 code units (not including null terminator).
| bool operator!= | ( | const String16 & | other | ) | const |
Inequality operator.
| bool operator< | ( | const String16 & | other | ) | const |
Comparison operator.
| bool operator== | ( | const String16 & | other | ) | const |
Equality operator.
|
inline |
Get character at specific position.
|
inline |
Get character at specific position (const).
|
inline |
Get size in UTF-16 code units (synonym for length()).
|
inline |
Get size in bytes.
|
inline |
Get raw UTF-16 data as unsigned short.
This is useful on Windows if you compile without native support for wchar_t (eg, /Zc:wchar_t-)
|
inline |
Get raw UTF-16 data as unsigned short (const).
| String32 utf32 | ( | ) | const |
Get a UTF-32 copy of this string.
| String8 utf8 | ( | ) | const |
Get a UTF-8 copy of this string.