libstdc++
std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc > Class Template Reference

#include <locale_conv.h>

Public Types

typedef basic_string< char, char_traits< char >, _Byte_alloc > byte_string
 
typedef wide_string::traits_type::int_type int_type
 
typedef _Codecvt::state_type state_type
 
typedef basic_string< _Elem, char_traits< _Elem >, _Wide_alloc > wide_string
 

Public Member Functions

 wstring_convert ()
 
 wstring_convert (_Codecvt *__pcvt)
 
 wstring_convert (_Codecvt *__pcvt, state_type __state)
 
 wstring_convert (const byte_string &__byte_err, const wide_string &__wide_err=wide_string())
 
 wstring_convert (const wstring_convert &)=delete
 
size_t converted () const noexcept
 
wstring_convertoperator= (const wstring_convert &)=delete
 
state_type state () const
 
wide_string from_bytes (char __byte)
 
wide_string from_bytes (const char *__ptr)
 
wide_string from_bytes (const byte_string &__str)
 
wide_string from_bytes (const char *__first, const char *__last)
 
byte_string to_bytes (_Elem __wchar)
 
byte_string to_bytes (const _Elem *__ptr)
 
byte_string to_bytes (const wide_string &__wstr)
 
byte_string to_bytes (const _Elem *__first, const _Elem *__last)
 

Detailed Description

template<typename _Codecvt, typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
class std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >

String conversions.

Definition at line 262 of file locale_conv.h.

Member Typedef Documentation

◆ byte_string

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
typedef basic_string<char, char_traits<char>, _Byte_alloc> std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::byte_string

Definition at line 265 of file locale_conv.h.

◆ int_type

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
typedef wide_string::traits_type::int_type std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::int_type

Definition at line 268 of file locale_conv.h.

◆ state_type

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
typedef _Codecvt::state_type std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::state_type

Definition at line 267 of file locale_conv.h.

◆ wide_string

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
typedef basic_string<_Elem, char_traits<_Elem>, _Wide_alloc> std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::wide_string

Definition at line 266 of file locale_conv.h.

Constructor & Destructor Documentation

◆ wstring_convert() [1/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::wstring_convert ( )
inline

Default constructor.

Definition at line 271 of file locale_conv.h.

◆ wstring_convert() [2/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::wstring_convert ( _Codecvt *  __pcvt)
inlineexplicit

Constructor.

Parameters
__pcvtThe facet to use for conversions.

Takes ownership of __pcvt and will delete it in the destructor.

Definition at line 280 of file locale_conv.h.

◆ wstring_convert() [3/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::wstring_convert ( _Codecvt *  __pcvt,
state_type  __state 
)
inline

Construct with an initial converstion state.

Parameters
__pcvtThe facet to use for conversions.
__stateInitial conversion state.

Takes ownership of __pcvt and will delete it in the destructor. The object's conversion state will persist between conversions.

Definition at line 291 of file locale_conv.h.

◆ wstring_convert() [4/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::wstring_convert ( const byte_string __byte_err,
const wide_string __wide_err = wide_string() 
)
inlineexplicit

Construct with error strings.

Parameters
__byte_errA string to return on failed conversions.
__wide_errA wide string to return on failed conversions.

Definition at line 302 of file locale_conv.h.

Member Function Documentation

◆ converted()

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
size_t std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::converted ( ) const
inlinenoexcept

The number of elements successfully converted in the last conversion.

Definition at line 389 of file locale_conv.h.

◆ from_bytes() [1/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
wide_string std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::from_bytes ( char  __byte)
inline

◆ from_bytes() [2/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
wide_string std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::from_bytes ( const byte_string __str)
inline

◆ from_bytes() [3/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
wide_string std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::from_bytes ( const char *  __first,
const char *  __last 
)
inline

Convert from bytes.

Definition at line 336 of file locale_conv.h.

References std::basic_string< _CharT, _Traits, _Alloc >::get_allocator().

◆ from_bytes() [4/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
wide_string std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::from_bytes ( const char *  __ptr)
inline

Convert from bytes.

Definition at line 325 of file locale_conv.h.

References std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::from_bytes().

◆ state()

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
state_type std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::state ( ) const
inline

The final conversion state of the last conversion.

Definition at line 392 of file locale_conv.h.

◆ to_bytes() [1/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
byte_string std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::to_bytes ( _Elem  __wchar)
inline

◆ to_bytes() [2/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
byte_string std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::to_bytes ( const _Elem *  __first,
const _Elem *  __last 
)
inline

Convert to bytes.

Definition at line 372 of file locale_conv.h.

References std::basic_string< _CharT, _Traits, _Alloc >::get_allocator().

◆ to_bytes() [3/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
byte_string std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::to_bytes ( const _Elem *  __ptr)
inline

Convert to bytes.

Definition at line 359 of file locale_conv.h.

References std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::to_bytes().

◆ to_bytes() [4/4]

template<typename _Codecvt , typename _Elem = wchar_t, typename _Wide_alloc = allocator<_Elem>, typename _Byte_alloc = allocator<char>>
byte_string std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::to_bytes ( const wide_string __wstr)
inline

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