|
Xpace
|
A string, Unicode UTF-16 and reference-counted. More...
#include <types.h>
Public Member Functions | |
| String (const utf8_t *s, size_t len=0) | |
| Construct a String from a UTF-8 array of 8-bit chars. More... | |
| String (const utf16_t *s, size_t len=0) | |
| Construct a String from a UTF-16 array of 16-bit chars. More... | |
| String (const char *s, size_t len=0) | |
| Construct a String from an array of 8-bit chars. More... | |
| String (const String8 &s) | |
| Construct a String from a String8. More... | |
| size_t | getLength () const |
| utf8_t * | toUtf8 (utf8_t *buf, size_t bufLen) const |
| convert a String into a (null-terminated) UTF-8 string, writing it into a buffer More... | |
| std::vector< utf8_t > | toUtf8 () const |
| convert a String into a (null-terminated) UTF-8 string, writing it into a vector More... | |
| const utf16_t * | toUtf16 () const |
| String (const QString &s) | |
| Convert a QString to a String. More... | |
| operator const QString () const | |
| Convert a (const) String into a (const) QString. More... | |
| operator QString () | |
| Convert a String into a QString. More... | |
| String (const std::string &s) | |
| Convert a std::string to a String param s the std::string. More... | |
| String (const std::wstring &s) | |
| Convert a std::string to a String param s the std::string. More... | |
| std::string | toStdString () const |
| Convert a String into a std::string return the std::string. More... | |
| std::wstring | toStdWString () const |
| Convert a String into a std::string return the std::string. More... | |
| String () | |
| Construct an empty string. More... | |
| String (const String &) | |
| String & | operator= (const String &) |
| ~String () | |
| void | clear () |
| Make a string empty. More... | |
| int64 | getInt (bool *ok=0) const |
| Get a number from a (base-10) string. More... | |
| bool | operator! () const |
| bool | operator== (const String &rhs) const |
| bool | operator!= (const String &rhs) const |
| bool | operator< (const String &rhs) const |
| bool | matchNoCase (const String &rhs) const |
| String & | operator+= (utf16_t rhs) |
| concatenate rhs to this string More... | |
| String & | operator+= (const String &rhs) |
| concatenate rhs to this string More... | |
Static Public Member Functions | |
| static String | setNum (int64 n) |
| Make a string from a number. More... | |
Friends | |
| class | access |
| Xpace::String::String | ( | const utf8_t * | s, |
| size_t | len = 0 |
||
| ) |
Construct a String from a UTF-8 array of 8-bit chars.
| s | the array of chars |
| len | if != 0, the length of the array; if 0, array is 0-terminated |
| Xpace::String::String | ( | const utf16_t * | s, |
| size_t | len = 0 |
||
| ) |
Construct a String from a UTF-16 array of 16-bit chars.
| s | the array of chars |
| len | if != 0, the length of the array; if 0, array is 0-terminated |
| Xpace::String::String | ( | const char * | s, |
| size_t | len = 0 |
||
| ) |
Construct a String from an array of 8-bit chars.
| s | the array of chars |
| len | if != 0, the length of the array; if 0, array is 0-terminated |
| Xpace::String::String | ( | const String8 & | s | ) |
Construct a String from a String8.
| s | the String8 |
| Xpace::String::String | ( | const QString & | s | ) |
Convert a QString to a String.
| s | the source QString |
| Xpace::String::String | ( | const std::string & | s | ) |
Convert a std::string to a String param s the std::string.
| Xpace::String::String | ( | const std::wstring & | s | ) |
Convert a std::string to a String param s the std::string.
| Xpace::String::String | ( | ) |
Construct an empty string.
| Xpace::String::String | ( | const String & | ) |
| Xpace::String::~String | ( | ) |
| size_t Xpace::String::getLength | ( | ) | const |
Referenced by Xpace::DecimalFloat::DecimalFloat().
convert a String into a (null-terminated) UTF-8 string, writing it into a buffer
| buf | the buffer into which to write |
| bufLen | the lemgth of the buffer |
Referenced by Xpace::MatchString< STR >::MatchString().
| std::vector<utf8_t> Xpace::String::toUtf8 | ( | ) | const |
convert a String into a (null-terminated) UTF-8 string, writing it into a vector
| const utf16_t* Xpace::String::toUtf16 | ( | ) | const |
Referenced by Xpace::DecimalFloat::DecimalFloat(), and Xpace::MatchString< STR >::MatchString().
| Xpace::String::operator const QString | ( | ) | const |
Convert a (const) String into a (const) QString.
| Xpace::String::operator QString | ( | ) |
Convert a String into a QString.
| std::string Xpace::String::toStdString | ( | ) | const |
Convert a String into a std::string return the std::string.
| std::wstring Xpace::String::toStdWString | ( | ) | const |
Convert a String into a std::string return the std::string.
| void Xpace::String::clear | ( | ) |
Make a string empty.
Make a string from a number.
| n | the source number |
Referenced by Xpace::IndexList::CantOpenIndex::CantOpenIndex().
Get a number from a (base-10) string.
| fillin | true if the string could be converted, false if not |
|
inline |
concatenate rhs to this string
| rhs | the char to concatenate |
concatenate rhs to this string
| rhs | the string to concatenate |