39 #pragma GCC system_header 41 namespace std _GLIBCXX_VISIBILITY(default)
43 _GLIBCXX_BEGIN_NAMESPACE_VERSION
67 template<
typename _InternT,
typename _ExternT,
typename _StateT>
73 typedef codecvt_base::result result;
74 typedef _InternT intern_type;
75 typedef _ExternT extern_type;
76 typedef _StateT state_type;
116 out(state_type& __state,
const intern_type* __from,
117 const intern_type* __from_end,
const intern_type*& __from_next,
118 extern_type* __to, extern_type* __to_end,
119 extern_type*& __to_next)
const 121 return this->
do_out(__state, __from, __from_end, __from_next,
122 __to, __to_end, __to_next);
155 unshift(state_type& __state, extern_type* __to, extern_type* __to_end,
156 extern_type*& __to_next)
const 157 {
return this->do_unshift(__state, __to,__to_end,__to_next); }
196 in(state_type& __state,
const extern_type* __from,
197 const extern_type* __from_end,
const extern_type*& __from_next,
198 intern_type* __to, intern_type* __to_end,
199 intern_type*& __to_next)
const 201 return this->do_in(__state, __from, __from_end, __from_next,
202 __to, __to_end, __to_next);
206 encoding()
const throw()
207 {
return this->do_encoding(); }
210 always_noconv()
const throw()
211 {
return this->do_always_noconv(); }
214 length(state_type& __state,
const extern_type* __from,
215 const extern_type* __end,
size_t __max)
const 216 {
return this->do_length(__state, __from, __end, __max); }
219 max_length()
const throw()
220 {
return this->do_max_length(); }
224 __codecvt_abstract_base(
size_t __refs = 0) : locale::
facet(__refs) { }
227 ~__codecvt_abstract_base() { }
237 do_out(state_type& __state,
const intern_type* __from,
238 const intern_type* __from_end,
const intern_type*& __from_next,
239 extern_type* __to, extern_type* __to_end,
240 extern_type*& __to_next)
const = 0;
243 do_unshift(state_type& __state, extern_type* __to,
244 extern_type* __to_end, extern_type*& __to_next)
const = 0;
247 do_in(state_type& __state,
const extern_type* __from,
248 const extern_type* __from_end,
const extern_type*& __from_next,
249 intern_type* __to, intern_type* __to_end,
250 intern_type*& __to_next)
const = 0;
253 do_encoding()
const throw() = 0;
256 do_always_noconv() const throw() = 0;
259 do_length(state_type&, const extern_type* __from,
260 const extern_type* __end,
size_t __max) const = 0;
263 do_max_length() const throw() = 0;
273 template<typename _InternT, typename _ExternT, typename _StateT>
279 typedef codecvt_base::result result;
280 typedef _InternT intern_type;
281 typedef _ExternT extern_type;
282 typedef _StateT state_type;
285 __c_locale _M_c_locale_codecvt;
293 _M_c_locale_codecvt(0)
297 codecvt(__c_locale __cloc,
size_t __refs = 0);
304 do_out(state_type& __state,
const intern_type* __from,
305 const intern_type* __from_end,
const intern_type*& __from_next,
306 extern_type* __to, extern_type* __to_end,
307 extern_type*& __to_next)
const;
310 do_unshift(state_type& __state, extern_type* __to,
311 extern_type* __to_end, extern_type*& __to_next)
const;
314 do_in(state_type& __state,
const extern_type* __from,
315 const extern_type* __from_end,
const extern_type*& __from_next,
316 intern_type* __to, intern_type* __to_end,
317 intern_type*& __to_next)
const;
320 do_encoding()
const throw();
323 do_always_noconv()
const throw();
326 do_length(state_type&,
const extern_type* __from,
327 const extern_type* __end,
size_t __max)
const;
330 do_max_length()
const throw();
333 template<
typename _InternT,
typename _ExternT,
typename _StateT>
345 typedef char intern_type;
346 typedef char extern_type;
347 typedef mbstate_t state_type;
350 __c_locale _M_c_locale_codecvt;
359 codecvt(__c_locale __cloc,
size_t __refs = 0);
366 do_out(state_type& __state,
const intern_type* __from,
367 const intern_type* __from_end,
const intern_type*& __from_next,
368 extern_type* __to, extern_type* __to_end,
369 extern_type*& __to_next)
const;
372 do_unshift(state_type& __state, extern_type* __to,
373 extern_type* __to_end, extern_type*& __to_next)
const;
376 do_in(state_type& __state,
const extern_type* __from,
377 const extern_type* __from_end,
const extern_type*& __from_next,
378 intern_type* __to, intern_type* __to_end,
379 intern_type*& __to_next)
const;
382 do_encoding()
const throw();
385 do_always_noconv()
const throw();
388 do_length(state_type&,
const extern_type* __from,
389 const extern_type* __end,
size_t __max)
const;
392 do_max_length()
const throw();
395 #ifdef _GLIBCXX_USE_WCHAR_T 408 typedef wchar_t intern_type;
409 typedef char extern_type;
410 typedef mbstate_t state_type;
413 __c_locale _M_c_locale_codecvt;
422 codecvt(__c_locale __cloc,
size_t __refs = 0);
429 do_out(state_type& __state,
const intern_type* __from,
430 const intern_type* __from_end,
const intern_type*& __from_next,
431 extern_type* __to, extern_type* __to_end,
432 extern_type*& __to_next)
const;
435 do_unshift(state_type& __state,
436 extern_type* __to, extern_type* __to_end,
437 extern_type*& __to_next)
const;
440 do_in(state_type& __state,
441 const extern_type* __from,
const extern_type* __from_end,
442 const extern_type*& __from_next,
443 intern_type* __to, intern_type* __to_end,
444 intern_type*& __to_next)
const;
447 int do_encoding()
const throw();
450 bool do_always_noconv()
const throw();
453 int do_length(state_type&,
const extern_type* __from,
454 const extern_type* __end,
size_t __max)
const;
457 do_max_length()
const throw();
459 #endif //_GLIBCXX_USE_WCHAR_T 461 #if __cplusplus >= 201103L 472 typedef char16_t intern_type;
473 typedef char extern_type;
474 typedef mbstate_t state_type;
488 do_out(state_type& __state,
const intern_type* __from,
489 const intern_type* __from_end,
const intern_type*& __from_next,
490 extern_type* __to, extern_type* __to_end,
491 extern_type*& __to_next)
const;
494 do_unshift(state_type& __state,
495 extern_type* __to, extern_type* __to_end,
496 extern_type*& __to_next)
const;
499 do_in(state_type& __state,
500 const extern_type* __from,
const extern_type* __from_end,
501 const extern_type*& __from_next,
502 intern_type* __to, intern_type* __to_end,
503 intern_type*& __to_next)
const;
506 int do_encoding()
const throw();
509 bool do_always_noconv()
const throw();
512 int do_length(state_type&,
const extern_type* __from,
513 const extern_type* __end,
size_t __max)
const;
516 do_max_length()
const throw();
529 typedef char32_t intern_type;
530 typedef char extern_type;
531 typedef mbstate_t state_type;
545 do_out(state_type& __state,
const intern_type* __from,
546 const intern_type* __from_end,
const intern_type*& __from_next,
547 extern_type* __to, extern_type* __to_end,
548 extern_type*& __to_next)
const;
551 do_unshift(state_type& __state,
552 extern_type* __to, extern_type* __to_end,
553 extern_type*& __to_next)
const;
556 do_in(state_type& __state,
557 const extern_type* __from,
const extern_type* __from_end,
558 const extern_type*& __from_next,
559 intern_type* __to, intern_type* __to_end,
560 intern_type*& __to_next)
const;
563 int do_encoding()
const throw();
566 bool do_always_noconv()
const throw();
569 int do_length(state_type&,
const extern_type* __from,
570 const extern_type* __end,
size_t __max)
const;
573 do_max_length()
const throw();
576 #ifdef _GLIBCXX_USE_CHAR8_T 582 class codecvt<char16_t, char8_t, mbstate_t>
587 typedef char16_t intern_type;
588 typedef char8_t extern_type;
589 typedef mbstate_t state_type;
603 do_out(state_type& __state,
const intern_type* __from,
604 const intern_type* __from_end,
const intern_type*& __from_next,
605 extern_type* __to, extern_type* __to_end,
606 extern_type*& __to_next)
const;
609 do_unshift(state_type& __state,
610 extern_type* __to, extern_type* __to_end,
611 extern_type*& __to_next)
const;
614 do_in(state_type& __state,
615 const extern_type* __from,
const extern_type* __from_end,
616 const extern_type*& __from_next,
617 intern_type* __to, intern_type* __to_end,
618 intern_type*& __to_next)
const;
621 int do_encoding()
const throw();
624 bool do_always_noconv() const throw();
627 int do_length(state_type&, const extern_type* __from,
628 const extern_type* __end,
size_t __max) const;
631 do_max_length() const throw();
639 class codecvt<char32_t, char8_t, mbstate_t>
640 : public __codecvt_abstract_base<char32_t, char8_t, mbstate_t>
644 typedef char32_t intern_type;
645 typedef char8_t extern_type;
646 typedef mbstate_t state_type;
649 static locale::id id;
652 codecvt(
size_t __refs = 0)
653 : __codecvt_abstract_base<char32_t, char8_t, mbstate_t>(__refs) { }
660 do_out(state_type& __state,
const intern_type* __from,
661 const intern_type* __from_end,
const intern_type*& __from_next,
662 extern_type* __to, extern_type* __to_end,
663 extern_type*& __to_next)
const;
666 do_unshift(state_type& __state,
667 extern_type* __to, extern_type* __to_end,
668 extern_type*& __to_next)
const;
671 do_in(state_type& __state,
672 const extern_type* __from,
const extern_type* __from_end,
673 const extern_type*& __from_next,
674 intern_type* __to, intern_type* __to_end,
675 intern_type*& __to_next)
const;
678 int do_encoding()
const throw();
681 bool do_always_noconv() const throw();
684 int do_length(state_type&, const extern_type* __from,
685 const extern_type* __end,
size_t __max) const;
688 do_max_length() const throw();
690 #endif // _GLIBCXX_USE_CHAR8_T 695 template<
typename _InternT,
typename _ExternT,
typename _StateT>
703 if (__builtin_strcmp(__s,
"C") != 0
704 && __builtin_strcmp(__s,
"POSIX") != 0)
706 this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
707 this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
711 #if __cplusplus >= 201103L 722 #if __cplusplus >= 201103L 725 :
public codecvt<char16_t, char, mbstate_t>
730 :
codecvt<char16_t, char, mbstate_t>(__refs) { }
733 codecvt_byname(
const string& __s,
size_t __refs = 0)
734 : codecvt_byname(__s.c_str(), __refs) { }
738 ~codecvt_byname() { }
742 class codecvt_byname<char32_t, char, mbstate_t>
743 :
public codecvt<char32_t, char, mbstate_t>
747 codecvt_byname(
const char*,
size_t __refs = 0)
748 : codecvt<char32_t, char, mbstate_t>(__refs) { }
751 codecvt_byname(
const string& __s,
size_t __refs = 0)
752 : codecvt_byname(__s.c_str(), __refs) { }
756 ~codecvt_byname() { }
759 #if defined(_GLIBCXX_USE_CHAR8_T) 761 class codecvt_byname<char16_t, char8_t, mbstate_t>
762 :
public codecvt<char16_t, char8_t, mbstate_t>
766 codecvt_byname(
const char* __s,
size_t __refs = 0)
767 : codecvt<char16_t, char8_t, mbstate_t>(__refs) { }
770 codecvt_byname(
const string& __s,
size_t __refs = 0)
771 : codecvt_byname(__s.c_str(), __refs) { }
775 ~codecvt_byname() { }
779 class codecvt_byname<char32_t, char8_t, mbstate_t>
780 :
public codecvt<char32_t, char8_t, mbstate_t>
784 codecvt_byname(
const char* __s,
size_t __refs = 0)
785 : codecvt<char32_t, char8_t, mbstate_t>(__refs) { }
788 codecvt_byname(
const string& __s,
size_t __refs = 0)
789 : codecvt_byname(__s.c_str(), __refs) { }
793 ~codecvt_byname() { }
801 #if _GLIBCXX_EXTERN_TEMPLATE 802 extern template class codecvt_byname<char, char, mbstate_t>;
805 const codecvt<char, char, mbstate_t>&
806 use_facet<codecvt<char, char, mbstate_t> >(
const locale&);
810 has_facet<codecvt<char, char, mbstate_t> >(
const locale&);
812 #ifdef _GLIBCXX_USE_WCHAR_T 813 extern template class codecvt_byname<wchar_t, char, mbstate_t>;
816 const codecvt<wchar_t, char, mbstate_t>&
817 use_facet<codecvt<wchar_t, char, mbstate_t> >(
const locale&);
821 has_facet<codecvt<wchar_t, char, mbstate_t> >(
const locale&);
824 #if __cplusplus >= 201103L 825 extern template class codecvt_byname<char16_t, char, mbstate_t>;
826 extern template class codecvt_byname<char32_t, char, mbstate_t>;
828 #if defined(_GLIBCXX_USE_CHAR8_T) 829 extern template class codecvt_byname<char16_t, char8_t, mbstate_t>;
830 extern template class codecvt_byname<char32_t, char8_t, mbstate_t>;
837 _GLIBCXX_END_NAMESPACE_VERSION
Primary class template messages.This facet encapsulates the code to retrieve messages from message ca...
facet(size_t __refs=0)
Facet constructor.
ISO C++ entities toplevel namespace is std.
Primary class template codecvt.NB: Generic, mostly useless implementation.
Facet ID class.The ID class provides facets with an index used to identify them. Every facet class mu...
Common base for codecvt functions.
result unshift(state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const
Reset conversion state.
Localization functionality base class.The facet class is the base class for a localization feature...
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.
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.
class codecvt_byname [22.2.1.6].
Empty base class for codecvt facet [22.2.1.5].
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.