Compartilhar via


codecvt::do_unshift

A virtual function called to provide the Bytes needed in a state-dependent conversion to complete the last character in a sequence of Bytes.

virtual result do_unshift(
    StateType& _State,
    Byte* _First2, 
    Byte* _Last2, 
    Byte*& _Next2
) const;

Parameters

  • _State
    The conversion state that is maintained between calls to the member function.

  • _First2
    Pointer to the first position in the destination range.

  • _Last2
    Pointer to the last position in the destination range.

  • _Next2
    Pointer to the first unaltered element in the destination sequence.

Return Value

The function returns:

  • codecvt_base::error if _State represents an invalid state

  • codecvt_base::noconv if the function performs no conversion

  • codecvt_base::ok if the conversion succeeds

  • codecvt_base::partial if the destination is not large enough for the conversion to succeed

Remarks

The protected virtual member function tries to convert the source element CharType(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 stored value as needed to reflect the current state of a successful conversion. Typically, converting the source element CharType(0) leaves the current state in the initial conversion state.

Example

See the example for unshift, which calls do_unshift.

Requirements

Header: <locale>

Namespace: std

See Also

Reference

codecvt Class

Other Resources

codecvt Members