libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ in() [3/3]

result std::__codecvt_abstract_base< wchar_t, char, mbstate_t >::in ( state_type & __state,
const extern_type * __from,
const extern_type * __from_end,
const extern_type *& __from_next,
intern_type * __to,
intern_type * __to_end,
intern_type *& __to_next ) const
inline

Convert from external to internal character set.

Converts input string of extern_type to output string of intern_type. This is analogous to mbsrtowcs. It does this by calling codecvt::do_in.

The source and destination character sets are determined by the facet's locale, internal and external types.

The characters in [from,from_end) are converted and written to [to,to_end). from_next and to_next are set to point to the character following the last successfully converted character, respectively. If the result needed no conversion, from_next and to_next are not affected.

The state argument should be initialized if the input is at the beginning and carried from a previous call if continuing conversion. There are no guarantees about how state is used.

The result returned is a member of codecvt_base::result. If all the input is converted, returns codecvt_base::ok. If no conversion is necessary, returns codecvt_base::noconv. If the input ends early or there is insufficient space in the output, returns codecvt_base::partial. Otherwise the conversion failed and codecvt_base::error is returned.

Parameters
__statePersistent conversion state data.
__fromStart of input.
__from_endEnd of input.
__from_nextReturns start of unconverted data.
__toStart of output buffer.
__to_endEnd of output buffer.
__to_nextReturns start of unused output area.
Returns
codecvt_base::result.

Definition at line 204 of file codecvt.h.

208 {
209 return this->do_in(__state, __from, __from_end, __from_next,
211 }
virtual result do_in(state_type &__state, const extern_type *__from, const extern_type *__from_end, const extern_type *&__from_next, intern_type *__to, intern_type *__to_end, intern_type *&__to_next) const