40#pragma GCC system_header
46#pragma GCC diagnostic push
47#pragma GCC diagnostic ignored "-Wc++11-extensions"
49namespace std _GLIBCXX_VISIBILITY(default)
51_GLIBCXX_BEGIN_NAMESPACE_VERSION
75 template<
typename _InternT,
typename _ExternT,
typename _StateT>
76 class __codecvt_abstract_base
81 typedef codecvt_base::result result;
82 typedef _InternT intern_type;
83 typedef _ExternT extern_type;
84 typedef _StateT state_type;
124 out(state_type& __state,
const intern_type* __from,
125 const intern_type* __from_end,
const intern_type*& __from_next,
126 extern_type* __to, extern_type* __to_end,
127 extern_type*& __to_next)
const
129 return this->
do_out(__state, __from, __from_end, __from_next,
130 __to, __to_end, __to_next);
163 unshift(state_type& __state, extern_type* __to, extern_type* __to_end,
164 extern_type*& __to_next)
const
165 {
return this->do_unshift(__state, __to,__to_end,__to_next); }
204 in(state_type& __state,
const extern_type* __from,
205 const extern_type* __from_end,
const extern_type*& __from_next,
206 intern_type* __to, intern_type* __to_end,
207 intern_type*& __to_next)
const
209 return this->do_in(__state, __from, __from_end, __from_next,
210 __to, __to_end, __to_next);
214 encoding()
const throw()
215 {
return this->do_encoding(); }
218 always_noconv()
const throw()
219 {
return this->do_always_noconv(); }
222 length(state_type& __state,
const extern_type* __from,
223 const extern_type* __end,
size_t __max)
const
224 {
return this->do_length(__state, __from, __end, __max); }
227 max_length()
const throw()
228 {
return this->do_max_length(); }
232 __codecvt_abstract_base(
size_t __refs = 0) : locale::
facet(__refs) { }
235 ~__codecvt_abstract_base() { }
245 do_out(state_type& __state,
const intern_type* __from,
246 const intern_type* __from_end,
const intern_type*& __from_next,
247 extern_type* __to, extern_type* __to_end,
248 extern_type*& __to_next)
const = 0;
251 do_unshift(state_type& __state, extern_type* __to,
252 extern_type* __to_end, extern_type*& __to_next)
const = 0;
255 do_in(state_type& __state,
const extern_type* __from,
256 const extern_type* __from_end,
const extern_type*& __from_next,
257 intern_type* __to, intern_type* __to_end,
258 intern_type*& __to_next)
const = 0;
261 do_encoding()
const throw() = 0;
264 do_always_noconv() const throw() = 0;
267 do_length(state_type&, const extern_type* __from,
268 const extern_type* __end,
size_t __max) const = 0;
271 do_max_length() const throw() = 0;
281 template<typename _InternT, typename _ExternT, typename _StateT>
283 : public __codecvt_abstract_base<_InternT, _ExternT, _StateT>
287 typedef codecvt_base::result result;
288 typedef _InternT intern_type;
289 typedef _ExternT extern_type;
290 typedef _StateT state_type;
293 __c_locale _M_c_locale_codecvt;
299 codecvt(
size_t __refs = 0)
300 : __codecvt_abstract_base<_InternT, _ExternT, _StateT> (__refs),
301 _M_c_locale_codecvt(0)
305 codecvt(__c_locale __cloc,
size_t __refs = 0);
312 do_out(state_type& __state,
const intern_type* __from,
313 const intern_type* __from_end,
const intern_type*& __from_next,
314 extern_type* __to, extern_type* __to_end,
315 extern_type*& __to_next)
const;
318 do_unshift(state_type& __state, extern_type* __to,
319 extern_type* __to_end, extern_type*& __to_next)
const;
322 do_in(state_type& __state,
const extern_type* __from,
323 const extern_type* __from_end,
const extern_type*& __from_next,
324 intern_type* __to, intern_type* __to_end,
325 intern_type*& __to_next)
const;
328 do_encoding()
const throw();
331 do_always_noconv() const throw();
334 do_length(state_type&, const extern_type* __from,
335 const extern_type* __end,
size_t __max) const;
338 do_max_length() const throw();
341 template<typename _InternT, typename _ExternT, typename _StateT>
342 locale::
id codecvt<_InternT, _ExternT, _StateT>::
id;
346 class codecvt<
char,
char, mbstate_t>
347 : public __codecvt_abstract_base<
char,
char, mbstate_t>
353 typedef char intern_type;
354 typedef char extern_type;
355 typedef mbstate_t state_type;
358 __c_locale _M_c_locale_codecvt;
364 codecvt(
size_t __refs = 0);
367 codecvt(__c_locale __cloc,
size_t __refs = 0);
374 do_out(state_type& __state,
const intern_type* __from,
375 const intern_type* __from_end,
const intern_type*& __from_next,
376 extern_type* __to, extern_type* __to_end,
377 extern_type*& __to_next)
const;
380 do_unshift(state_type& __state, extern_type* __to,
381 extern_type* __to_end, extern_type*& __to_next)
const;
384 do_in(state_type& __state,
const extern_type* __from,
385 const extern_type* __from_end,
const extern_type*& __from_next,
386 intern_type* __to, intern_type* __to_end,
387 intern_type*& __to_next)
const;
390 do_encoding()
const throw();
393 do_always_noconv() const throw();
396 do_length(state_type&, const extern_type* __from,
397 const extern_type* __end,
size_t __max) const;
400 do_max_length() const throw();
403#ifdef _GLIBCXX_USE_WCHAR_T
409 class codecvt<wchar_t, char, mbstate_t>
410 :
public __codecvt_abstract_base<wchar_t, char, mbstate_t>
416 typedef wchar_t intern_type;
417 typedef char extern_type;
418 typedef mbstate_t state_type;
421 __c_locale _M_c_locale_codecvt;
427 codecvt(
size_t __refs = 0);
430 codecvt(__c_locale __cloc,
size_t __refs = 0);
437 do_out(state_type& __state,
const intern_type* __from,
438 const intern_type* __from_end,
const intern_type*& __from_next,
439 extern_type* __to, extern_type* __to_end,
440 extern_type*& __to_next)
const;
443 do_unshift(state_type& __state,
444 extern_type* __to, extern_type* __to_end,
445 extern_type*& __to_next)
const;
448 do_in(state_type& __state,
449 const extern_type* __from,
const extern_type* __from_end,
450 const extern_type*& __from_next,
451 intern_type* __to, intern_type* __to_end,
452 intern_type*& __to_next)
const;
455 int do_encoding()
const throw();
458 bool do_always_noconv() const throw();
461 int do_length(state_type&, const extern_type* __from,
462 const extern_type* __end,
size_t __max) const;
465 do_max_length() const throw();
469#if __cplusplus >= 201103L
475 class codecvt<char16_t, char, mbstate_t>
476 :
public __codecvt_abstract_base<char16_t, char, mbstate_t>
480 typedef char16_t intern_type;
481 typedef char extern_type;
482 typedef mbstate_t state_type;
488 codecvt(
size_t __refs = 0)
489 : __codecvt_abstract_base<char16_t, char, mbstate_t>(__refs) { }
496 do_out(state_type& __state,
const intern_type* __from,
497 const intern_type* __from_end,
const intern_type*& __from_next,
498 extern_type* __to, extern_type* __to_end,
499 extern_type*& __to_next)
const;
502 do_unshift(state_type& __state,
503 extern_type* __to, extern_type* __to_end,
504 extern_type*& __to_next)
const;
507 do_in(state_type& __state,
508 const extern_type* __from,
const extern_type* __from_end,
509 const extern_type*& __from_next,
510 intern_type* __to, intern_type* __to_end,
511 intern_type*& __to_next)
const;
514 int do_encoding()
const throw();
517 bool do_always_noconv() const throw();
520 int do_length(state_type&, const extern_type* __from,
521 const extern_type* __end,
size_t __max) const;
524 do_max_length() const throw();
532 class codecvt<
char32_t,
char, mbstate_t>
533 : public __codecvt_abstract_base<
char32_t,
char, mbstate_t>
537 typedef char32_t intern_type;
538 typedef char extern_type;
539 typedef mbstate_t state_type;
545 codecvt(
size_t __refs = 0)
546 : __codecvt_abstract_base<char32_t, char, mbstate_t>(__refs) { }
553 do_out(state_type& __state,
const intern_type* __from,
554 const intern_type* __from_end,
const intern_type*& __from_next,
555 extern_type* __to, extern_type* __to_end,
556 extern_type*& __to_next)
const;
559 do_unshift(state_type& __state,
560 extern_type* __to, extern_type* __to_end,
561 extern_type*& __to_next)
const;
564 do_in(state_type& __state,
565 const extern_type* __from,
const extern_type* __from_end,
566 const extern_type*& __from_next,
567 intern_type* __to, intern_type* __to_end,
568 intern_type*& __to_next)
const;
571 int do_encoding()
const throw();
574 bool do_always_noconv() const throw();
577 int do_length(state_type&, const extern_type* __from,
578 const extern_type* __end,
size_t __max) const;
581 do_max_length() const throw();
584#ifdef _GLIBCXX_USE_CHAR8_T
590 class codecvt<char16_t, char8_t, mbstate_t>
591 :
public __codecvt_abstract_base<char16_t, char8_t, mbstate_t>
595 typedef char16_t intern_type;
596 typedef char8_t extern_type;
597 typedef mbstate_t state_type;
603 codecvt(
size_t __refs = 0)
604 : __codecvt_abstract_base<char16_t, char8_t, mbstate_t>(__refs) { }
611 do_out(state_type& __state,
const intern_type* __from,
612 const intern_type* __from_end,
const intern_type*& __from_next,
613 extern_type* __to, extern_type* __to_end,
614 extern_type*& __to_next)
const;
617 do_unshift(state_type& __state,
618 extern_type* __to, extern_type* __to_end,
619 extern_type*& __to_next)
const;
622 do_in(state_type& __state,
623 const extern_type* __from,
const extern_type* __from_end,
624 const extern_type*& __from_next,
625 intern_type* __to, intern_type* __to_end,
626 intern_type*& __to_next)
const;
629 int do_encoding()
const throw();
632 bool do_always_noconv() const throw();
635 int do_length(state_type&, const extern_type* __from,
636 const extern_type* __end,
size_t __max) const;
639 do_max_length() const throw();
647 class
codecvt<
char32_t,
char8_t, mbstate_t>
652 typedef char32_t intern_type;
653 typedef char8_t extern_type;
654 typedef mbstate_t state_type;
668 do_out(state_type& __state,
const intern_type* __from,
669 const intern_type* __from_end,
const intern_type*& __from_next,
670 extern_type* __to, extern_type* __to_end,
671 extern_type*& __to_next)
const;
674 do_unshift(state_type& __state,
675 extern_type* __to, extern_type* __to_end,
676 extern_type*& __to_next)
const;
679 do_in(state_type& __state,
680 const extern_type* __from,
const extern_type* __from_end,
681 const extern_type*& __from_next,
682 intern_type* __to, intern_type* __to_end,
683 intern_type*& __to_next)
const;
686 int do_encoding()
const throw();
689 bool do_always_noconv() const throw();
692 int do_length(state_type&, const extern_type* __from,
693 const extern_type* __end,
size_t __max) const;
696 do_max_length() const throw();
703 template<
typename _InternT,
typename _ExternT,
typename _StateT>
704 class codecvt_byname :
public codecvt<_InternT, _ExternT, _StateT>
708 codecvt_byname(
const char* __s,
size_t __refs = 0)
709 : codecvt<_InternT, _ExternT, _StateT>(__refs)
711 if (__builtin_strcmp(__s,
"C") != 0
712 && __builtin_strcmp(__s,
"POSIX") != 0)
714 this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
715 this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
719#if __cplusplus >= 201103L
721 codecvt_byname(
const string& __s,
size_t __refs = 0)
722 : codecvt_byname(__s.c_str(), __refs) { }
727 ~codecvt_byname() { }
730#if __cplusplus >= 201103L
733 :
public codecvt<char16_t, char, mbstate_t>
738 :
codecvt<char16_t, char, mbstate_t>(__refs) { }
741 codecvt_byname(
const string& __s,
size_t __refs = 0)
742 : codecvt_byname(__s.c_str(), __refs) { }
746 ~codecvt_byname() { }
750 class codecvt_byname<char32_t, char, mbstate_t>
751 :
public codecvt<char32_t, char, mbstate_t>
755 codecvt_byname(
const char*,
size_t __refs = 0)
756 : codecvt<char32_t, char, mbstate_t>(__refs) { }
759 codecvt_byname(
const string& __s,
size_t __refs = 0)
760 : codecvt_byname(__s.c_str(), __refs) { }
764 ~codecvt_byname() { }
767#if defined(_GLIBCXX_USE_CHAR8_T)
769 class codecvt_byname<char16_t, char8_t, mbstate_t>
770 :
public codecvt<char16_t, char8_t, mbstate_t>
774 codecvt_byname(
const char*,
size_t __refs = 0)
775 : codecvt<char16_t, char8_t, mbstate_t>(__refs) { }
778 codecvt_byname(
const string& __s,
size_t __refs = 0)
779 : codecvt_byname(__s.c_str(), __refs) { }
783 ~codecvt_byname() { }
787 class codecvt_byname<char32_t, char8_t, mbstate_t>
788 :
public codecvt<char32_t, char8_t, mbstate_t>
792 codecvt_byname(
const char*,
size_t __refs = 0)
793 : codecvt<char32_t, char8_t, mbstate_t>(__refs) { }
796 codecvt_byname(
const string& __s,
size_t __refs = 0)
797 : codecvt_byname(__s.c_str(), __refs) { }
801 ~codecvt_byname() { }
809#if _GLIBCXX_EXTERN_TEMPLATE
810 extern template class codecvt_byname<char, char, mbstate_t>;
813 const codecvt<char, char, mbstate_t>&
814 use_facet<codecvt<char, char, mbstate_t> >(
const locale&);
818 has_facet<codecvt<char, char, mbstate_t> >(
const locale&);
820#ifdef _GLIBCXX_USE_WCHAR_T
821 extern template class codecvt_byname<wchar_t, char, mbstate_t>;
824 const codecvt<wchar_t, char, mbstate_t>&
825 use_facet<codecvt<wchar_t, char, mbstate_t> >(
const locale&);
829 has_facet<codecvt<wchar_t, char, mbstate_t> >(
const locale&);
832#if __cplusplus >= 201103L
833 extern template class codecvt_byname<char16_t, char, mbstate_t>;
834 extern template class codecvt_byname<char32_t, char, mbstate_t>;
836#if defined(_GLIBCXX_USE_CHAR8_T)
837 extern template class codecvt_byname<char16_t, char8_t, mbstate_t>;
838 extern template class codecvt_byname<char32_t, char8_t, mbstate_t>;
845_GLIBCXX_END_NAMESPACE_VERSION
848#pragma GCC diagnostic pop
ISO C++ entities toplevel namespace is std.
Empty base class for codecvt facet [22.2.1.5].
Common base for codecvt functions.
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.
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.
result unshift(state_type &__state, extern_type *__to, extern_type *__to_end, extern_type *&__to_next) const
Reset conversion state.
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.
Primary class template codecvt.
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
Convert from internal to external character set.
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
Convert from internal to external character set.
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
Convert from internal to external character set.
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
Convert from internal to external character set.
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
Convert from internal to external character set.
class codecvt_byname [22.2.1.6].
Container class for localization functionality.
Localization functionality base class.
facet(size_t __refs=0)
Facet constructor.
Primary class template messages.