libstdc++
std::__codecvt_abstract_base< _InternT, _ExternT, _StateT > Class Template Reference
Inheritance diagram for std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >:

List of all members.

Public Types

Public Member Functions

Protected Member Functions

Static Protected Member Functions

Friends


Detailed Description

template<typename _InternT, typename _ExternT, typename _StateT>
class std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >

Common base for codecvt functions.

This template class provides implementations of the public functions that forward to the protected virtual functions.

This template also provides abstract stubs for the protected virtual functions.

Definition at line 69 of file codecvt.h.


Member Function Documentation

template<typename _InternT, typename _ExternT, typename _StateT>
virtual result std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::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 [protected, pure virtual]

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.

Implemented in std::codecvt< wchar_t, char, mbstate_t >, std::codecvt< char, char, mbstate_t >, std::codecvt< _InternT, _ExternT, _StateT >, and std::codecvt< _InternT, _ExternT, encoding_state >.

Referenced by std::__codecvt_abstract_base< _InternT, _ExternT, encoding_state >::out().

template<typename _InternT, typename _ExternT, typename _StateT>
result std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::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 [inline]

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 197 of file codecvt.h.

template<typename _InternT, typename _ExternT, typename _StateT>
result std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::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 [inline]

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 117 of file codecvt.h.

template<typename _InternT, typename _ExternT, typename _StateT>
result std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::unshift ( state_type &  __state,
extern_type *  __to,
extern_type *  __to_end,
extern_type *&  __to_next 
) const [inline]

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 156 of file codecvt.h.


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