STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Protected Member Functions | Static Private Attributes | List of all members
stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode > Class Template Reference
Inheritance diagram for stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >:

Public Types

typedef _STD codecvt< _Elem, char, _Statype_Mybase
 
typedef _Mybase::result result
 
typedef char _Byte
 
typedef _Elem intern_type
 
typedef _Byte extern_type
 
typedef _Statype state_type
 

Public Member Functions

 codecvt_ebcdic (size_t _Refs=0)
 
virtual ~codecvt_ebcdic () _NOEXCEPT
 

Protected Member Functions

virtual result do_in (_Statype &, const _Byte *_First1, const _Byte *_Last1, const _Byte *&_Mid1, _Elem *_First2, _Elem *_Last2, _Elem *&_Mid2) const
 
virtual result do_out (_Statype &, const _Elem *_First1, const _Elem *_Last1, const _Elem *&_Mid1, _Byte *_First2, _Byte *_Last2, _Byte *&_Mid2) const
 
virtual result do_unshift (_Statype &, _Byte *_First2, _Byte *, _Byte *&_Mid2) const
 
virtual int do_length (_Statype &, const _Byte *_First1, const _Byte *_Last1, size_t _Count) const _THROW0()
 
virtual bool do_always_noconv () const _THROW0()
 
virtual int do_max_length () const _THROW0()
 
virtual int do_encoding () const _THROW0()
 

Static Private Attributes

static const unsigned char _Atoe [0x100]
 
static const unsigned char _Etoa [0x100]
 

Member Typedef Documentation

template<class _Elem , unsigned char _Maxcode = 0xff>
typedef char stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::_Byte
template<class _Elem , unsigned char _Maxcode = 0xff>
typedef _STD codecvt<_Elem, char, _Statype> stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::_Mybase
template<class _Elem , unsigned char _Maxcode = 0xff>
typedef _Byte stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::extern_type
template<class _Elem , unsigned char _Maxcode = 0xff>
typedef _Elem stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::intern_type
template<class _Elem , unsigned char _Maxcode = 0xff>
typedef _Mybase::result stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::result
template<class _Elem , unsigned char _Maxcode = 0xff>
typedef _Statype stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::state_type

Constructor & Destructor Documentation

template<class _Elem , unsigned char _Maxcode = 0xff>
stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::codecvt_ebcdic ( size_t  _Refs = 0)
inlineexplicit
38  : _Mybase(_Refs)
39  { // construct with ref count
40  }
_STD codecvt< _Elem, char, _Statype > _Mybase
Definition: ebcdic:30
template<class _Elem , unsigned char _Maxcode = 0xff>
virtual stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::~codecvt_ebcdic ( )
inlinevirtual
43  { // destroy the object
44  }

Member Function Documentation

template<class _Elem , unsigned char _Maxcode = 0xff>
virtual bool stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::do_always_noconv ( ) const
inlineprotectedvirtual
103  { // return true if conversions never change input
104  return (false);
105  }
template<class _Elem , unsigned char _Maxcode = 0xff>
virtual int stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::do_encoding ( ) const
inlineprotectedvirtual
113  { // return length of code sequence (from codecvt)
114  return (1);
115  }
template<class _Elem , unsigned char _Maxcode = 0xff>
virtual result stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::do_in ( _Statype ,
const _Byte _First1,
const _Byte _Last1,
const _Byte *&  _Mid1,
_Elem *  _First2,
_Elem *  _Last2,
_Elem *&  _Mid2 
) const
inlineprotectedvirtual
50  { // convert bytes [_First1, _Last1) to [_First2, _Last)
51  unsigned long _Maxc = _Maxcode; // to quiet warnings
52 
53  _Mid1 = _First1;
54  _Mid2 = _First2;
55  for (; _Mid1 != _Last1 && _Mid2 != _Last2; )
56  { // convert a multibyte sequence
57  unsigned char _Ch = _Etoa[(unsigned char)*_Mid1++];
58 
59  if (_Maxc < _Ch)
60  return (_Mybase::error); // code too large
61  *_Mid2++ = (_Elem)_Ch;
62  }
63 
64  return (_First1 == _Mid1 ? _Mybase::partial : _Mybase::ok);
65  }
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
static const unsigned char _Etoa[0x100]
Definition: ebcdic:27
template<class _Elem , unsigned char _Maxcode = 0xff>
virtual int stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::do_length ( _Statype ,
const _Byte _First1,
const _Byte _Last1,
size_t  _Count 
) const
inlineprotectedvirtual
96  { // return min(_Count, converted length of bytes [_First1, _Last1))
97  size_t _Wchars = _Last1 - _First1;
98 
99  return ((int)(_Count < _Wchars ? _Count : _Wchars));
100  }
_Diff _Count
Definition: algorithm:1941
template<class _Elem , unsigned char _Maxcode = 0xff>
virtual int stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::do_max_length ( ) const
inlineprotectedvirtual
108  { // return maximum length required for a conversion
109  return (1);
110  }
template<class _Elem , unsigned char _Maxcode = 0xff>
virtual result stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::do_out ( _Statype ,
const _Elem *  _First1,
const _Elem *  _Last1,
const _Elem *&  _Mid1,
_Byte _First2,
_Byte _Last2,
_Byte *&  _Mid2 
) const
inlineprotectedvirtual
70  { // convert [_First1, _Last1) to bytes [_First2, _Last)
71  unsigned long _Maxc = _Maxcode; // to quiet warnings
72 
73  _Mid1 = _First1;
74  _Mid2 = _First2;
75  for (; _Mid1 != _Last1 && _Mid2 != _Last2; )
76  { // convert and put a wide char
77  unsigned char _Ch = (unsigned char)*_Mid1++;
78 
79  if (_Maxc < _Ch)
80  return (_Mybase::error);
81  *_Mid2++ = (_Byte)_Atoe[_Ch];
82  }
83 
84  return (_First1 == _Mid1 ? _Mybase::partial : _Mybase::ok);
85  }
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
static const unsigned char _Atoe[0x100]
Definition: ebcdic:26
char _Byte
Definition: ebcdic:32
template<class _Elem , unsigned char _Maxcode = 0xff>
virtual result stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::do_unshift ( _Statype ,
_Byte _First2,
_Byte ,
_Byte *&  _Mid2 
) const
inlineprotectedvirtual
89  { // generate bytes to return to default shift state
90  _Mid2 = _First2;
91  return (_Mybase::ok);
92  }

Member Data Documentation

template<class _Elem , unsigned char _Maxcode = 0xff>
const unsigned char stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::_Atoe
staticprivate
template<class _Elem , unsigned char _Maxcode = 0xff>
const unsigned char stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::_Etoa
staticprivate

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