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
39  : _Mybase(_Refs)
40  { // construct with ref count
41  }
_STD codecvt< _Elem, char, _Statype > _Mybase
Definition: ebcdic:31
template<class _Elem , unsigned char _Maxcode = 0xff>
virtual stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::~codecvt_ebcdic ( )
inlinevirtual
44  { // destroy the object
45  }

Member Function Documentation

template<class _Elem , unsigned char _Maxcode = 0xff>
virtual bool stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::do_always_noconv ( ) const
inlineprotectedvirtual
104  { // return true if conversions never change input
105  return (false);
106  }
template<class _Elem , unsigned char _Maxcode = 0xff>
virtual int stdext::cvt::codecvt_ebcdic< _Elem, _Maxcode >::do_encoding ( ) const
inlineprotectedvirtual
114  { // return length of code sequence (from codecvt)
115  return (1);
116  }
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
51  { // convert bytes [_First1, _Last1) to [_First2, _Last)
52  unsigned long _Maxc = _Maxcode; // to quiet warnings
53 
54  _Mid1 = _First1;
55  _Mid2 = _First2;
56  for (; _Mid1 != _Last1 && _Mid2 != _Last2; )
57  { // convert a multibyte sequence
58  unsigned char _Ch = _Etoa[(unsigned char)*_Mid1++];
59 
60  if (_Maxc < _Ch)
61  return (_Mybase::error); // code too large
62  *_Mid2++ = (_Elem)_Ch;
63  }
64 
65  return (_First1 == _Mid1 ? _Mybase::partial : _Mybase::ok);
66  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
unsigned char
Definition: mbstring.h:107
static const unsigned char _Etoa[0x100]
Definition: ebcdic:28
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
97  { // return min(_Count, converted length of bytes [_First1, _Last1))
98  size_t _Wchars = _Last1 - _First1;
99 
100  return ((int)(_Count < _Wchars ? _Count : _Wchars));
101  }
_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
109  { // return maximum length required for a conversion
110  return (1);
111  }
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
71  { // convert [_First1, _Last1) to bytes [_First2, _Last)
72  unsigned long _Maxc = _Maxcode; // to quiet warnings
73 
74  _Mid1 = _First1;
75  _Mid2 = _First2;
76  for (; _Mid1 != _Last1 && _Mid2 != _Last2; )
77  { // convert and put a wide char
78  unsigned char _Ch = (unsigned char)*_Mid1++;
79 
80  if (_Maxc < _Ch)
81  return (_Mybase::error);
82  *_Mid2++ = (_Byte)_Atoe[_Ch];
83  }
84 
85  return (_First1 == _Mid1 ? _Mybase::partial : _Mybase::ok);
86  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
unsigned char
Definition: mbstring.h:107
static const unsigned char _Atoe[0x100]
Definition: ebcdic:27
char _Byte
Definition: ebcdic:33
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
90  { // generate bytes to return to default shift state
91  _Mid2 = _First2;
92  return (_Mybase::ok);
93  }

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: