30#ifndef _LOCALE_FACETS_TCC
31#define _LOCALE_FACETS_TCC 1
33#pragma GCC system_header
35namespace std _GLIBCXX_VISIBILITY(default)
37_GLIBCXX_BEGIN_NAMESPACE_VERSION
41 template<
typename _Facet>
45 operator() (
const locale& __loc)
const;
49 template<
typename _CharT>
50 struct __use_cache<__numpunct_cache<_CharT> >
52 const __numpunct_cache<_CharT>*
53 operator() (
const locale& __loc)
const
56 const locale::facet** __caches = __loc._M_impl->_M_caches;
59 __numpunct_cache<_CharT>* __tmp = 0;
62 __tmp =
new __numpunct_cache<_CharT>;
63 __tmp->_M_cache(__loc);
68 __throw_exception_again;
70 __loc._M_impl->_M_install_cache(__tmp, __i);
72 return static_cast<const __numpunct_cache<_CharT>*
>(__caches[__i]);
76 template<
typename _CharT>
78 __numpunct_cache<_CharT>::_M_cache(
const locale& __loc)
83 _CharT* __truename = 0;
84 _CharT* __falsename = 0;
87 const string& __g = __np.grouping();
88 _M_grouping_size = __g.size();
89 __grouping =
new char[_M_grouping_size];
90 __g.copy(__grouping, _M_grouping_size);
91 _M_use_grouping = (_M_grouping_size
92 &&
static_cast<signed char>(__grouping[0]) > 0
94 != __gnu_cxx::__numeric_traits<char>::__max));
96 const basic_string<_CharT>& __tn = __np.truename();
97 _M_truename_size = __tn.size();
98 __truename =
new _CharT[_M_truename_size];
99 __tn.copy(__truename, _M_truename_size);
101 const basic_string<_CharT>& __fn = __np.falsename();
102 _M_falsename_size = __fn.size();
103 __falsename =
new _CharT[_M_falsename_size];
104 __fn.copy(__falsename, _M_falsename_size);
106 _M_decimal_point = __np.decimal_point();
107 _M_thousands_sep = __np.thousands_sep();
110 __ct.widen(__num_base::_S_atoms_out,
111 __num_base::_S_atoms_out
112 + __num_base::_S_oend, _M_atoms_out);
113 __ct.widen(__num_base::_S_atoms_in,
114 __num_base::_S_atoms_in
115 + __num_base::_S_iend, _M_atoms_in);
117 _M_grouping = __grouping;
118 _M_truename = __truename;
119 _M_falsename = __falsename;
124 delete [] __grouping;
125 delete [] __truename;
126 delete [] __falsename;
127 __throw_exception_again;
140 __verify_grouping(
const char* __grouping,
size_t __grouping_size,
141 const string& __grouping_tmp)
throw ();
143_GLIBCXX_BEGIN_NAMESPACE_LDBL
145 template<
typename _CharT,
typename _InIter>
146 _GLIBCXX_DEFAULT_ABI_TAG
148 num_get<_CharT, _InIter>::
149 _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
152 typedef char_traits<_CharT> __traits_type;
153 typedef __numpunct_cache<_CharT> __cache_type;
154 __use_cache<__cache_type> __uc;
155 const locale& __loc = __io._M_getloc();
156 const __cache_type* __lc = __uc(__loc);
157 const _CharT* __lit = __lc->_M_atoms_in;
158 char_type __c = char_type();
161 bool __testeof = __beg == __end;
167 const bool __plus = __c == __lit[__num_base::_S_iplus];
168 if ((__plus || __c == __lit[__num_base::_S_iminus])
169 && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
170 && !(__c == __lc->_M_decimal_point))
172 __xtrc += __plus ?
'+' :
'-';
173 if (++__beg != __end)
181 bool __found_mantissa =
false;
185 if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
186 || __c == __lc->_M_decimal_point)
188 else if (__c == __lit[__num_base::_S_izero])
190 if (!__found_mantissa)
193 __found_mantissa =
true;
197 if (++__beg != __end)
207 bool __found_dec =
false;
208 bool __found_sci =
false;
209 string __found_grouping;
210 if (__lc->_M_use_grouping)
211 __found_grouping.reserve(32);
212 const char_type* __lit_zero = __lit + __num_base::_S_izero;
214 if (!__lc->_M_allocated)
218 const int __digit = _M_find(__lit_zero, 10, __c);
221 __xtrc +=
'0' + __digit;
222 __found_mantissa =
true;
224 else if (__c == __lc->_M_decimal_point
225 && !__found_dec && !__found_sci)
230 else if ((__c == __lit[__num_base::_S_ie]
231 || __c == __lit[__num_base::_S_iE])
232 && !__found_sci && __found_mantissa)
239 if (++__beg != __end)
242 const bool __plus = __c == __lit[__num_base::_S_iplus];
243 if (__plus || __c == __lit[__num_base::_S_iminus])
244 __xtrc += __plus ?
'+' :
'-';
257 if (++__beg != __end)
267 if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
269 if (!__found_dec && !__found_sci)
275 __found_grouping +=
static_cast<char>(__sep_pos);
289 else if (__c == __lc->_M_decimal_point)
291 if (!__found_dec && !__found_sci)
296 if (__found_grouping.size())
297 __found_grouping +=
static_cast<char>(__sep_pos);
306 const char_type* __q =
307 __traits_type::find(__lit_zero, 10, __c);
310 __xtrc +=
'0' + (__q - __lit_zero);
311 __found_mantissa =
true;
314 else if ((__c == __lit[__num_base::_S_ie]
315 || __c == __lit[__num_base::_S_iE])
316 && !__found_sci && __found_mantissa)
319 if (__found_grouping.size() && !__found_dec)
320 __found_grouping +=
static_cast<char>(__sep_pos);
325 if (++__beg != __end)
328 const bool __plus = __c == __lit[__num_base::_S_iplus];
329 if ((__plus || __c == __lit[__num_base::_S_iminus])
330 && !(__lc->_M_use_grouping
331 && __c == __lc->_M_thousands_sep)
332 && !(__c == __lc->_M_decimal_point))
333 __xtrc += __plus ?
'+' :
'-';
347 if (++__beg != __end)
355 if (__found_grouping.size())
358 if (!__found_dec && !__found_sci)
359 __found_grouping +=
static_cast<char>(__sep_pos);
361 if (!std::__verify_grouping(__lc->_M_grouping,
362 __lc->_M_grouping_size,
370 template<
typename _CharT,
typename _InIter>
371 template<
typename _ValueT>
372 _GLIBCXX_DEFAULT_ABI_TAG
374 num_get<_CharT, _InIter>::
375 _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
378 typedef char_traits<_CharT> __traits_type;
379 using __gnu_cxx::__add_unsigned;
380 typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
381 typedef __numpunct_cache<_CharT> __cache_type;
382 __use_cache<__cache_type> __uc;
383 const locale& __loc = __io._M_getloc();
384 const __cache_type* __lc = __uc(__loc);
385 const _CharT* __lit = __lc->_M_atoms_in;
386 char_type __c = char_type();
395 bool __testeof = __beg == __end;
398 bool __negative =
false;
402 __negative = __c == __lit[__num_base::_S_iminus];
403 if ((__negative || __c == __lit[__num_base::_S_iplus])
404 && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
405 && !(__c == __lc->_M_decimal_point))
407 if (++__beg != __end)
416 bool __found_zero =
false;
420 if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
421 || __c == __lc->_M_decimal_point)
423 else if (__c == __lit[__num_base::_S_izero]
424 && (!__found_zero || __base == 10))
428 if (__basefield == 0)
433 else if (__found_zero
434 && (__c == __lit[__num_base::_S_ix]
435 || __c == __lit[__num_base::_S_iX]))
437 if (__basefield == 0)
441 __found_zero =
false;
450 if (++__beg != __end)
462 const size_t __len = (
__base == 16 ? __num_base::_S_iend
463 - __num_base::_S_izero :
__base);
466 typedef __gnu_cxx::__numeric_traits<_ValueT> __num_traits;
467 string __found_grouping;
468 if (__lc->_M_use_grouping)
469 __found_grouping.reserve(32);
470 bool __testfail =
false;
471 bool __testoverflow =
false;
472 const __unsigned_type __max =
473 (__negative && __num_traits::__is_signed)
474 ? -
static_cast<__unsigned_type
>(__num_traits::__min)
475 : __num_traits::__max;
476 const __unsigned_type __smax = __max /
__base;
477 __unsigned_type __result = 0;
479 const char_type* __lit_zero = __lit + __num_base::_S_izero;
481 if (!__lc->_M_allocated)
485 __digit = _M_find(__lit_zero, __len, __c);
489 if (__result > __smax)
490 __testoverflow =
true;
494 __testoverflow |= __result > __max - __digit;
499 if (++__beg != __end)
509 if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
515 __found_grouping +=
static_cast<char>(__sep_pos);
524 else if (__c == __lc->_M_decimal_point)
528 const char_type* __q =
529 __traits_type::find(__lit_zero, __len, __c);
533 __digit = __q - __lit_zero;
536 if (__result > __smax)
537 __testoverflow =
true;
541 __testoverflow |= __result > __max - __digit;
547 if (++__beg != __end)
555 if (__found_grouping.size())
558 __found_grouping +=
static_cast<char>(__sep_pos);
560 if (!std::__verify_grouping(__lc->_M_grouping,
561 __lc->_M_grouping_size,
568 if ((!__sep_pos && !__found_zero && !__found_grouping.size())
574 else if (__testoverflow)
576 if (__negative && __num_traits::__is_signed)
577 __v = __num_traits::__min;
579 __v = __num_traits::__max;
583 __v = __negative ? -__result : __result;
592 template<
typename _CharT,
typename _InIter>
596 ios_base::iostate& __err,
bool& __v)
const
604 __beg = _M_extract_int(__beg, __end, __io, __err, __l);
605 if (__l == 0 || __l == 1)
620 typedef __numpunct_cache<_CharT> __cache_type;
621 __use_cache<__cache_type> __uc;
623 const __cache_type* __lc = __uc(__loc);
627 bool __donef = __lc->_M_falsename_size == 0;
628 bool __donet = __lc->_M_truename_size == 0;
629 bool __testeof =
false;
631 while (!__donef || !__donet)
642 __testf = __c == __lc->_M_falsename[__n];
644 if (!__testf && __donet)
648 __testt = __c == __lc->_M_truename[__n];
650 if (!__testt && __donef)
653 if (!__testt && !__testf)
659 __donef = !__testf || __n >= __lc->_M_falsename_size;
660 __donet = !__testt || __n >= __lc->_M_truename_size;
662 if (__testf && __n == __lc->_M_falsename_size && __n)
665 if (__testt && __n == __lc->_M_truename_size)
670 else if (__testt && __n == __lc->_M_truename_size && __n)
688 template<
typename _CharT,
typename _InIter>
692 ios_base::iostate& __err,
float& __v)
const
696 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
697 std::__convert_to_v(__xtrc.
c_str(), __v, __err, _S_get_c_locale());
703 template<
typename _CharT,
typename _InIter>
707 ios_base::iostate& __err,
double& __v)
const
711 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
712 std::__convert_to_v(__xtrc.
c_str(), __v, __err, _S_get_c_locale());
718#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
719 template<
typename _CharT,
typename _InIter>
723 ios_base::iostate& __err,
double& __v)
const
727 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
728 std::__convert_to_v(__xtrc.
c_str(), __v, __err, _S_get_c_locale());
735 template<
typename _CharT,
typename _InIter>
739 ios_base::iostate& __err,
long double& __v)
const
743 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
744 std::__convert_to_v(__xtrc.
c_str(), __v, __err, _S_get_c_locale());
750 template<
typename _CharT,
typename _InIter>
754 ios_base::iostate& __err,
void*& __v)
const
758 const fmtflags __fmt = __io.
flags();
761#pragma GCC diagnostic push
762#pragma GCC diagnostic ignored "-Wlong-long"
763 typedef __gnu_cxx::__conditional_type<(
sizeof(
void*)
764 <=
sizeof(
unsigned long)),
765 unsigned long,
unsigned long long>::__type _UIntPtrType;
766#pragma GCC diagnostic pop
769 __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
774 __v =
reinterpret_cast<void*
>(__ul);
778#if defined _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT \
779 && defined __LONG_DOUBLE_IEEE128__
780 template<
typename _CharT,
typename _InIter>
784 ios_base::iostate& __err, __ibm128& __v)
const
788 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
789 std::__convert_to_v(__xtrc.
c_str(), __v, __err, _S_get_c_locale());
798 template<
typename _CharT,
typename _OutIter>
800 num_put<_CharT, _OutIter>::
801 _M_pad(_CharT __fill,
streamsize __w, ios_base& __io,
802 _CharT* __new,
const _CharT* __cs,
int& __len)
const
806 __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new,
808 __len =
static_cast<int>(__w);
811_GLIBCXX_END_NAMESPACE_LDBL
813 template<
typename _CharT,
typename _ValueT>
815 __int_to_char(_CharT* __bufend, _ValueT __v,
const _CharT* __lit,
818 _CharT* __buf = __bufend;
819 if (__builtin_expect(__dec,
true))
824 *--__buf = __lit[(__v % 10) + __num_base::_S_odigits];
834 *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits];
843 const int __case_offset = __uppercase ? __num_base::_S_oudigits
844 : __num_base::_S_odigits;
847 *--__buf = __lit[(__v & 0xf) + __case_offset];
852 return __bufend - __buf;
855_GLIBCXX_BEGIN_NAMESPACE_LDBL
857 template<
typename _CharT,
typename _OutIter>
859 num_put<_CharT, _OutIter>::
860 _M_group_int(
const char* __grouping,
size_t __grouping_size, _CharT __sep,
861 ios_base&, _CharT* __new, _CharT* __cs,
int& __len)
const
863 _CharT* __p = std::__add_grouping(__new, __sep, __grouping,
864 __grouping_size, __cs, __cs + __len);
868 template<
typename _CharT,
typename _OutIter>
869 template<
typename _ValueT>
871 num_put<_CharT, _OutIter>::
872 _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
875 using __gnu_cxx::__add_unsigned;
876 typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
877 typedef __numpunct_cache<_CharT> __cache_type;
878 __use_cache<__cache_type> __uc;
879 const locale& __loc = __io._M_getloc();
880 const __cache_type* __lc = __uc(__loc);
881 const _CharT* __lit = __lc->_M_atoms_out;
885 const int __ilen = 5 *
sizeof(_ValueT);
886 _CharT* __cs =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
894 const __unsigned_type __u = ((__v > 0 || !__dec)
895 ? __unsigned_type(__v)
896 : -__unsigned_type(__v));
897 int __len = __int_to_char(__cs + __ilen, __u, __lit, __flags, __dec);
898 __cs += __ilen - __len;
901 if (__lc->_M_use_grouping)
905 _CharT* __cs2 =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
908 _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
909 __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len);
914 if (__builtin_expect(__dec,
true))
920 && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
921 *--__cs = __lit[__num_base::_S_oplus], ++__len;
924 *--__cs = __lit[__num_base::_S_ominus], ++__len;
929 *--__cs = __lit[__num_base::_S_odigits], ++__len;
934 *--__cs = __lit[__num_base::_S_ox + __uppercase];
936 *--__cs = __lit[__num_base::_S_odigits];
945 _CharT* __cs3 =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
947 _M_pad(__fill, __w, __io, __cs3, __cs, __len);
954 return std::__write(__s, __cs, __len);
957 template<
typename _CharT,
typename _OutIter>
959 num_put<_CharT, _OutIter>::
960 _M_group_float(
const char* __grouping,
size_t __grouping_size,
961 _CharT __sep,
const _CharT* __p, _CharT* __new,
962 _CharT* __cs,
int& __len)
const
967 const int __declen = __p ? __p - __cs : __len;
968 _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping,
970 __cs, __cs + __declen);
973 int __newlen = __p2 - __new;
976 char_traits<_CharT>::copy(__p2, __p, __len - __declen);
977 __newlen += __len - __declen;
992 template<
typename _CharT,
typename _OutIter>
993 template<
typename _ValueT>
995 num_put<_CharT, _OutIter>::
996 _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill,
char __mod,
999 typedef __numpunct_cache<_CharT> __cache_type;
1000 __use_cache<__cache_type> __uc;
1001 const locale& __loc = __io._M_getloc();
1002 const __cache_type* __lc = __uc(__loc);
1005 const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision();
1007 const int __max_digits =
1008 __gnu_cxx::__numeric_traits<_ValueT>::__digits10;
1014 __num_base::_S_format_float(__io, __fbuf, __mod);
1016#if _GLIBCXX_USE_C99_STDIO && !_GLIBCXX_HAVE_BROKEN_VSNPRINTF
1018 const bool __use_prec =
1023 int __cs_size = __max_digits * 3;
1024 char* __cs =
static_cast<char*
>(__builtin_alloca(__cs_size));
1026 __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
1027 __fbuf, __prec, __v);
1029 __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
1033 if (__len >= __cs_size)
1035 __cs_size = __len + 1;
1036 __cs =
static_cast<char*
>(__builtin_alloca(__cs_size));
1038 __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
1039 __fbuf, __prec, __v);
1041 __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
1047 const int __max_exp =
1048 __gnu_cxx::__numeric_traits<_ValueT>::__max_exponent10;
1056 const int __cs_size = __fixed ? __max_exp + __prec + 4
1057 : __max_digits * 2 + __prec;
1058 char* __cs =
static_cast<char*
>(__builtin_alloca(__cs_size));
1059 __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf,
1067 _CharT* __ws =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
1069 __ctype.widen(__cs, __cs + __len, __ws);
1073 const char* __p = char_traits<char>::find(__cs, __len,
'.');
1076 __wp = __ws + (__p - __cs);
1077 *__wp = __lc->_M_decimal_point;
1083 if (__lc->_M_use_grouping
1084 && (__wp || __len < 3 || (__cs[1] <=
'9' && __cs[2] <=
'9'
1085 && __cs[1] >=
'0' && __cs[2] >=
'0')))
1089 _CharT* __ws2 =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
1093 if (__cs[0] ==
'-' || __cs[0] ==
'+')
1100 _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size,
1101 __lc->_M_thousands_sep, __wp, __ws2 + __off,
1102 __ws + __off, __len);
1112 _CharT* __ws3 =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
1114 _M_pad(__fill, __w, __io, __ws3, __ws, __len);
1121 return std::__write(__s, __ws, __len);
1124 template<
typename _CharT,
typename _OutIter>
1132 const long __l = __v;
1133 __s = _M_insert_int(__s, __io, __fill, __l);
1137 typedef __numpunct_cache<_CharT> __cache_type;
1138 __use_cache<__cache_type> __uc;
1140 const __cache_type* __lc = __uc(__loc);
1142 const _CharT* __name = __v ? __lc->_M_truename
1143 : __lc->_M_falsename;
1144 int __len = __v ? __lc->_M_truename_size
1145 : __lc->_M_falsename_size;
1152 =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
1160 __s = std::__write(__s, __name, __len);
1161 __s = std::__write(__s, __ps, __plen);
1165 __s = std::__write(__s, __ps, __plen);
1166 __s = std::__write(__s, __name, __len);
1171 __s = std::__write(__s, __name, __len);
1176 template<
typename _CharT,
typename _OutIter>
1180 {
return _M_insert_float(__s, __io, __fill,
char(), __v); }
1182#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1183 template<
typename _CharT,
typename _OutIter>
1186 __do_put(iter_type __s,
ios_base& __io, char_type __fill,
double __v)
const
1187 {
return _M_insert_float(__s, __io, __fill,
char(), __v); }
1190 template<
typename _CharT,
typename _OutIter>
1194 long double __v)
const
1195 {
return _M_insert_float(__s, __io, __fill,
'L', __v); }
1197 template<
typename _CharT,
typename _OutIter>
1201 const void* __v)
const
1208#pragma GCC diagnostic push
1209#pragma GCC diagnostic ignored "-Wlong-long"
1210 typedef __gnu_cxx::__conditional_type<(
sizeof(
const void*)
1211 <=
sizeof(
unsigned long)),
1212 unsigned long,
unsigned long long>::__type _UIntPtrType;
1213#pragma GCC diagnostic pop
1215 __s = _M_insert_int(__s, __io, __fill,
1216 reinterpret_cast<_UIntPtrType
>(__v));
1217 __io.
flags(__flags);
1221#if defined _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT \
1222 && defined __LONG_DOUBLE_IEEE128__
1223 template<
typename _CharT,
typename _OutIter>
1228 {
return _M_insert_float(__s, __io, __fill,
'L', __v); }
1230_GLIBCXX_END_NAMESPACE_LDBL
1239 template<
typename _CharT,
typename _Traits>
1241 __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill,
1242 _CharT* __news,
const _CharT* __olds,
1245 const size_t __plen =
static_cast<size_t>(__newlen - __oldlen);
1251 _Traits::copy(__news, __olds, __oldlen);
1252 _Traits::assign(__news + __oldlen, __plen, __fill);
1262 const locale& __loc = __io._M_getloc();
1265 if (__ctype.widen(
'-') == __olds[0]
1266 || __ctype.widen(
'+') == __olds[0])
1268 __news[0] = __olds[0];
1272 else if (__ctype.widen(
'0') == __olds[0]
1274 && (__ctype.widen(
'x') == __olds[1]
1275 || __ctype.widen(
'X') == __olds[1]))
1277 __news[0] = __olds[0];
1278 __news[1] = __olds[1];
1284 _Traits::assign(__news, __plen, __fill);
1285 _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod);
1288 template<
typename _CharT>
1290 __add_grouping(_CharT* __s, _CharT __sep,
1291 const char* __gbeg,
size_t __gsize,
1292 const _CharT* __first,
const _CharT* __last)
1297 while (__last - __first > __gbeg[__idx]
1298 &&
static_cast<signed char>(__gbeg[__idx]) > 0
1299 && __gbeg[__idx] != __gnu_cxx::__numeric_traits<char>::__max)
1301 __last -= __gbeg[__idx];
1302 __idx < __gsize - 1 ? ++__idx : ++__ctr;
1305 while (__first != __last)
1306 *__s++ = *__first++;
1311 for (
char __i = __gbeg[__idx]; __i > 0; --__i)
1312 *__s++ = *__first++;
1318 for (
char __i = __gbeg[__idx]; __i > 0; --__i)
1319 *__s++ = *__first++;
1327#if _GLIBCXX_EXTERN_TEMPLATE
1328 extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct<char>;
1329 extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct_byname<char>;
1330 extern template class _GLIBCXX_NAMESPACE_LDBL num_get<char>;
1331 extern template class _GLIBCXX_NAMESPACE_LDBL num_put<char>;
1332 extern template class ctype_byname<char>;
1336 __try_use_facet<ctype<char> >(
const locale&) _GLIBCXX_NOTHROW;
1339 const numpunct<char>*
1340 __try_use_facet<numpunct<char> >(
const locale&) _GLIBCXX_NOTHROW;
1343 const num_put<char>*
1344 __try_use_facet<num_put<char> >(
const locale&) _GLIBCXX_NOTHROW;
1347 const num_get<char>*
1348 __try_use_facet<num_get<char> >(
const locale&) _GLIBCXX_NOTHROW;
1355 const numpunct<char>&
1359 const num_put<char>&
1363 const num_get<char>&
1382#ifdef _GLIBCXX_USE_WCHAR_T
1383 extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct<wchar_t>;
1384 extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct_byname<wchar_t>;
1385 extern template class _GLIBCXX_NAMESPACE_LDBL num_get<wchar_t>;
1386 extern template class _GLIBCXX_NAMESPACE_LDBL num_put<wchar_t>;
1387 extern template class ctype_byname<wchar_t>;
1390 const ctype<wchar_t>*
1391 __try_use_facet<ctype<wchar_t> >(
const locale&) _GLIBCXX_NOTHROW;
1394 const numpunct<wchar_t>*
1395 __try_use_facet<numpunct<wchar_t> >(
const locale&) _GLIBCXX_NOTHROW;
1398 const num_put<wchar_t>*
1399 __try_use_facet<num_put<wchar_t> >(
const locale&) _GLIBCXX_NOTHROW;
1402 const num_get<wchar_t>*
1403 __try_use_facet<num_get<wchar_t> >(
const locale&) _GLIBCXX_NOTHROW;
1406 const ctype<wchar_t>&
1410 const numpunct<wchar_t>&
1414 const num_put<wchar_t>&
1418 const num_get<wchar_t>&
1439_GLIBCXX_END_NAMESPACE_VERSION
class __attribute((__abi_tag__("cxx11"))) failure typedef _Ios_Fmtflags fmtflags
These are thrown to indicate problems with io.
bool has_facet(const locale &__loc)
Test for the presence of a facet.
const _Facet & use_facet(const locale &__loc)
Return a facet.
ISO C++ entities toplevel namespace is std.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
constexpr _Iterator __base(_Iterator __it)
constexpr const _CharT * c_str() const noexcept
Return const pointer to null-terminated contents.
constexpr void reserve(size_type __res_arg)
Attempt to preallocate enough memory for specified number of characters.
Basis for explicit traits specializations.
The base of the I/O class hierarchy.
static const fmtflags hex
Converts integer input or generates integer output in hexadecimal base.
static const fmtflags uppercase
Replaces certain lowercase letters with their uppercase equivalents in generated output.
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
static const fmtflags showbase
Generates a prefix indicating the numeric base of generated integer output.
static const fmtflags internal
Adds fill characters at a designated internal point in certain generated output, or identical to righ...
static const fmtflags boolalpha
Insert/extract bool in alphabetic rather than numeric format.
fmtflags flags() const
Access to format flags.
static const iostate eofbit
Indicates that an input operation reached the end of an input sequence.
static const fmtflags floatfield
A mask of scientific|fixed. Useful for the 2-arg form of setf.
static const iostate goodbit
Indicates all is well.
const locale & _M_getloc() const
Locale access.
streamsize width() const
Flags access.
static const fmtflags fixed
Generate floating-point output in fixed-point notation.
static const fmtflags oct
Converts integer input or generates integer output in octal base.
static const fmtflags left
Adds fill characters on the right (final positions) of certain generated output. (I....
static const fmtflags showpos
Generates a + sign in non-negative generated numeric output.
_Ios_Iostate iostate
This is a bitmask type.
static const iostate failbit
Indicates that an input operation failed to read the expected characters, or that an output operation...
static const fmtflags adjustfield
A mask of left|right|internal. Useful for the 2-arg form of setf.
Container class for localization functionality.
static locale::id id
Numpunct facet id.
Primary class template num_get.
_InIter iter_type
Public typedefs.
_CharT char_type
Public typedefs.
virtual iter_type do_get(iter_type, iter_type, ios_base &, ios_base::iostate &, bool &) const
Numeric parsing.
Primary class template num_put.
_CharT char_type
Public typedefs.
virtual iter_type do_put(iter_type __s, ios_base &__io, char_type __fill, bool __v) const
Numeric formatting.
_OutIter iter_type
Public typedefs.