Standard C++ Library Reference ISO/IEC (VERSION3)

codecvt::do_length
virtual int do_length(const Statype state&,
const Byte *first1, const Byte *last1,
size_t len2) const throw();
The protected virtual member function effectively calls do_in(mystate, first1, last1, next1, buf,
buf + len2, next2) for mystate a copy of state, some buffer buf, and pointers next1 and next2. It then
returns next2 - buf. (Thus, it counts the maximum number of conversions, not greater than len2, defined by the
source sequence at [first1, last1).)
The template version always returns the lesser of last1 - first1 and len2.
codecvt::do_max_length
virtual int do_max_length() const throw();
The protected virtual member function returns the largest permissible value that can be returned by
do_length(first1, last1, 1), for arbitrary valid values of first1 and last1. (Thus, it is roughly
analogous to the macro MB_CUR_MAX, at least when Byte is type char.)
The template version always returns 1.
codecvt::do_out
virtual result do_out(Statype state&,
const Elem *first1, const Elem *last1,
const Elem *next1,
Byte *first2, Byte *last2, Byte *next2);
The protected virtual member function endeavors to convert the source sequence at [first1, last1) to a
destination sequence that it stores within [first2, last2). It always stores in next1 a pointer to the first
unconverted element in the source sequence, and it always stores in next2 a pointer to the first unaltered element in the
destination sequence.
state must represent the initial conversion state at the beginning of a new source sequence. The function alters its
stored value, as needed, to reflect the current state of a successful conversion. Its stored value is otherwise unspecified.
The function returns:
codecvt_base::error if the source sequence is ill formed
codecvt_base::noconv if the function performs no conversion
codecvt_base::ok if the conversion succeeds
codecvt_base::partial if the source is insufficient, or if the destination is not large enough, for the
conversion to succeed
The template version always returns noconv.
codecvt::do_unshift
virtual result do_unshift(Statype state&,
Byte *first2, Byte *last2, Byte *next2);
The protected virtual member function endeavors to convert the source element Elem(0) to a destination sequence that
it stores within [first2, last2), except for the terminating element Byte(0). It always stores in next2 a
pointer to the first unaltered element in the destination sequence.
state must represent the initial conversion state at the beginning of a new source sequence. The function alters its