Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Standard C++ Library Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

codecvt

Module:  Standard C++ Library   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

Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).

For more information on the Rogue Wave Standard C++ Library under open source, see Section 1.2 of the user's guide.