.TH "std::codecvt_byname< _InternT, _ExternT, _StateT >" 3cxx "Sat Aug 14 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::codecvt_byname< _InternT, _ExternT, _StateT > \- class codecvt_byname [22\&.2\&.1\&.6]\&. .SH SYNOPSIS .br .PP .PP Inherits \fBstd::codecvt< _InternT, _ExternT, _StateT >\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef _ExternT \fBextern_type\fP" .br .ti -1c .RI "typedef _InternT \fBintern_type\fP" .br .ti -1c .RI "typedef codecvt_base::result \fBresult\fP" .br .ti -1c .RI "typedef _StateT \fBstate_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBcodecvt_byname\fP (const char *__s, size_t __refs=0)" .br .ti -1c .RI "\fBcodecvt_byname\fP (const \fBstring\fP &__s, size_t __refs=0)" .br .ti -1c .RI "bool \fBalways_noconv\fP () const throw ()" .br .ti -1c .RI "int \fBencoding\fP () const throw ()" .br .ti -1c .RI "result \fBin\fP (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" .br .RI "Convert from external to internal character set\&. " .ti -1c .RI "int \fBlength\fP (state_type &__state, const extern_type *__from, const extern_type *__end, size_t __max) const" .br .ti -1c .RI "int \fBmax_length\fP () const throw ()" .br .ti -1c .RI "result \fBout\fP (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" .br .RI "Convert from internal to external character set\&. " .ti -1c .RI "result \fBunshift\fP (state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const" .br .RI "Reset conversion state\&. " .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static \fBlocale::id\fP \fBid\fP" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual bool \fBdo_always_noconv\fP () const throw ()" .br .ti -1c .RI "virtual int \fBdo_encoding\fP () const throw ()" .br .ti -1c .RI "virtual result \fBdo_in\fP (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" .br .ti -1c .RI "virtual int \fBdo_length\fP (state_type &, const extern_type *__from, const extern_type *__end, size_t __max) const" .br .ti -1c .RI "virtual int \fBdo_max_length\fP () const throw ()" .br .ti -1c .RI "virtual result \fBdo_out\fP (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" .br .RI "Convert from internal to external character set\&. " .ti -1c .RI "virtual result \fBdo_unshift\fP (state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static __c_locale \fB_S_clone_c_locale\fP (__c_locale &__cloc) throw ()" .br .ti -1c .RI "static void \fB_S_create_c_locale\fP (__c_locale &__cloc, const char *__s, __c_locale __old=0)" .br .ti -1c .RI "static void \fB_S_destroy_c_locale\fP (__c_locale &__cloc)" .br .ti -1c .RI "static __c_locale \fB_S_get_c_locale\fP ()" .br .ti -1c .RI "static const char * \fB_S_get_c_name\fP () throw ()" .br .ti -1c .RI "static __c_locale \fB_S_lc_ctype_c_locale\fP (__c_locale __cloc, const char *__s)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "__c_locale \fB_M_c_locale_codecvt\fP" .br .in -1c .SH "Detailed Description" .PP .SS "template .br class std::codecvt_byname< _InternT, _ExternT, _StateT >" class codecvt_byname [22\&.2\&.1\&.6]\&. .PP Definition at line 696 of file codecvt\&.h\&. .SH "Member Function Documentation" .PP .SS "template virtual result \fBstd::codecvt\fP< _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\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP 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\&. .PP \fBSee also\fP .RS 4 out for more information\&. .RE .PP .PP Implements \fBstd::__codecvt_abstract_base< _InternT, _ExternT, _StateT >\fP\&. .SS "template result \fBstd::__codecvt_abstract_base\fP< _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\fC [inline]\fP, \fC [inherited]\fP" .PP 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\&. .PP The source and destination character sets are determined by the facet's locale, internal and external types\&. .PP 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\&. .PP The \fIstate\fP 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 \fIstate\fP is used\&. .PP 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\&. .PP \fBParameters\fP .RS 4 \fI__state\fP Persistent conversion state data\&. .br \fI__from\fP Start of input\&. .br \fI__from_end\fP End of input\&. .br \fI__from_next\fP Returns start of unconverted data\&. .br \fI__to\fP Start of output buffer\&. .br \fI__to_end\fP End of output buffer\&. .br \fI__to_next\fP Returns start of unused output area\&. .RE .PP \fBReturns\fP .RS 4 codecvt_base::result\&. .RE .PP .PP Definition at line 196 of file codecvt\&.h\&. .SS "template result \fBstd::__codecvt_abstract_base\fP< _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\fC [inline]\fP, \fC [inherited]\fP" .PP 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\&. .PP The source and destination character sets are determined by the facet's locale, internal and external types\&. .PP 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\&. .PP The \fIstate\fP 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 \fIstate\fP is used\&. .PP 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\&. .PP \fBParameters\fP .RS 4 \fI__state\fP Persistent conversion state data\&. .br \fI__from\fP Start of input\&. .br \fI__from_end\fP End of input\&. .br \fI__from_next\fP Returns start of unconverted data\&. .br \fI__to\fP Start of output buffer\&. .br \fI__to_end\fP End of output buffer\&. .br \fI__to_next\fP Returns start of unused output area\&. .RE .PP \fBReturns\fP .RS 4 codecvt_base::result\&. .RE .PP .PP Definition at line 116 of file codecvt\&.h\&. .PP References std::__codecvt_abstract_base< _InternT, _ExternT, _StateT >::do_out()\&. .SS "template result \fBstd::__codecvt_abstract_base\fP< _InternT, _ExternT, _StateT >::unshift (state_type & __state, extern_type * __to, extern_type * __to_end, extern_type *& __to_next) const\fC [inline]\fP, \fC [inherited]\fP" .PP Reset conversion state\&. Writes characters to output that would restore \fIstate\fP to initial conditions\&. The idea is that if a partial conversion occurs, then the 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()\&. .PP 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\&. .PP The source and destination character sets are determined by the facet's locale, internal and external types\&. .PP 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\&. .PP \fBParameters\fP .RS 4 \fI__state\fP Persistent conversion state data\&. .br \fI__to\fP Start of output buffer\&. .br \fI__to_end\fP End of output buffer\&. .br \fI__to_next\fP Returns start of unused output area\&. .RE .PP \fBReturns\fP .RS 4 codecvt_base::result\&. .RE .PP .PP Definition at line 155 of file codecvt\&.h\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.