Ultralight C++ API 1.4.0
|
#include <Ultralight/String.h>
Unicode string container with conversions for UTF-8, UTF-16, and UTF-32.
This class is used to represent strings in Ultralight. It can be created from a variety of string types and converted to a number of unicode string types.
Strings are natively stored in a null-terminated UTF-8 format. You can access the UTF-8 bytes using the utf8()
method:
Public Member Functions | |
String () | |
Create empty string. | |
String (const char *str) | |
Create from null-terminated, ASCII C-string. | |
String (const char *str, size_t len) | |
Create from raw, UTF-8 string with certain length. | |
String (const String8 &str) | |
Create from existing String8 (UTF-8). | |
String (const Char16 *str, size_t len) | |
Create from raw UTF-16 string with certain length. | |
String (const String16 &str) | |
Create from existing String16 (UTF-16) | |
String (const String32 &str) | |
Create from existing String32 (UTF-32) | |
String (const String &other) | |
Copy constructor. | |
String (String &&other) | |
Move constructor. | |
~String () | |
Destructor. | |
String & | operator= (const String &other) |
Assign string from another, copy is made. | |
String & | operator= (String &&other) |
Move assignment operator. | |
String & | operator+= (const String &other) |
Append string with another. | |
String8 & | utf8 () |
Get native UTF-8 string. | |
const String8 & | utf8 () const |
Get native UTF-8 string. | |
String16 | utf16 () const |
Convert to UTF-16 string. | |
String32 | utf32 () const |
Convert to UTF-32 string. | |
bool | empty () const |
Check if string is empty or not. | |
size_t | Hash () const |
Hash function. | |
bool | operator< (const String &other) const |
Comparison operator. | |
bool | operator== (const String &other) const |
Equality operator. | |
bool | operator!= (const String &other) const |
Inequality operator. | |
Friends | |
String | operator+ (String lhs, const String &rhs) |
Concatenation operator. | |
String | ( | ) |
Create empty string.
String | ( | const char * | str | ) |
Create from null-terminated, ASCII C-string.
String | ( | const char * | str, |
size_t | len ) |
Create from raw, UTF-8 string with certain length.
~String | ( | ) |
Destructor.
|
inline |
Check if string is empty or not.
size_t Hash | ( | ) | const |
Hash function.
bool operator!= | ( | const String & | other | ) | const |
Inequality operator.
bool operator< | ( | const String & | other | ) | const |
Comparison operator.
bool operator== | ( | const String & | other | ) | const |
Equality operator.
String16 utf16 | ( | ) | const |
Convert to UTF-16 string.
String32 utf32 | ( | ) | const |
Convert to UTF-32 string.
|
inline |
Get native UTF-8 string.
|
inline |
Get native UTF-8 string.