![]() |
LLGL 0.05 Beta
|
Container class for UTF-8 encoded strings. More...
#include <UTF8String.h>
Public Types | |
| using | value_type = char |
| using | size_type = std::size_t |
| using | difference_type = std::ptrdiff_t |
| using | reference = value_type& |
| using | const_reference = const value_type& |
| using | pointer = value_type* |
| using | const_pointer = const value_type* |
| using | iterator = value_type* |
| using | const_iterator = const value_type* |
| using | reverse_iterator = std::reverse_iterator<iterator> |
| using | const_reverse_iterator = std::reverse_iterator<const_iterator> |
Public Member Functions | |
| UTF8String () | |
| Initialize an empty string. | |
| UTF8String (const UTF8String &rhs) | |
| Initializes the UTF-8 string with a copy of the specified string. | |
| UTF8String (UTF8String &&rhs) | |
| Takes the ownership of the specified UTF-8 string. | |
| UTF8String (const StringView &str) | |
| Initializes the UTF-8 string with a copy of the specified string view. | |
| UTF8String (const WStringView &str) | |
| Initializes the UTF-8 string with a UTF-8 encoded conversion of the specified wide string view. | |
| UTF8String (const char *str) | |
| Initializes the UTF-8 string with a copy of the specified null-terminated string. | |
| UTF8String (const wchar_t *str) | |
| Initializes the UTF-8 string with a UTF-8 encoded conversion of the specified null-terminated wide string. | |
| template<template< class, class, class > class TString, class TChar, class Traits, class Allocator> | |
| UTF8String (const TString< TChar, Traits, Allocator > &str) | |
| Initializes the UTF-8 string with a copy of another templated string class. This would usually be std::basic_string. | |
| UTF8String (SmallVector< char > &&data) | |
| Initializes the UTF-8 string by moving the ownership of the internal data container. | |
| bool | empty () const noexcept |
| size_type | size () const noexcept |
| size_type | length () const noexcept |
| size_type | capacity () const noexcept |
| const_pointer | data () const noexcept |
| const_pointer | c_str () const noexcept |
| const_reference | at (size_type pos) const |
| const_reference | front () const |
| const_reference | back () const |
| const_iterator | begin () const noexcept |
| const_iterator | cbegin () const noexcept |
| const_reverse_iterator | rbegin () const |
| const_reverse_iterator | crbegin () const |
| const_iterator | end () const noexcept |
| const_iterator | cend () const noexcept |
| const_reverse_iterator | rend () const |
| const_reverse_iterator | crend () const |
| void | clear () |
| int | compare (const StringView &str) const |
| int | compare (size_type pos1, size_type count1, const StringView &str) const |
| int | compare (size_type pos1, size_type count1, const StringView &str, size_type pos2, size_type count2=npos) const |
| int | compare (const WStringView &str) const |
| int | compare (size_type pos1, size_type count1, const WStringView &str) const |
| int | compare (size_type pos1, size_type count1, const WStringView &str, size_type pos2, size_type count2=npos) const |
| UTF8String | substr (size_type pos=0, size_type cout=npos) const |
| void | resize (size_type size, char ch='\0') |
| UTF8String & | append (size_type count, char ch) |
| UTF8String & | append (const char *first, const char *last) |
| SmallVector< wchar_t > | to_utf16 () const |
| Convert this string to a NUL-terminated UTF-16 string. | |
| UTF8String & | operator= (const UTF8String &rhs) |
| UTF8String & | operator= (UTF8String &&rhs) |
| UTF8String & | operator+= (const UTF8String &rhs) |
| UTF8String & | operator+= (const StringView &rhs) |
| UTF8String & | operator+= (const WStringView &rhs) |
| UTF8String & | operator+= (const char *rhs) |
| UTF8String & | operator+= (const wchar_t *rhs) |
| UTF8String & | operator+= (char chr) |
| UTF8String & | operator+= (wchar_t chr) |
| const_reference | operator[] (size_type pos) const |
| operator const_pointer () const | |
| Conversion operator to a null-terminated string. | |
| operator StringView () const | |
| Conversion operator to a string view. | |
Static Public Member Functions | |
| static UTF8String | Printf (const char *format,...) |
| Prints a formatted UTF-8 string with a variable number of arguments. | |
Static Public Attributes | |
| static constexpr size_type | npos = size_type(-1) |
Container class for UTF-8 encoded strings.
char and wchar_t strings automatically, but stores strings always as UTF-8 encoded char strings. | using LLGL::UTF8String::const_iterator = const value_type* |
| using LLGL::UTF8String::const_pointer = const value_type* |
| using LLGL::UTF8String::const_reference = const value_type& |
| using LLGL::UTF8String::const_reverse_iterator = std::reverse_iterator<const_iterator> |
| using LLGL::UTF8String::difference_type = std::ptrdiff_t |
| using LLGL::UTF8String::iterator = value_type* |
| using LLGL::UTF8String::pointer = value_type* |
| using LLGL::UTF8String::reference = value_type& |
| using LLGL::UTF8String::reverse_iterator = std::reverse_iterator<iterator> |
| using LLGL::UTF8String::size_type = std::size_t |
| using LLGL::UTF8String::value_type = char |
| LLGL::UTF8String::UTF8String | ( | ) |
Initialize an empty string.
| LLGL::UTF8String::UTF8String | ( | const UTF8String & | rhs | ) |
Initializes the UTF-8 string with a copy of the specified string.
| LLGL::UTF8String::UTF8String | ( | UTF8String && | rhs | ) |
Takes the ownership of the specified UTF-8 string.
| LLGL::UTF8String::UTF8String | ( | const StringView & | str | ) |
Initializes the UTF-8 string with a copy of the specified string view.
| LLGL::UTF8String::UTF8String | ( | const WStringView & | str | ) |
Initializes the UTF-8 string with a UTF-8 encoded conversion of the specified wide string view.
| LLGL::UTF8String::UTF8String | ( | const char * | str | ) |
Initializes the UTF-8 string with a copy of the specified null-terminated string.
| LLGL::UTF8String::UTF8String | ( | const wchar_t * | str | ) |
Initializes the UTF-8 string with a UTF-8 encoded conversion of the specified null-terminated wide string.
|
inline |
Initializes the UTF-8 string with a copy of another templated string class. This would usually be std::basic_string.
|
explicit |
Initializes the UTF-8 string by moving the ownership of the internal data container.
| [in] | data | The input data must already be in UTF-8 format. This constructor does not perform any checks on this input container! |
| UTF8String & LLGL::UTF8String::append | ( | const char * | first, |
| const char * | last ) |
| UTF8String & LLGL::UTF8String::append | ( | size_type | count, |
| char | ch ) |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| void LLGL::UTF8String::clear | ( | ) |
| int LLGL::UTF8String::compare | ( | const StringView & | str | ) | const |
| int LLGL::UTF8String::compare | ( | const WStringView & | str | ) | const |
| int LLGL::UTF8String::compare | ( | size_type | pos1, |
| size_type | count1, | ||
| const StringView & | str ) const |
| int LLGL::UTF8String::compare | ( | size_type | pos1, |
| size_type | count1, | ||
| const StringView & | str, | ||
| size_type | pos2, | ||
| size_type | count2 = npos ) const |
| int LLGL::UTF8String::compare | ( | size_type | pos1, |
| size_type | count1, | ||
| const WStringView & | str ) const |
| int LLGL::UTF8String::compare | ( | size_type | pos1, |
| size_type | count1, | ||
| const WStringView & | str, | ||
| size_type | pos2, | ||
| size_type | count2 = npos ) const |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
Conversion operator to a null-terminated string.
|
inline |
Conversion operator to a string view.
| UTF8String & LLGL::UTF8String::operator+= | ( | char | chr | ) |
| UTF8String & LLGL::UTF8String::operator+= | ( | const char * | rhs | ) |
| UTF8String & LLGL::UTF8String::operator+= | ( | const StringView & | rhs | ) |
| UTF8String & LLGL::UTF8String::operator+= | ( | const UTF8String & | rhs | ) |
| UTF8String & LLGL::UTF8String::operator+= | ( | const wchar_t * | rhs | ) |
| UTF8String & LLGL::UTF8String::operator+= | ( | const WStringView & | rhs | ) |
| UTF8String & LLGL::UTF8String::operator+= | ( | wchar_t | chr | ) |
| UTF8String & LLGL::UTF8String::operator= | ( | const UTF8String & | rhs | ) |
| UTF8String & LLGL::UTF8String::operator= | ( | UTF8String && | rhs | ) |
|
inline |
|
static |
Prints a formatted UTF-8 string with a variable number of arguments.
std::printf.
|
inline |
|
inline |
| void LLGL::UTF8String::resize | ( | size_type | size, |
| char | ch = '\0' ) |
|
inlinenoexcept |
| UTF8String LLGL::UTF8String::substr | ( | size_type | pos = 0, |
| size_type | cout = npos ) const |
| SmallVector< wchar_t > LLGL::UTF8String::to_utf16 | ( | ) | const |
Convert this string to a NUL-terminated UTF-16 string.