Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

codecvt


...inherits fromcodecvt_base codecvt... ...inherits fromlocale::facet

Summary

A code conversion facet.

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <locale>
class codecvt_base;
template <class internT, class externT, class stateT>
class codecvt;

Description

The codecvt<internT,externT,stateT> template has code conversion facilities. Default implementations of codecvt<char,wchar_t,mbstate_t> and codecvt<wchar_t,char,mbstate_t> use ctype<wchar_t>::widen and ctype<wchar_t>::narrow respectively. The default implementation of codecvt<wchar_t,wchar_t,mbstate_t> simply uses memcpy (no particular conversion applied).

Interface

Types

intern_type
extern_type
state_type

Constructors

explicit codecvt(size_t refs = 0) 

Destructors

~codecvt();  // virtual and protected

Facet 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(stateT& state, const externT* from, 
   const externT* from_end, const externT*& from_next,
   internT* to, internT* to_limit, internT*& to_next) const; 
int 
length(const stateT& state, const internT* from, 
       const internT* end,
       size_t max) const; 
int 
max_length() const 
  throw();
result 
out(stateT& state, const internT* from, 
    const internT* from_end, const internT*& from_next,
    externT* to, externT* to_limit, externT*& to_next)
    const; 
result 
unshift(stateT& state, externT* to, externT* to_limit, 
        externT*& to) const;

Protected Member Functions

virtual bool 
do_always_noconv() const 
  throw();
virtual int 
do_encoding() const 
  throw();
virtual result 
do_in(stateT& state,
      const externT* from, 
      const externT* from_end, 
      const externT*& from_next,
      internT* to, internT* to_limit,
      internT*& to_next) const; 
virtual result 
do_out(stateT& state,
       const internT* from, 
       const internT* from_end, 
       const internT*& from_next,
       externT* to, externT* to_limit,
       externT*& to_next) const; 
virtual int 
do_length(const stateT&, const externT* from, 
          const externT* end,
          size_t max) const; 
virtual int 
do_max_length() const throw();
virtual result 
do_out(stateT& state,
       const internT* from, 
       const internT* from_end, 
       const internT*& from_next,
       externT* to, externT* to_limit,
       externT*& to_next) const; 
virtual result
do_unshift(stateT& state, externT* to, externT* to_limit,
           externT*& to_next) const;

Example

See Also

locale, facets, codecvt_byname



Previous fileTop of documentContentsIndexNext file
©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998