|
| | String ()=default |
| |
| | String (const std::basic_string< Char > &str) |
| | Copy UTF-16 string. More...
|
| |
| | String (std::basic_string< Char > &&str) |
| | Move UTF-16 string. More...
|
| |
| | String (const std::string &str) |
| | Convert from UTF-8 string. More...
|
| |
| | String (const ostream &os) |
| | Convert from UTF-8 stringstream. More...
|
| |
| | String (const char *str, szt len=npos) |
| | Convert from UTF-8 string, pointer must not be null. More...
|
| |
| | String (szt n, char c) |
| | Convert from UTF-8 char repeated n times. More...
|
| |
| template<class T > |
| String & | operator= (T &&rhs) |
| | Forwards to assign() More...
|
| |
| template<class T > |
| String & | operator+= (T &&rhs) |
| | Forwards to append() More...
|
| |
| String & | operator+= (Char rhs) |
| |
| String & | operator+= (char rhs) |
| |
| String & | clear () |
| |
| String & | insert (szt pos, const String &str, szt subpos=0, szt sublen=npos) |
| |
| String & | insert (szt pos, const std::string &str, szt subpos=0, szt sublen=npos) |
| |
| String & | insert (szt pos, const Char *str, szt subpos=0, szt sublen=npos) |
| |
| String & | insert (szt pos, const char *str, szt subpos=0, szt sublen=npos) |
| |
| String & | insert (szt pos, szt n, Char c) |
| |
| String & | insert (szt pos, szt n, char c) |
| |
| iterator | insert (const_iterator p, Char c) |
| |
| iterator | insert (const_iterator p, szt n, Char c) |
| |
| template<class InputIterator > |
| iterator | insert (const_iterator p, InputIterator first, InputIterator last) |
| |
| String & | erase (szt pos=0, szt len=npos) |
| |
| iterator | erase (const_iterator position) |
| |
| iterator | erase (const_iterator first, const_iterator last) |
| |
| String & | replace (szt pos, szt len, const String &str, szt subpos=0, szt sublen=npos) |
| |
| String & | replace (const_iterator i1, const_iterator i2, const String &str) |
| |
| template<class InputIterator > |
| String & | replace (const_iterator i1, const_iterator i2, InputIterator first, InputIterator last) |
| |
| szt | copy (Char *s, szt len, szt pos=0) const |
| |
| szt | copy (char *s, szt len, szt pos=0) const |
| |
| String | substr (szt pos=0, szt len=npos) const |
| |
| int | icompare (const String &str) const |
| | Case-insensitive compare. More...
|
| |
| int | icompare (szt pos, szt len, const String &str, szt subpos=0, szt sublen=npos) const |
| |
| List | split (const String &delim=String(1, ' '), szt pos=0, szt count=npos) const |
| | Split a string into a list of separate substrings delimited by delim. More...
|
| |
| String | toLower () const |
| | Convert string to lower case. More...
|
| |
| String | toUpper () const |
| | Convert string to upper case. More...
|
| |
| std::string | u8 () const |
| | Convert to UTF-8 string. More...
|
| |
| | operator std::string () const |
| | Same as u8() More...
|
| |
|
| String & | append (const String &str, szt subpos=0, szt sublen=npos) |
| |
| String & | append (const std::string &str, szt subpos=0, szt sublen=npos) |
| |
| String & | append (const Char *str, szt subpos=0, szt sublen=npos) |
| |
| String & | append (const char *str, szt subpos=0, szt sublen=npos) |
| |
| String & | append (szt n, Char c) |
| |
| String & | append (szt n, char c) |
| |
| template<class InputIterator > |
| String & | append (InputIterator first, InputIterator last) |
| |
|
| String & | assign (const String &str, szt subpos=0, szt sublen=npos) |
| |
| String & | assign (const std::string &str, szt subpos=0, szt sublen=npos) |
| |
| String & | assign (const Char *str, szt subpos=0, szt sublen=npos) |
| |
| String & | assign (const char *str, szt subpos=0, szt sublen=npos) |
| |
| String & | assign (szt n, Char c) |
| |
| String & | assign (szt n, char c) |
| |
| template<class InputIterator > |
| String & | assign (InputIterator first, InputIterator last) |
| |
Unicode UTF-16 string class, wrapper around std::u16string.
length() returns the number of UTF-16 code units, not code points (characters or visual symbols). Some code points are 32-bit and thus are composed of 2 code units, called a surrogate pair or high / low surrogates.
Modeling the string as an array of fixed-length UTF-16 code units rather than variable-length code points is a trade-off for efficiency, as a large range of common characters can be represented by a single code unit.