Boost.UI
User Interface Boost library
Public Types | Public Member Functions | Related Functions | List of all members
boost::ui::uistring Class Reference

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.
 
template<>
std::basic_string< wchar_t > utf () const
 Returns std::wstring.
 
template<>
std::wstring basic_string () const
 Returns std::wstring.
 
template<>
std::basic_string< char16_t > utf () const
 Returns UTF-16 encoded string.
 
template<>
std::u16string basic_string () const
 Returns std::u16string.
 
template<>
std::basic_string< char32_t > utf () const
 Returns UTF-32 encoded string.
 
template<>
std::u32string basic_string () const
 Returns std::u32string.
 
 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.
 
uistringassign (const uistring &other)
 Assigns other string to this string.
 
uistringoperator= (const uistring &other)
 Assigns other string to this string.
 
uistringassign (uistring &&other)
 Assigns other string to this string.
 
uistringoperator= (uistring &&other)
 Assigns other string to this string.
 
uistringassign (std::initializer_list< wchar_t > list)
 Assigns other string to this string.
 
uistringoperator= (std::initializer_list< wchar_t > list)
 Assigns other string to this string.
 
uistringappend (const uistring &str)
 Appends characters to the end of string.
 
uistringoperator+= (const uistring &str)
 Appends characters to the end of string.
 
uistringappend (size_type count, wchar_t ch)
 Appends characters to the end of string.
 
uistringappend (size_type count, char16_t ch)
 Appends characters to the end of string.
 
uistringappend (size_type count, char32_t ch)
 Appends characters to the end of string.
 
uistringappend (std::initializer_list< wchar_t > list)
 Appends characters to the end of string.
 
uistringoperator+= (std::initializer_list< wchar_t > list)
 Appends characters to the end of string.
 
uistringappend (std::initializer_list< char16_t > list)
 Appends characters to the end of string.
 
uistringoperator+= (std::initializer_list< char16_t > list)
 Appends characters to the end of string.
 
uistringappend (std::initializer_list< char32_t > list)
 Appends characters to the end of string.
 
uistringoperator+= (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.
 
uistringoperator+= (wchar_t ch)
 Appends character to the end of string.
 
void push_back (char16_t ch)
 Appends character to the end of string.
 
uistringoperator+= (char16_t ch)
 Appends character to the end of string.
 
void push_back (char32_t ch)
 Appends character to the end of string.
 
uistringoperator+= (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. More...
 
void swap (boost::ui::uistring &a, boost::ui::uistring &b)
 Specializes the std::swap algorithm. More...
 
template<class Traits >
std::basic_ostream< char, Traits > & operator<< (std::basic_ostream< char, Traits > &os, const uistring &str)
 Writes string into the stream. More...
 
template<class Traits >
std::basic_istream< char, Traits > & operator>> (std::basic_istream< char, Traits > &is, ui::uistring &str)
 Reads string from the stream. More...
 
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. More...
 
uistring u8uistring (const char *str)
 Constructs uistring from UTF-8 encoded string. More...
 
uistring asciiuistring (const char *str)
 Constructs uistring from 7-bit ASCII encoded string. More...
 
uistring operator+ (const uistring &lhs, const uistring &rhs)
 Concatenates two strings or the string and the character. More...
 
uistring to_uistring (int value)
 Converts numeric value to uistring. More...
 

Detailed Description

Helper class to convert string between UI and application logic only.

Friends And Related Function Documentation

uistring asciiuistring ( const char *  str)
related

Constructs uistring from 7-bit ASCII encoded string.

template<class Traits >
std::basic_istream< char, Traits > & getline ( std::basic_istream< char, Traits > &  is,
boost::ui::uistring str,
char  ch = '\n' 
)
related

Reads characters from the stream into the string.

std::size_t hash_value ( const uistring value)
related

Returns hash of uistring for boost::hash.

uistring operator+ ( const uistring lhs,
const uistring rhs 
)
related

Concatenates two strings or the string and the character.

template<class Traits >
std::basic_ostream< char, Traits > & operator<< ( std::basic_ostream< char, Traits > &  os,
const uistring str 
)
related

Writes string into the stream.

template<class Traits >
std::basic_istream< char, Traits > & operator>> ( std::basic_istream< char, Traits > &  is,
ui::uistring str 
)
related

Reads string from the stream.

void swap ( boost::ui::uistring a,
boost::ui::uistring b 
)
related

Specializes the std::swap algorithm.

uistring to_uistring ( int  value)
related

Converts numeric value to uistring.

uistring u8uistring ( const char *  str)
related

Constructs uistring from UTF-8 encoded string.


The documentation for this class was generated from the following files: