Boost.UI
User Interface Boost library
|
Helper class to convert string between UI and application logic only. More...
Public Types | |
typedef std::size_t | size_type |
Unsigned integral type. | |
typedef void * | native_handle_type |
Implementation-defined string type. | |
Public Member Functions | |
void | swap (const uistring &other) |
Exchanges the contents of strings. | |
bool | empty () const noexcept |
Checks whether the string is empty. | |
void | clear () noexcept |
Clears the contents. | |
void | shrink_to_fit () |
Requests the removal of unused capacity. | |
template<class charT > | |
std::basic_string< charT > | utf () const |
Returns UTF-8/16/32 encoded string Returns UTF-8 encoded string if charT is char, returns UTF-16 encoded string if charT is char16_t, returns UTF-32 encoded string if charT is char32_t, returns std::wstring if charT is wchar_t. | |
template<class charT > | |
std::basic_string< charT > | basic_string () const |
Returns std::basic_string<charT> | |
std::string | u8string () const |
Returns UTF-8 encoded string. | |
std::wstring | wstring () const |
Returns Unicode wide std::wstring. | |
std::u16string | u16string () const |
Returns UTF-16 std::u16string. | |
template<> | |
std::basic_string< char > | utf () const |
Returns UTF-8 encoded string. More... | |
template<> | |
std::wstring | basic_string () const |
Returns std::wstring. More... | |
uistring (const uistring &other) | |
Constructs uistring from other uistring. | |
uistring (uistring &&other) | |
Constructs uistring from other uistring. | |
uistring (const wchar_t *str) | |
Constructs uistring from Unicode wide char string. | |
uistring (const std::wstring &str) | |
Constructs uistring from Unicode wide char string. | |
uistring (std::initializer_list< wchar_t > list) | |
Constructs uistring from Unicode wide char string. | |
uistring (const char16_t *str) | |
Constructs uistring from UTF-16 string. | |
uistring (const std::u16string &str) | |
Constructs uistring from UTF-16 string. | |
uistring (std::initializer_list< char16_t > list) | |
Constructs uistring from UTF-16 string. | |
uistring (const char32_t *str) | |
Constructs uistring from UTF-32 string. | |
uistring (const std::u32string &str) | |
Constructs uistring from UTF-32 string. | |
uistring (std::initializer_list< char32_t > list) | |
Constructs uistring from UTF-32 string. | |
uistring & | assign (const uistring &other) |
Assigns other string to this string. | |
uistring & | operator= (const uistring &other) |
Assigns other string to this string. | |
uistring & | assign (uistring &&other) |
Assigns other string to this string. | |
uistring & | operator= (uistring &&other) |
Assigns other string to this string. | |
uistring & | assign (std::initializer_list< wchar_t > list) |
Assigns other string to this string. | |
uistring & | operator= (std::initializer_list< wchar_t > list) |
Assigns other string to this string. | |
uistring & | append (const uistring &str) |
Appends characters to the end of string. | |
uistring & | operator+= (const uistring &str) |
Appends characters to the end of string. | |
uistring & | append (size_type count, wchar_t ch) |
Appends characters to the end of string. | |
uistring & | append (size_type count, char16_t ch) |
Appends characters to the end of string. | |
uistring & | append (size_type count, char32_t ch) |
Appends characters to the end of string. | |
uistring & | append (std::initializer_list< wchar_t > list) |
Appends characters to the end of string. | |
uistring & | operator+= (std::initializer_list< wchar_t > list) |
Appends characters to the end of string. | |
uistring & | append (std::initializer_list< char16_t > list) |
Appends characters to the end of string. | |
uistring & | operator+= (std::initializer_list< char16_t > list) |
Appends characters to the end of string. | |
uistring & | append (std::initializer_list< char32_t > list) |
Appends characters to the end of string. | |
uistring & | operator+= (std::initializer_list< char32_t > list) |
Appends characters to the end of string. | |
void | push_back (wchar_t ch) |
Appends character to the end of string. | |
uistring & | operator+= (wchar_t ch) |
Appends character to the end of string. | |
void | push_back (char16_t ch) |
Appends character to the end of string. | |
uistring & | operator+= (char16_t ch) |
Appends character to the end of string. | |
void | push_back (char32_t ch) |
Appends character to the end of string. | |
uistring & | operator+= (char32_t ch) |
Appends character to the end of string. | |
int | compare (const uistring &other) const noexcept |
Lexicographically compares two strings. | |
bool | operator== (const uistring &other) const noexcept |
Lexicographically compares two strings. | |
bool | operator!= (const uistring &other) const noexcept |
Lexicographically compares two strings. | |
bool | operator< (const uistring &other) const noexcept |
Lexicographically compares two strings. | |
bool | operator<= (const uistring &other) const noexcept |
Lexicographically compares two strings. | |
bool | operator> (const uistring &other) const noexcept |
Lexicographically compares two strings. | |
bool | operator>= (const uistring &other) const noexcept |
Lexicographically compares two strings. | |
std::u32string | u32string () const |
Returns UTF-32 std::u32string. | |
native_handle_type | native_handle () |
Returns the implementation-defined underlying string handle. | |
const native_handle_type | native_handle () const |
Returns the implementation-defined underlying string handle. | |
Related Functions | |
(Note that these are not member functions.) | |
#define | BOOST_UI_NO_STRING_DESTRUCTIVE |
Disables potentially destructive string operations with conversion from uistring to ASCII. | |
#define | BOOST_UI_NO_CAST_FROM_ASCII |
Disables implicit conversion from ASCII to uistring. | |
std::size_t | hash_value (const uistring &value) |
Returns hash of uistring for boost::hash. | |
void | swap (boost::ui::uistring &a, boost::ui::uistring &b) |
Specializes the std::swap algorithm. | |
template<class Traits > | |
std::basic_ostream< char, Traits > & | operator<< (std::basic_ostream< char, Traits > &os, const uistring &str) |
Writes string into the stream. | |
template<class Traits > | |
std::basic_istream< char, Traits > & | operator>> (std::basic_istream< char, Traits > &is, ui::uistring &str) |
Reads string from the stream. | |
template<class Traits > | |
std::basic_istream< char, Traits > & | getline (std::basic_istream< char, Traits > &is, boost::ui::uistring &str, char ch='\n') |
Reads characters from the stream into the string. | |
uistring | u8uistring (const char *str) |
Constructs uistring from UTF-8 encoded string. | |
uistring | asciiuistring (const char *str) |
Constructs uistring from 7-bit ASCII encoded string. | |
uistring | operator+ (const uistring &lhs, const uistring &rhs) |
Concatenates two strings or the string and the character. | |
uistring | to_uistring (int value) |
Converts numeric value to uistring. | |
Helper class to convert string between UI and application logic only.
|
inline |
Returns std::wstring.
Returns std::u32string.
Returns std::u16string.
|
inline |
Returns UTF-8 encoded string.
Returns UTF-32 encoded string.
Returns UTF-16 encoded string.
Returns std::wstring.