cxxtools::TextCodec< I, E > Class Template Reference

Generic TextCodec class/facet which may be subclassed by specific Codec classes. More...

#include <cxxtools/textcodec.h>

Inheritance diagram for cxxtools::TextCodec< I, E >:
std::codecvt< I, E, cxxtools::MBState > std::codecvt_base

Public Types

typedef I InternT
typedef E ExternT
- Public Types inherited from std::codecvt< I, E, cxxtools::MBState >
typedef I InternT
typedef E ExternT
typedef cxxtools::MBState StateT
- Public Types inherited from std::codecvt_base
enum  { ok, partial, error, noconv }
typedef int result

Public Member Functions

 TextCodec (size_t ref=0)
 Constructs a new TextCodec object.
virtual ~TextCodec ()
 Empty desctructor.
size_t refs () const
- Public Member Functions inherited from std::codecvt< I, E, cxxtools::MBState >
 codecvt (size_t ref=0)
virtual ~codecvt ()
codecvt_base::result out (StateT &state, const InternT *from, const InternT *from_end, const InternT *&from_next, ExternT *to, ExternT *to_end, ExternT *&to_next) const
codecvt_base::result unshift (StateT &state, ExternT *to, ExternT *to_end, ExternT *&to_next) const
codecvt_base::result in (StateT &state, const ExternT *from, const ExternT *from_end, const ExternT *&from_next, InternT *to, InternT *to_end, InternT *&to_next) const
int encoding () const
bool always_noconv () const
int length (StateT &state, const ExternT *from, const ExternT *end, size_t max) const
int max_length () const
- Public Member Functions inherited from std::codecvt_base
virtual ~codecvt_base ()

Additional Inherited Members

- Protected Member Functions inherited from std::codecvt< I, E, cxxtools::MBState >
virtual result do_in (StateT &s, const ExternT *fromBegin, const ExternT *fromEnd, const ExternT *&fromNext, InternT *toBegin, InternT *toEnd, InternT *&toNext) const =0
virtual result do_out (StateT &s, const InternT *fromBegin, const InternT *fromEnd, const InternT *&fromNext, ExternT *toBegin, ExternT *toEnd, ExternT *&toNext) const =0
virtual bool do_always_noconv () const =0
virtual int do_length (StateT &s, const ExternT *fromBegin, const ExternT *fromEnd, size_t max) const =0
virtual int do_max_length () const =0
virtual std::codecvt_base::result do_unshift (StateT &, ExternT *, ExternT *, ExternT *&) const =0
virtual int do_encoding () const =0

Detailed Description

template<typename I, typename E>
class cxxtools::TextCodec< I, E >

Generic TextCodec class/facet which may be subclassed by specific Codec classes.

This class contains default implementations for the methods do_unshift(), do_encoding() and do_always_noconv() so sub-classes do not have to implement this default behaviour.

Codecs are used to convert one Text-encoding into another Text-encoding. The internal and external data type can be specified using the template parameter 'I' (internal) and 'E' (external).

When used on a platform which supports locales and facets the conversion may use locale-specific conversion of the Text.

This class derives from facet std::codecvt. Further documentation can be found there.

Parameters
IThe character type associated with the internal code set.
EThe character type associated with the external code set.
See Also
Utf8Codec
Utf16Codec
Utf32Codec

Member Typedef Documentation

template<typename I, typename E>
typedef E cxxtools::TextCodec< I, E >::ExternT
template<typename I, typename E>
typedef I cxxtools::TextCodec< I, E >::InternT

Constructor & Destructor Documentation

template<typename I, typename E>
cxxtools::TextCodec< I, E >::TextCodec ( size_t  ref = 0)
inlineexplicit

Constructs a new TextCodec object.

The internal and external type are specified by the template parameters of the class.

Parameters
refThis parameter is passed to std::codecvt. When ref == 0 the locale takes care of deleting the facet. If ref == 1 the locale does not destroy the facet.
template<typename I, typename E>
virtual cxxtools::TextCodec< I, E >::~TextCodec ( )
inlinevirtual

Empty desctructor.

Member Function Documentation

template<typename I, typename E>
size_t cxxtools::TextCodec< I, E >::refs ( ) const
inline

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