Home | Libraries | People | FAQ | More |
boost::ui::uistring — Helper class to convert string between UI and application logic only.
// In header: <boost/ui/string.hpp> class uistring { public: // types typedef std::size_t size_type; // Unsigned integral type. typedef void * native_handle_type; // Implementation-defined string type. // construct/copy/destruct uistring(const uistring &); uistring(uistring &&); uistring(const wchar_t *); uistring(const std::wstring &); uistring(std::initializer_list< wchar_t >); uistring(const char16_t *); uistring(const std::u16string &); uistring(std::initializer_list< char16_t >); uistring(const char32_t *); uistring(const std::u32string &); uistring(std::initializer_list< char32_t >); uistring(); uistring & operator=(const uistring &); uistring & operator=(uistring &&); uistring & operator=(std::initializer_list< wchar_t >); ~uistring(); // public member functions void swap(const uistring &); bool empty() const noexcept; void clear() noexcept; void shrink_to_fit(); template<typename charT> std::basic_string< charT > utf() const; template<typename charT> std::basic_string< charT > basic_string() const; std::string u8string() const; std::wstring wstring() const; std::u16string u16string() const; template<> std::basic_string< char > utf() const; template<> std::wstring basic_string() const; // private member functions void init(); void init(const std::wstring &); template<typename String> void init(const String &); template<typename String> String xstring() const; // private static functions static uistring make_from_utf8(const char *); static uistring make_from_ascii(const char *); };
uistring
public
construct/copy/destructuistring(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();
uistring & operator=(const uistring & other);Assigns other string to this string.
uistring & operator=(uistring && other);Assigns other string to this string.
uistring & operator=(std::initializer_list< wchar_t > list);Assigns other string to this string.
~uistring();
uistring
public member functionsvoid 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<typename 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<typename 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.
Returns UTF-32 encoded string.
Returns UTF-16 encoded string.
Returns std::wstring.
template<> std::wstring basic_string() const;Returns std::wstring.
Returns std::u32string.
Returns std::u16string.