libstdc++
std::codecvt< _InternT, _ExternT, encoding_state > Class Template Reference

#include <codecvt_specializations.h>

Inheritance diagram for std::codecvt< _InternT, _ExternT, encoding_state >:
[legend]

Public Types

typedef state_type::descriptor_type descriptor_type
 
typedef _ExternT extern_type
 
typedef _InternT intern_type
 
typedef codecvt_base::result result
 
typedef __gnu_cxx::encoding_state state_type
 

Public Member Functions

 codecvt (size_t __refs=0)
 
 codecvt (state_type &__enc, size_t __refs=0)
 
bool always_noconv () const throw ()
 
int encoding () const throw ()
 
result in (state_type &__state, const extern_type *__from, const extern_type *__from_end, const extern_type *&__from_next, intern_type *__to, intern_type *__to_end, intern_type *&__to_next) const
 
int length (state_type &__state, const extern_type *__from, const extern_type *__end, size_t __max) const
 
int max_length () const throw ()
 
result out (state_type &__state, const intern_type *__from, const intern_type *__from_end, const intern_type *&__from_next, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const
 
result unshift (state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const
 

Static Public Attributes

static locale::id id
 

Protected Member Functions

virtual bool do_always_noconv () const throw ()
 
virtual int do_encoding () const throw ()
 
virtual result do_in (state_type &__state, const extern_type *__from, const extern_type *__from_end, const extern_type *&__from_next, intern_type *__to, intern_type *__to_end, intern_type *&__to_next) const
 
virtual int do_length (state_type &, const extern_type *__from, const extern_type *__end, size_t __max) const
 
virtual int do_max_length () const throw ()
 
virtual result do_out (state_type &__state, const intern_type *__from, const intern_type *__from_end, const intern_type *&__from_next, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const
 
virtual result do_unshift (state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const
 

Static Protected Member Functions

static __c_locale _S_clone_c_locale (__c_locale &__cloc) throw ()
 
static void _S_create_c_locale (__c_locale &__cloc, const char *__s, __c_locale __old=0)
 
static void _S_destroy_c_locale (__c_locale &__cloc)
 
static __c_locale _S_get_c_locale ()
 
static const char * _S_get_c_name () throw ()
 
static __c_locale _S_lc_ctype_c_locale (__c_locale __cloc, const char *__s)
 

Detailed Description

template<typename _InternT, typename _ExternT>
class std::codecvt< _InternT, _ExternT, encoding_state >

codecvt<InternT, _ExternT, encoding_state> specialization.

Definition at line 233 of file codecvt_specializations.h.

Member Typedef Documentation

◆ descriptor_type

template<typename _InternT , typename _ExternT >
typedef state_type::descriptor_type std::codecvt< _InternT, _ExternT, encoding_state >::descriptor_type

Definition at line 242 of file codecvt_specializations.h.

◆ extern_type

template<typename _InternT , typename _ExternT >
typedef _ExternT std::codecvt< _InternT, _ExternT, encoding_state >::extern_type

Definition at line 240 of file codecvt_specializations.h.

◆ intern_type

template<typename _InternT , typename _ExternT >
typedef _InternT std::codecvt< _InternT, _ExternT, encoding_state >::intern_type

Definition at line 239 of file codecvt_specializations.h.

◆ result

template<typename _InternT , typename _ExternT >
typedef codecvt_base::result std::codecvt< _InternT, _ExternT, encoding_state >::result

Definition at line 238 of file codecvt_specializations.h.

◆ state_type

template<typename _InternT , typename _ExternT >
typedef __gnu_cxx::encoding_state std::codecvt< _InternT, _ExternT, encoding_state >::state_type

Definition at line 241 of file codecvt_specializations.h.

Constructor & Destructor Documentation

◆ codecvt() [1/2]

template<typename _InternT , typename _ExternT >
std::codecvt< _InternT, _ExternT, encoding_state >::codecvt ( size_t  __refs = 0)
inlineexplicit

Definition at line 248 of file codecvt_specializations.h.

◆ codecvt() [2/2]

template<typename _InternT , typename _ExternT >
std::codecvt< _InternT, _ExternT, encoding_state >::codecvt ( state_type __enc,
size_t  __refs = 0 
)
inlineexplicit

Definition at line 253 of file codecvt_specializations.h.

◆ ~codecvt()

template<typename _InternT , typename _ExternT >
virtual std::codecvt< _InternT, _ExternT, encoding_state >::~codecvt ( )
inlineprotectedvirtual

Definition at line 259 of file codecvt_specializations.h.

Member Function Documentation

◆ always_noconv()

bool std::__codecvt_abstract_base< _InternT, _ExternT, encoding_state >::always_noconv ( ) const
throw (
)
inlineinherited

Definition at line 213 of file codecvt.h.

◆ do_always_noconv()

template<typename _InternT , typename _ExternT >
bool std::codecvt< _InternT, _ExternT, encoding_state >::do_always_noconv
throw (
)
protectedvirtual

◆ do_encoding()

template<typename _InternT , typename _ExternT >
int std::codecvt< _InternT, _ExternT, encoding_state >::do_encoding
throw (
)
protectedvirtual

◆ do_in()

template<typename _InternT , typename _ExternT >
codecvt_base::result std::codecvt< _InternT, _ExternT, encoding_state >::do_in ( state_type __state,
const extern_type *  __from,
const extern_type *  __from_end,
const extern_type *&  __from_next,
intern_type *  __to,
intern_type *  __to_end,
intern_type *&  __to_next 
) const
protectedvirtual

◆ do_length()

template<typename _InternT , typename _ExternT >
int std::codecvt< _InternT, _ExternT, encoding_state >::do_length ( state_type ,
const extern_type *  __from,
const extern_type *  __end,
size_t  __max 
) const
protectedvirtual

◆ do_max_length()

template<typename _InternT , typename _ExternT >
int std::codecvt< _InternT, _ExternT, encoding_state >::do_max_length
throw (
)
protectedvirtual

◆ do_out()

template<typename _InternT , typename _ExternT >
codecvt_base::result std::codecvt< _InternT, _ExternT, encoding_state >::do_out ( state_type __state,
const intern_type *  __from,
const intern_type *  __from_end,
const intern_type *&  __from_next,
extern_type *  __to,
extern_type *  __to_end,
extern_type *&  __to_next 
) const
protectedvirtual

Convert from internal to external character set.

Converts input string of intern_type to output string of extern_type. This function is a hook for derived classes to change the value returned.

See also
out for more information.

Implements std::__codecvt_abstract_base< _InternT, _ExternT, encoding_state >.

Definition at line 308 of file codecvt_specializations.h.

◆ do_unshift()

template<typename _InternT , typename _ExternT >
codecvt_base::result std::codecvt< _InternT, _ExternT, encoding_state >::do_unshift ( state_type __state,
extern_type *  __to,
extern_type *  __to_end,
extern_type *&  __to_next 
) const
protectedvirtual

◆ encoding()

int std::__codecvt_abstract_base< _InternT, _ExternT, encoding_state >::encoding ( ) const
throw (
)
inlineinherited

Definition at line 209 of file codecvt.h.

◆ in()

result std::__codecvt_abstract_base< _InternT, _ExternT, encoding_state >::in ( state_type __state,
const extern_type *  __from,
const extern_type *  __from_end,
const extern_type *&  __from_next,
intern_type *  __to,
intern_type *  __to_end,
intern_type *&  __to_next 
) const
inlineinherited

Convert from external to internal character set.

Converts input string of extern_type to output string of intern_type. This is analogous to mbsrtowcs. It does this by calling codecvt::do_in.

The source and destination character sets are determined by the facet's locale, internal and external types.

The characters in [from,from_end) are converted and written to [to,to_end). from_next and to_next are set to point to the character following the last successfully converted character, respectively. If the result needed no conversion, from_next and to_next are not affected.

The state argument should be initialized if the input is at the beginning and carried from a previous call if continuing conversion. There are no guarantees about how state is used.

The result returned is a member of codecvt_base::result. If all the input is converted, returns codecvt_base::ok. If no conversion is necessary, returns codecvt_base::noconv. If the input ends early or there is insufficient space in the output, returns codecvt_base::partial. Otherwise the conversion failed and codecvt_base::error is returned.

Parameters
__statePersistent conversion state data.
__fromStart of input.
__from_endEnd of input.
__from_nextReturns start of unconverted data.
__toStart of output buffer.
__to_endEnd of output buffer.
__to_nextReturns start of unused output area.
Returns
codecvt_base::result.

Definition at line 199 of file codecvt.h.

◆ length()

int std::__codecvt_abstract_base< _InternT, _ExternT, encoding_state >::length ( state_type __state,
const extern_type *  __from,
const extern_type *  __end,
size_t  __max 
) const
inlineinherited

Definition at line 217 of file codecvt.h.

◆ max_length()

int std::__codecvt_abstract_base< _InternT, _ExternT, encoding_state >::max_length ( ) const
throw (
)
inlineinherited

Definition at line 222 of file codecvt.h.

◆ out()

result std::__codecvt_abstract_base< _InternT, _ExternT, encoding_state >::out ( state_type __state,
const intern_type *  __from,
const intern_type *  __from_end,
const intern_type *&  __from_next,
extern_type *  __to,
extern_type *  __to_end,
extern_type *&  __to_next 
) const
inlineinherited

Convert from internal to external character set.

Converts input string of intern_type to output string of extern_type. This is analogous to wcsrtombs. It does this by calling codecvt::do_out.

The source and destination character sets are determined by the facet's locale, internal and external types.

The characters in [from,from_end) are converted and written to [to,to_end). from_next and to_next are set to point to the character following the last successfully converted character, respectively. If the result needed no conversion, from_next and to_next are not affected.

The state argument should be initialized if the input is at the beginning and carried from a previous call if continuing conversion. There are no guarantees about how state is used.

The result returned is a member of codecvt_base::result. If all the input is converted, returns codecvt_base::ok. If no conversion is necessary, returns codecvt_base::noconv. If the input ends early or there is insufficient space in the output, returns codecvt_base::partial. Otherwise the conversion failed and codecvt_base::error is returned.

Parameters
__statePersistent conversion state data.
__fromStart of input.
__from_endEnd of input.
__from_nextReturns start of unconverted data.
__toStart of output buffer.
__to_endEnd of output buffer.
__to_nextReturns start of unused output area.
Returns
codecvt_base::result.

Definition at line 119 of file codecvt.h.

◆ unshift()

result std::__codecvt_abstract_base< _InternT, _ExternT, encoding_state >::unshift ( state_type __state,
extern_type *  __to,
extern_type *  __to_end,
extern_type *&  __to_next 
) const
inlineinherited

Reset conversion state.

Writes characters to output that would restore state to initial conditions. The idea is that if a partial conversion occurs, then the converting the characters written by this function would leave the state in initial conditions, rather than partial conversion state. It does this by calling codecvt::do_unshift().

For example, if 4 external characters always converted to 1 internal character, and input to in() had 6 external characters with state saved, this function would write two characters to the output and set the state to initialized conditions.

The source and destination character sets are determined by the facet's locale, internal and external types.

The result returned is a member of codecvt_base::result. If the state could be reset and data written, returns codecvt_base::ok. If no conversion is necessary, returns codecvt_base::noconv. If the output has insufficient space, returns codecvt_base::partial. Otherwise the reset failed and codecvt_base::error is returned.

Parameters
__statePersistent conversion state data.
__toStart of output buffer.
__to_endEnd of output buffer.
__to_nextReturns start of unused output area.
Returns
codecvt_base::result.

Definition at line 158 of file codecvt.h.

Member Data Documentation

◆ id

template<typename _InternT , typename _ExternT >
locale::id std::codecvt< _InternT, _ExternT, encoding_state >::id
static

Definition at line 245 of file codecvt_specializations.h.


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