codecvt::do_length
A virtual function that determines how many Bytes from a given sequence of external Bytes produce not more than a given number of internal CharTypes and returns that number of Bytes.
virtual int do_length(
const StateType& _State,
const Byte* _First1,
const Byte* _Last1,
size_t _Len2
) const;
Parameters
_State
The conversion state that is maintained between calls to the member function._First1
Pointer to the beginning of the external sequence._Last1
Pointer to the end of the external sequence._Len2
The maximum number of Bytes that can be returned by the member function.
Return Value
An integer that represents a count of the maximum number of conversions, not greater than _Len2, defined by the external source sequence at [_First1, _Last1).
Remarks
The protected virtual member function effectively calls do_in(_State, _First1, _Last1, _Next1, _Buf, _Buf + _Len2, _Next2) for _State (a copy of state), some buffer _Buf, and pointers _Next1and _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.
Example
See the example for length, which calls do_length.
Requirements
Header: <locale>
Namespace: std