deCONZ C++ API v2.6.1
|
String class to replace QString (work in progress). More...
#include <ustring.h>
Public Member Functions | |
UString () | |
Constructor. | |
UString (const char *str) | |
C string constructor. | |
UString (const UString &other) | |
Copy constructor. | |
UString (UString &&other) noexcept | |
Move constructor. | |
UString & | operator= (const UString &other) |
Copy assignment operator. | |
UString & | operator= (UString &&other) noexcept |
Move assignment operator. | |
~UString () | |
Destructor. | |
bool | operator== (const UString &) const |
bool | operator!= (const UString &rhs) const |
bool | operator== (const char *) const |
bool | operator!= (const char *rhs) const |
const char * | c_str () const |
Returns the zero terminated C-String. | |
unsigned | size () const |
Returns the byte size of the string. | |
bool | empty () const |
Returns true if the string is empty. | |
Static Public Member Functions | |
static UString | number (int, int base=10) |
static UString | number (unsigned int, int base=10) |
static UString | number (long, int base=10) |
static UString | number (unsigned long, int base=10) |
static UString | number (long long, int base=10) |
static UString | number (unsigned long long, int base=10) |
static UString | number (double, char f='f', int prec=6) |
static UString | fromAtom (AT_Atom) |
Constructs a UString from an atom. | |
static UString | fromAtom (AT_AtomIndex) |
Constructs a UString from an atom index. | |
String class to replace QString (work in progress).
Beside the usual string functions, a UString can be constructed from an atom. This makes the strings very small, since only the atom index is stored, and fast for comparisons and copies.
const char * UString::c_str | ( | ) | const |
Returns the zero terminated C-String.
This is always safe to use also for empty strings.
Constructs a UString from an atom.
No dynamic heap allocations are done as only the index referencing the atom is stored.
|
static |
Constructs a UString from an atom index.
No dynamic heap allocations are done as only the index referencing the atom is stored.
unsigned UString::size | ( | ) | const |
Returns the byte size of the string.
Note for multibyte UTF-8 characters the size is larger than the codepoint count.