STD::__CODECVT_ABSTRACT_BASE(3cxx)

πŸ’– NAME πŸ’–

Okay bestie, welcome to the 3cxx manual page for std::__codecvt_abstract_base< _InternT, _ExternT, _StateT > β€” literally the common base for codecvt functions. The header gets truncated to std::__codecvt...ernT, _StateT >, iykyk. 🌸

✨ SYNOPSIS ✨

#include <locale>

She inherits from std::locale::facet and std::codecvt_base. No cap. πŸ’…

And she’s inherited by std::codecvt< _Elem, char, mbstate_t > and std::codecvt< _InternT, _ExternT, _StateT >. Iconic lineage, fr fr.

🌸 Public Types 🌸

  • extern_type β€” typedef _ExternT extern_type
  • intern_type β€” typedef _InternT intern_type
  • result β€” typedef codecvt_base::result result
  • state_type β€” typedef _StateT state_type

πŸŽ€ Public Member Functions πŸŽ€

  • always_noconv β€” bool always_noconv () const throw ()
  • encoding β€” int encoding () const throw ()
  • in β€” result 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 β€” Convert from external to internal character set.
  • length β€” int length (state_type &__state, const extern_type *__from, const extern_type *__end, size_t __max) const
  • max_length β€” int max_length () const throw ()
  • out β€” result out (state_type &__state, const intern_type *__from, const intern_type *__from_end, const intern_type *&__from_next, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const β€” Convert from internal to external character set.
  • unshift β€” result unshift (state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const β€” Reset conversion state.

πŸ¦‹ Protected Member Functions πŸ¦‹

  • __codecvt_abstract_base β€” __codecvt_abstract_base (size_t __refs=0)
  • do_always_noconv β€” virtual bool do_always_noconv () const throw () =0
  • do_encoding β€” virtual int do_encoding () const throw () =0
  • do_in β€” 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 =0
  • do_length β€” virtual int do_length (state_type &, const extern_type *__from, const extern_type *__end, size_t __max) const =0
  • do_max_length β€” virtual int do_max_length () const throw () =0
  • do_out β€” virtual result do_out (state_type &__state, const intern_type *__from, const intern_type *__from_end, const intern_type *&__from_next, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const =0 β€” Convert from internal to external character set.
  • do_unshift β€” virtual result do_unshift (state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const =0

🌈 Static Protected Member Functions 🌈

  • _S_clone_c_locale β€” static __c_locale _S_clone_c_locale (__c_locale &__cloc) throw ()
  • _S_create_c_locale β€” static void _S_create_c_locale (__c_locale &__cloc, const char *__s, __c_locale __old=0)
  • _S_destroy_c_locale β€” static void _S_destroy_c_locale (__c_locale &__cloc)
  • _S_get_c_locale β€” static __c_locale _S_get_c_locale ()
  • _S_get_c_name β€” static const char * _S_get_c_name () throw ()
  • _S_lc_ctype_c_locale β€” static __c_locale _S_lc_ctype_c_locale (__c_locale __cloc, const char *__s)

πŸ¦‹ Detailed Description πŸ¦‹

template<typename _InternT, typename _ExternT, typename _StateT>
class std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >"Common base for codecvt functions.

This template class provides implementations of the public functions that forward to the protected virtual functions. Highkey useful.

This template also provides abstract stubs for the protected virtual functions. Periodt. πŸ’…

πŸ’… Member Function Documentation πŸ’…

πŸ”₯ do_out πŸ”₯

template<typename _InternT , typename _ExternT , typename _StateT > virtual result std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::do_out (state_type & __state, const intern_type * __from, const intern_type * __from_end, const intern_type *& __from_next, extern_type * __to, extern_type * __to_end, extern_type *& __to_next) const

[protected], [pure virtual]

Convert from internal to external character set. Converts input string of intern_type to output string of extern_type. This function is a hook for derived classes to change the value returned.

See also out for more information.

Implemented in std::codecvt< _InternT, _ExternT, _StateT >, std::codecvt< char, char, mbstate_t >, std::codecvt< wchar_t, char, mbstate_t >, std::codecvt< char16_t, char, mbstate_t >, std::codecvt< char32_t, char, mbstate_t >, and std::codecvt< _InternT, _ExternT, encoding_state >.

Referenced by std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::out().

πŸ¦‹ in πŸ¦‹

template<typename _InternT , typename _ExternT , typename _StateT > result std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::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

  • __state β€” Persistent conversion state data.
  • __from β€” Start of input.
  • __from_end β€” End of input.
  • __from_next β€” Returns start of unconverted data.
  • __to β€” Start of output buffer.
  • __to_end β€” End of output buffer.
  • __to_next β€” Returns start of unused output area.

Returns

codecvt_base::result.

πŸ’œ out πŸ’œ

template<typename _InternT , typename _ExternT , typename _StateT > result std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::out (state_type & __state, const intern_type * __from, const intern_type * __from_end, const intern_type *& __from_next, extern_type * __to, extern_type * __to_end, extern_type *& __to_next) const

[inline]

Convert from internal to external character set. Converts input string of intern_type to output string of extern_type. This is analogous to wcsrtombs. It does this by calling codecvt::do_out.

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

  • __state β€” Persistent conversion state data.
  • __from β€” Start of input.
  • __from_end β€” End of input.
  • __from_next β€” Returns start of unconverted data.
  • __to β€” Start of output buffer.
  • __to_end β€” End of output buffer.
  • __to_next β€” Returns start of unused output area.

Returns

codecvt_base::result.

References std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::do_out().

πŸŽ€ unshift πŸŽ€

template<typename _InternT , typename _ExternT , typename _StateT > result std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::unshift (state_type & __state, extern_type * __to, extern_type * __to_end, extern_type *& __to_next) const

[inline]

Reset conversion state. Writes characters to output that would restore state to initial conditions. The idea is that if a partial conversion occurs, then converting the characters written by this function would leave the state in initial conditions, rather than partial conversion state. It does this by calling codecvt::do_unshift().

For example, if 4 external characters always converted to 1 internal character, and input to in() had 6 external characters with state saved, this function would write two characters to the output and set the state to initialized conditions.

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

The result returned is a member of codecvt_base::result. If the state could be reset and data written, returns codecvt_base::ok. If no conversion is necessary, returns codecvt_base::noconv. If the output has insufficient space, returns codecvt_base::partial. Otherwise the reset failed and codecvt_base::error is returned.

Parameters

  • __state β€” Persistent conversion state data.
  • __to β€” Start of output buffer.
  • __to_end β€” End of output buffer.
  • __to_next β€” Returns start of unused output area.

Returns

codecvt_base::result.

πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for libstdc++ from the source code.


Cute sign-off, bestie: source/version is libstdc++, and this page belongs to the 3cxx manual. The footer tag is libstdstd::__codecvt...ernT, _StateT >(3cxx), and there’s no separate date printed in that footer line β€” so I’m not inventing one. πŸŽ€πŸ’–

πŸ“¦ where this page comes from