ReactOS 0.4.15-dev-8408-g466a198
eater_codecvt Struct Reference
Inheritance diagram for eater_codecvt:
Collaboration diagram for eater_codecvt:

Public Types

typedef codecvt< char, char, mbstate_tbase
 
- Public Types inherited from codecvt< char, char, mbstate_t >
typedef char intern_type
 
typedef char extern_type
 
typedef mbstate_t state_type
 
- Public Types inherited from codecvt_base
enum  result { ok , partial , error , noconv }
 

Public Member Functions

 eater_codecvt (size_t refs=0)
 
virtual base::result do_in (mbstate_t &mb, const char *ebegin, const char *eend, const char *&ecur, char *ibegin, char *iend, char *&icur) const __NO_THROW
 
virtual bool do_always_noconv () const __NO_THROW
 
virtual int do_encoding () const __NO_THROW
 
virtual int do_length (mbstate_t &state, const char *efrom, const char *eend, size_t m) const
 
virtual int do_max_length () const __NO_THROW
 
- Public Member Functions inherited from codecvt< char, char, mbstate_t >
 codecvt (size_t __refs=0)
 
result out (state_type &__state, const char *__from, const char *__from_end, const char *&__from_next, char *__to, char *__to_limit, char *&__to_next) const
 
result unshift (state_type &__state, char *__to, char *__to_limit, char *&__to_next) const
 
result in (state_type &__state, const char *__from, const char *__from_end, const char *&__from_next, char *__to, char *__to_limit, char *&__to_next) const
 
int encoding () const _STLP_NOTHROW
 
bool always_noconv () const _STLP_NOTHROW
 
int length (state_type &__state, const char *__from, const char *__from_end, size_t __max) const
 
int max_length () const _STLP_NOTHROW
 

Additional Inherited Members

- Static Public Attributes inherited from codecvt< char, char, mbstate_t >
static _STLP_STATIC_DECLSPEC locale::id id = { 3 }
 
- Protected Member Functions inherited from codecvt< char, char, mbstate_t >
 ~codecvt ()
 
virtual result do_out (state_type &, const char *__from, const char *, const char *&__from_next, char *__to, char *, char *&__to_next) const
 
virtual result do_in (state_type &, const char *__from, const char *, const char *&__from_next, char *__to, char *, char *&__to_next) const
 
virtual result do_unshift (state_type &, char *__to, char *, char *&__to_next) const
 
virtual int do_encoding () const _STLP_NOTHROW
 
virtual bool do_always_noconv () const _STLP_NOTHROW
 
virtual int do_length (state_type &__state, const char *__from, const char *__end, size_t __max) const
 
virtual int do_max_length () const _STLP_NOTHROW
 
- Protected Member Functions inherited from locale::facet
 facet (size_t __init_count=0)
 
virtual ~facet ()
 
- Protected Member Functions inherited from _Refcount_Base
 _Refcount_Base (__stl_atomic_t __n)
 
__stl_atomic_t _M_incr ()
 
__stl_atomic_t _M_decr ()
 

Detailed Description

Definition at line 55 of file codecvt_test.cpp.

Member Typedef Documentation

◆ base

Definition at line 56 of file codecvt_test.cpp.

Constructor & Destructor Documentation

◆ eater_codecvt()

eater_codecvt::eater_codecvt ( size_t  refs = 0)
inlineexplicit

Definition at line 58 of file codecvt_test.cpp.

58: base(refs) {}
codecvt< char, char, mbstate_t > base

Member Function Documentation

◆ do_always_noconv()

virtual bool eater_codecvt::do_always_noconv ( ) const
inlinevirtual

Reimplemented from codecvt< char, char, mbstate_t >.

Definition at line 108 of file codecvt_test.cpp.

109 { return false; }

◆ do_encoding()

virtual int eater_codecvt::do_encoding ( ) const
inlinevirtual

Reimplemented from codecvt< char, char, mbstate_t >.

Definition at line 112 of file codecvt_test.cpp.

113 { return 0; }

◆ do_in()

virtual base::result eater_codecvt::do_in ( mbstate_t mb,
const char ebegin,
const char eend,
const char *&  ecur,
char ibegin,
char iend,
char *&  icur 
) const
inlinevirtual

Reimplemented from codecvt< char, char, mbstate_t >.

Definition at line 62 of file codecvt_test.cpp.

64 {
65 char *state = (char*)&mb;
66 ecur = ebegin;
67 icur = ibegin;
68
69 while (ecur != eend) {
70 if (icur == iend)
71 return partial;
72 if (*ecur == '0' || *state == 1) {
73 if (*state != 1) {
74 ++ecur;
75 }
76 if (ecur == eend) {
77 *state = 1;
78 return ok;
79 }
80
81 if (*ecur == '1') {
82 *icur = 'a';
83 }
84 else {
85 *(icur++) = '0';
86 if (icur == iend) {
87 if (*state != 1) {
88 --ecur;
89 }
90 return partial;
91 }
92 *icur = *ecur;
93 }
94 }
95 else {
96 *icur = *ecur;
97 }
98
99 *state = 0;
100 ++icur;
101 ++ecur;
102 }
103
104 return ok;
105 }
static int state
Definition: maze.c:121

Referenced by do_length().

◆ do_length()

virtual int eater_codecvt::do_length ( mbstate_t state,
const char efrom,
const char eend,
size_t  m 
) const
inlinevirtual

Reimplemented from codecvt< char, char, mbstate_t >.

Definition at line 116 of file codecvt_test.cpp.

117 {
118 char *ibegin = new char[m];
119 const char *ecur = efrom;
120 char *icur = ibegin;
121 mbstate_t tmp = state;
122 do_in(tmp, efrom, eend, ecur, ibegin, ibegin + m, icur);
123 delete[] ibegin;
124 return ecur - efrom;
125 }
const GLfloat * m
Definition: glext.h:10848
virtual base::result do_in(mbstate_t &mb, const char *ebegin, const char *eend, const char *&ecur, char *ibegin, char *iend, char *&icur) const __NO_THROW

◆ do_max_length()

virtual int eater_codecvt::do_max_length ( ) const
inlinevirtual

Reimplemented from codecvt< char, char, mbstate_t >.

Definition at line 127 of file codecvt_test.cpp.

128 { return 2; }

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