Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide

codecvt

Library:  Localization


... codecvt_base codecvt ... ... locale::facet

Local Index

Members

Summary

A code conversion facet

Synopsis

#include <locale>

namespace std {
  class codecvt_base;
  template <class internT, class externT, class stateT>
  class codecvt;
}

Specializations

Description

The codecvt class template provides code conversion facilities. The implementation of codecvt<char, char, mbstate_t> performs no conversions. The codecvt<wchar_t, char, mbstate_t> specialization performs a widening/narrowing during in/out operations. This qualifies as a conversion according to the standard, even though the value of the character remains unchanged).

Interface

Member Types

intern_type
extern_type
state_type

Constructor

explicit codecvt(size_t refs = 0) 

Facet ID locale::id

static locale::id id; 

Public Member Functions

The public members of the codecvt facet include an interface to protected members. Each public member xxx() has a corresponding virtual protected member do_xxx(). All work is delegated to these protected members. For instance, the public length() function simply calls its protected cousin do_length().

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_limit, 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_limit, extern_type*& to_next)
    const; 
result 
unshift(state_type& state, extern_type *to, extern_type *to_limit, 
        extern_type*& to) const;

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_limit,
      intern_type*& to_next) const; 
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_limit,
       extern_type*& to_next) const; 
virtual int 
do_length(state_type& state, 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_limit,
       extern_type*& to_next) const; 
virtual result
do_unshift(state_type& state, extern_type *to, extern_type *to_limit,
           extern_type*& to_next) const;

Example

See Also

locale, Facets, codecvt_byname

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 22.2.1.5



Previous fileTop of DocumentContentsIndex pageNext file