std::__codecvt_abstract_base< _InternT, _ExternT, _StateT > Class Template Reference

Common base for codecvt facet. More...

#include <locale_facets.h>

Inheritance diagram for std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >:

std::locale::facet std::codecvt_base std::codecvt< _InternT, _ExternT, _StateT > std::codecvt_byname< _InternT, _ExternT, _StateT > List of all members.

Public Types

typedef codecvt_base::result result
typedef _InternT intern_type
typedef _ExternT extern_type
typedef _StateT state_type

Public Member Functions

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
 Convert from internal to external character set.

result unshift (state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const
 Reset conversion state.

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
 Convert from external to internal character set.

int encoding () const throw ()
bool always_noconv () const throw ()
int length (state_type &__state, const extern_type *__from, const extern_type *__end, size_t __max) const
int max_length () const throw ()

Protected Member Functions

 __codecvt_abstract_base (size_t __refs=0)
virtual ~__codecvt_abstract_base ()
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=0
 Convert from internal to external character set.

virtual result do_unshift (state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const=0
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=0
virtual int do_encoding () const=0 throw ()
virtual bool do_always_noconv () const=0 throw ()
virtual int do_length (state_type &, const extern_type *__from, const extern_type *__end, size_t __max) const=0
virtual int do_max_length () const=0 throw ()

Detailed Description

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

Common base for codecvt facet.

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 1606 of file locale_facets.h.


Member Typedef Documentation

template<typename _InternT, typename _ExternT, typename _StateT>
typedef _ExternT std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::extern_type
 

Reimplemented in std::codecvt< _InternT, _ExternT, _StateT >, and std::codecvt< char, char, mbstate_t >.

Definition at line 1613 of file locale_facets.h.

template<typename _InternT, typename _ExternT, typename _StateT>
typedef _InternT std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::intern_type
 

Reimplemented in std::codecvt< _InternT, _ExternT, _StateT >, and std::codecvt< char, char, mbstate_t >.

Definition at line 1612 of file locale_facets.h.

template<typename _InternT, typename _ExternT, typename _StateT>
typedef codecvt_base::result std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::result
 

Reimplemented from std::codecvt_base.

Reimplemented in std::codecvt< _InternT, _ExternT, _StateT >.

Definition at line 1611 of file locale_facets.h.

template<typename _InternT, typename _ExternT, typename _StateT>
typedef _StateT std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::state_type
 

Reimplemented in std::codecvt< _InternT, _ExternT, _StateT >, and std::codecvt< char, char, mbstate_t >.

Definition at line 1614 of file locale_facets.h.


Constructor & Destructor Documentation

template<typename _InternT, typename _ExternT, typename _StateT>
std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::__codecvt_abstract_base size_t  __refs = 0  )  [inline, explicit, protected]
 

Definition at line 1760 of file locale_facets.h.

template<typename _InternT, typename _ExternT, typename _StateT>
virtual std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::~__codecvt_abstract_base  )  [inline, protected, virtual]
 

Definition at line 1763 of file locale_facets.h.


Member Function Documentation

template<typename _InternT, typename _ExternT, typename _StateT>
bool std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::always_noconv  )  const throw () [inline]
 

Definition at line 1746 of file locale_facets.h.

Referenced by std::basic_filebuf< _CharT, _Traits >::seekoff().

template<typename _InternT, typename _ExternT, typename _StateT>
virtual bool std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::do_always_noconv  )  const throw () [protected, pure virtual]
 

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

template<typename _InternT, typename _ExternT, typename _StateT>
virtual int std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::do_encoding  )  const throw () [protected, pure virtual]
 

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

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

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

template<typename _InternT, typename _ExternT, typename _StateT>
virtual int std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::do_length state_type ,
const extern_type __from,
const extern_type __end,
size_t  __max
const [protected, pure virtual]
 

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

template<typename _InternT, typename _ExternT, typename _StateT>
virtual int std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::do_max_length  )  const throw () [protected, pure virtual]
 

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

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< _InternT, _ExternT, _StateT >, and std::codecvt< char, char, mbstate_t >.

template<typename _InternT, typename _ExternT, typename _StateT>
virtual result std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::do_unshift state_type __state,
extern_type __to,
extern_type __to_end,
extern_type *&  __to_next
const [protected, pure virtual]
 

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

template<typename _InternT, typename _ExternT, typename _StateT>
int std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::encoding  )  const throw () [inline]
 

Definition at line 1742 of file locale_facets.h.

Referenced by std::basic_filebuf< _CharT, _Traits >::seekoff(), and std::basic_filebuf< _CharT, _Traits >::underflow().

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 intialized 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:
state Persistent conversion state data.
from Start of input.
from_end End of input.
from_next Returns start of unconverted data.
to Start of output buffer.
to_end End of output buffer.
to_next Returns start of unused output area.
Returns:
codecvt_base::result.

Definition at line 1732 of file locale_facets.h.

Referenced by std::basic_filebuf< _CharT, _Traits >::underflow().

template<typename _InternT, typename _ExternT, typename _StateT>
int std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::length state_type __state,
const extern_type __from,
const extern_type __end,
size_t  __max
const [inline]
 

Definition at line 1750 of file locale_facets.h.

Referenced by std::basic_filebuf< _CharT, _Traits >::imbue(), and std::basic_filebuf< _CharT, _Traits >::seekoff().

template<typename _InternT, typename _ExternT, typename _StateT>
int std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::max_length  )  const throw () [inline]
 

Definition at line 1755 of file locale_facets.h.

Referenced by std::basic_filebuf< _CharT, _Traits >::showmanyc(), and std::basic_filebuf< _CharT, _Traits >::underflow().

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 intialized 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:
state Persistent conversion state data.
from Start of input.
from_end End of input.
from_next Returns start of unconverted data.
to Start of output buffer.
to_end End of output buffer.
to_next Returns start of unused output area.
Returns:
codecvt_base::result.

Definition at line 1653 of file locale_facets.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:
state Persistent conversion state data.
to Start of output buffer.
to_end End of output buffer.
to_next Returns start of unused output area.
Returns:
codecvt_base::result.

Definition at line 1692 of file locale_facets.h.

Referenced by std::basic_filebuf< _CharT, _Traits >::_M_terminate_output().


The documentation for this class was generated from the following file:
Generated on Tue Jan 30 17:32:14 2007 for GNU C++ STL by doxygen 1.3.6