32 #ifndef _LOCALE_FACETS_TCC
33 #define _LOCALE_FACETS_TCC 1
35 #pragma GCC system_header
37 _GLIBCXX_BEGIN_NAMESPACE(std)
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
55 const size_t __i = numpunct<_CharT>::id._M_id();
56 const locale::facet** __caches = __loc._M_impl->_M_caches;
59 __numpunct_cache<_CharT>* __tmp = NULL;
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)
82 const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
84 _M_grouping_size = __np.grouping().size();
85 char* __grouping =
new char[_M_grouping_size];
86 __np.grouping().copy(__grouping, _M_grouping_size);
87 _M_grouping = __grouping;
88 _M_use_grouping = (_M_grouping_size
89 &&
static_cast<signed char>(_M_grouping[0]) > 0
91 != __gnu_cxx::__numeric_traits<char>::__max));
93 _M_truename_size = __np.truename().size();
94 _CharT* __truename =
new _CharT[_M_truename_size];
95 __np.truename().copy(__truename, _M_truename_size);
96 _M_truename = __truename;
98 _M_falsename_size = __np.falsename().size();
99 _CharT* __falsename =
new _CharT[_M_falsename_size];
100 __np.falsename().copy(__falsename, _M_falsename_size);
101 _M_falsename = __falsename;
103 _M_decimal_point = __np.decimal_point();
104 _M_thousands_sep = __np.thousands_sep();
106 const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
107 __ct.widen(__num_base::_S_atoms_out,
108 __num_base::_S_atoms_out + __num_base::_S_oend, _M_atoms_out);
109 __ct.widen(__num_base::_S_atoms_in,
110 __num_base::_S_atoms_in + __num_base::_S_iend, _M_atoms_in);
122 __verify_grouping(
const char* __grouping,
size_t __grouping_size,
123 const string& __grouping_tmp);
125 _GLIBCXX_BEGIN_LDBL_NAMESPACE
127 template<
typename _CharT,
typename _InIter>
129 num_get<_CharT, _InIter>::
130 _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
131 ios_base::iostate& __err,
string& __xtrc)
const
133 typedef char_traits<_CharT> __traits_type;
134 typedef __numpunct_cache<_CharT> __cache_type;
135 __use_cache<__cache_type> __uc;
136 const locale& __loc = __io._M_getloc();
137 const __cache_type* __lc = __uc(__loc);
138 const _CharT* __lit = __lc->_M_atoms_in;
139 char_type __c = char_type();
142 bool __testeof = __beg == __end;
148 const bool __plus = __c == __lit[__num_base::_S_iplus];
149 if ((__plus || __c == __lit[__num_base::_S_iminus])
150 && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
151 && !(__c == __lc->_M_decimal_point))
153 __xtrc += __plus ?
'+' :
'-';
154 if (++__beg != __end)
162 bool __found_mantissa =
false;
166 if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
167 || __c == __lc->_M_decimal_point)
169 else if (__c == __lit[__num_base::_S_izero])
171 if (!__found_mantissa)
174 __found_mantissa =
true;
178 if (++__beg != __end)
188 bool __found_dec =
false;
189 bool __found_sci =
false;
190 string __found_grouping;
191 if (__lc->_M_use_grouping)
192 __found_grouping.reserve(32);
193 const char_type* __lit_zero = __lit + __num_base::_S_izero;
195 if (!__lc->_M_allocated)
199 const int __digit = _M_find(__lit_zero, 10, __c);
202 __xtrc +=
'0' + __digit;
203 __found_mantissa =
true;
205 else if (__c == __lc->_M_decimal_point
206 && !__found_dec && !__found_sci)
211 else if ((__c == __lit[__num_base::_S_ie]
212 || __c == __lit[__num_base::_S_iE])
213 && !__found_sci && __found_mantissa)
220 if (++__beg != __end)
223 const bool __plus = __c == __lit[__num_base::_S_iplus];
224 if (__plus || __c == __lit[__num_base::_S_iminus])
225 __xtrc += __plus ?
'+' :
'-';
238 if (++__beg != __end)
248 if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
250 if (!__found_dec && !__found_sci)
256 __found_grouping +=
static_cast<char>(__sep_pos);
270 else if (__c == __lc->_M_decimal_point)
272 if (!__found_dec && !__found_sci)
277 if (__found_grouping.size())
278 __found_grouping += static_cast<char>(__sep_pos);
287 const char_type* __q =
288 __traits_type::find(__lit_zero, 10, __c);
291 __xtrc +=
'0' + (__q - __lit_zero);
292 __found_mantissa =
true;
295 else if ((__c == __lit[__num_base::_S_ie]
296 || __c == __lit[__num_base::_S_iE])
297 && !__found_sci && __found_mantissa)
300 if (__found_grouping.size() && !__found_dec)
301 __found_grouping += static_cast<char>(__sep_pos);
306 if (++__beg != __end)
309 const bool __plus = __c == __lit[__num_base::_S_iplus];
310 if ((__plus || __c == __lit[__num_base::_S_iminus])
311 && !(__lc->_M_use_grouping
312 && __c == __lc->_M_thousands_sep)
313 && !(__c == __lc->_M_decimal_point))
314 __xtrc += __plus ?
'+' :
'-';
328 if (++__beg != __end)
336 if (__found_grouping.size())
339 if (!__found_dec && !__found_sci)
340 __found_grouping +=
static_cast<char>(__sep_pos);
342 if (!std::__verify_grouping(__lc->_M_grouping,
343 __lc->_M_grouping_size,
345 __err = ios_base::failbit;
351 template<
typename _CharT,
typename _InIter>
352 template<
typename _ValueT>
354 num_get<_CharT, _InIter>::
355 _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
356 ios_base::iostate& __err, _ValueT& __v)
const
358 typedef char_traits<_CharT> __traits_type;
359 using __gnu_cxx::__add_unsigned;
360 typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
361 typedef __numpunct_cache<_CharT> __cache_type;
362 __use_cache<__cache_type> __uc;
363 const locale& __loc = __io._M_getloc();
364 const __cache_type* __lc = __uc(__loc);
365 const _CharT* __lit = __lc->_M_atoms_in;
366 char_type __c = char_type();
369 const ios_base::fmtflags __basefield = __io.flags()
370 & ios_base::basefield;
372 int __base = __oct ? 8 : (__basefield ==
ios_base::hex ? 16 : 10);
375 bool __testeof = __beg == __end;
378 bool __negative =
false;
382 __negative = __c == __lit[__num_base::_S_iminus];
383 if ((__negative || __c == __lit[__num_base::_S_iplus])
384 && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
385 && !(__c == __lc->_M_decimal_point))
387 if (++__beg != __end)
396 bool __found_zero =
false;
400 if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
401 || __c == __lc->_M_decimal_point)
403 else if (__c == __lit[__num_base::_S_izero]
404 && (!__found_zero || __base == 10))
408 if (__basefield == 0)
413 else if (__found_zero
414 && (__c == __lit[__num_base::_S_ix]
415 || __c == __lit[__num_base::_S_iX]))
417 if (__basefield == 0)
421 __found_zero =
false;
430 if (++__beg != __end)
442 const size_t __len = (__base == 16 ? __num_base::_S_iend
443 - __num_base::_S_izero : __base);
446 string __found_grouping;
447 if (__lc->_M_use_grouping)
448 __found_grouping.reserve(32);
449 bool __testfail =
false;
450 bool __testoverflow =
false;
451 const __unsigned_type __max =
452 (__negative && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
453 ? -__gnu_cxx::__numeric_traits<_ValueT>::__min
454 : __gnu_cxx::__numeric_traits<_ValueT>::__max;
455 const __unsigned_type __smax = __max / __base;
456 __unsigned_type __result = 0;
458 const char_type* __lit_zero = __lit + __num_base::_S_izero;
460 if (!__lc->_M_allocated)
464 __digit = _M_find(__lit_zero, __len, __c);
468 if (__result > __smax)
469 __testoverflow =
true;
473 __testoverflow |= __result > __max - __digit;
478 if (++__beg != __end)
488 if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
494 __found_grouping +=
static_cast<char>(__sep_pos);
503 else if (__c == __lc->_M_decimal_point)
507 const char_type* __q =
508 __traits_type::find(__lit_zero, __len, __c);
512 __digit = __q - __lit_zero;
515 if (__result > __smax)
516 __testoverflow =
true;
520 __testoverflow |= __result > __max - __digit;
526 if (++__beg != __end)
534 if (__found_grouping.size())
537 __found_grouping +=
static_cast<char>(__sep_pos);
539 if (!std::__verify_grouping(__lc->_M_grouping,
540 __lc->_M_grouping_size,
542 __err = ios_base::failbit;
547 if ((!__sep_pos && !__found_zero && !__found_grouping.size())
551 __err = ios_base::failbit;
553 else if (__testoverflow)
556 && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
557 __v = __gnu_cxx::__numeric_traits<_ValueT>::__min;
559 __v = __gnu_cxx::__numeric_traits<_ValueT>::__max;
560 __err = ios_base::failbit;
563 __v = __negative ? -__result : __result;
566 __err |= ios_base::eofbit;
572 template<
typename _CharT,
typename _InIter>
574 num_get<_CharT, _InIter>::
576 ios_base::iostate& __err,
bool& __v)
const
584 __beg = _M_extract_int(__beg, __end, __io, __err, __l);
585 if (__l == 0 || __l == 1)
592 __err = ios_base::failbit;
594 __err |= ios_base::eofbit;
600 typedef __numpunct_cache<_CharT> __cache_type;
601 __use_cache<__cache_type> __uc;
603 const __cache_type* __lc = __uc(__loc);
607 bool __donef = __lc->_M_falsename_size == 0;
608 bool __donet = __lc->_M_truename_size == 0;
609 bool __testeof =
false;
611 while (!__donef || !__donet)
622 __testf = __c == __lc->_M_falsename[__n];
624 if (!__testf && __donet)
628 __testt = __c == __lc->_M_truename[__n];
630 if (!__testt && __donef)
633 if (!__testt && !__testf)
639 __donef = !__testf || __n >= __lc->_M_falsename_size;
640 __donet = !__testt || __n >= __lc->_M_truename_size;
642 if (__testf && __n == __lc->_M_falsename_size && __n)
645 if (__testt && __n == __lc->_M_truename_size)
646 __err = ios_base::failbit;
648 __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
650 else if (__testt && __n == __lc->_M_truename_size && __n)
653 __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
660 __err = ios_base::failbit;
662 __err |= ios_base::eofbit;
668 template<
typename _CharT,
typename _InIter>
672 ios_base::iostate& __err,
float& __v)
const
676 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
677 std::__convert_to_v(__xtrc.
c_str(), __v, __err, _S_get_c_locale());
679 __err |= ios_base::eofbit;
683 template<
typename _CharT,
typename _InIter>
687 ios_base::iostate& __err,
double& __v)
const
691 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
692 std::__convert_to_v(__xtrc.
c_str(), __v, __err, _S_get_c_locale());
694 __err |= ios_base::eofbit;
698 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
699 template<
typename _CharT,
typename _InIter>
703 ios_base::iostate& __err,
double& __v)
const
707 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
708 std::__convert_to_v(__xtrc.
c_str(), __v, __err, _S_get_c_locale());
710 __err |= ios_base::eofbit;
715 template<
typename _CharT,
typename _InIter>
717 num_get<_CharT, _InIter>::
719 ios_base::iostate& __err,
long double& __v)
const
723 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
724 std::__convert_to_v(__xtrc.
c_str(), __v, __err, _S_get_c_locale());
726 __err |= ios_base::eofbit;
730 template<
typename _CharT,
typename _InIter>
734 ios_base::iostate& __err,
void*& __v)
const
737 typedef ios_base::fmtflags fmtflags;
738 const fmtflags __fmt = __io.
flags();
741 typedef __gnu_cxx::__conditional_type<(
sizeof(
void*)
742 <=
sizeof(
unsigned long)),
743 unsigned long,
unsigned long long>::__type _UIntPtrType;
746 __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
751 __v =
reinterpret_cast<void*
>(__ul);
757 template<
typename _CharT,
typename _OutIter>
761 _CharT* __new,
const _CharT* __cs,
int& __len)
const
765 __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new,
767 __len =
static_cast<int>(__w);
770 _GLIBCXX_END_LDBL_NAMESPACE
772 template<
typename _CharT,
typename _ValueT>
774 __int_to_char(_CharT* __bufend, _ValueT __v,
const _CharT* __lit,
775 ios_base::fmtflags __flags,
bool __dec)
777 _CharT* __buf = __bufend;
778 if (__builtin_expect(__dec,
true))
783 *--__buf = __lit[(__v % 10) + __num_base::_S_odigits];
793 *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits];
802 const int __case_offset = __uppercase ? __num_base::_S_oudigits
803 : __num_base::_S_odigits;
806 *--__buf = __lit[(__v & 0xf) + __case_offset];
811 return __bufend - __buf;
814 _GLIBCXX_BEGIN_LDBL_NAMESPACE
816 template<
typename _CharT,
typename _OutIter>
818 num_put<_CharT, _OutIter>::
819 _M_group_int(
const char* __grouping,
size_t __grouping_size, _CharT __sep,
820 ios_base&, _CharT* __new, _CharT* __cs,
int& __len)
const
822 _CharT* __p = std::__add_grouping(__new, __sep, __grouping,
823 __grouping_size, __cs, __cs + __len);
827 template<
typename _CharT,
typename _OutIter>
828 template<
typename _ValueT>
830 num_put<_CharT, _OutIter>::
831 _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
834 using __gnu_cxx::__add_unsigned;
835 typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
836 typedef __numpunct_cache<_CharT> __cache_type;
837 __use_cache<__cache_type> __uc;
838 const locale& __loc = __io._M_getloc();
839 const __cache_type* __lc = __uc(__loc);
840 const _CharT* __lit = __lc->_M_atoms_out;
841 const ios_base::fmtflags __flags = __io.flags();
844 const int __ilen = 5 *
sizeof(_ValueT);
845 _CharT* __cs =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
850 const ios_base::fmtflags __basefield = __flags & ios_base::basefield;
853 const __unsigned_type __u = ((__v > 0 || !__dec)
854 ? __unsigned_type(__v)
855 : -__unsigned_type(__v));
856 int __len = __int_to_char(__cs + __ilen, __u, __lit, __flags, __dec);
857 __cs += __ilen - __len;
860 if (__lc->_M_use_grouping)
864 _CharT* __cs2 =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
867 _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
868 __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len);
873 if (__builtin_expect(__dec,
true))
879 && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
880 *--__cs = __lit[__num_base::_S_oplus], ++__len;
883 *--__cs = __lit[__num_base::_S_ominus], ++__len;
888 *--__cs = __lit[__num_base::_S_odigits], ++__len;
893 *--__cs = __lit[__num_base::_S_ox + __uppercase];
895 *--__cs = __lit[__num_base::_S_odigits];
902 if (__w > static_cast<streamsize>(__len))
904 _CharT* __cs3 =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
906 _M_pad(__fill, __w, __io, __cs3, __cs, __len);
913 return std::__write(__s, __cs, __len);
916 template<
typename _CharT,
typename _OutIter>
918 num_put<_CharT, _OutIter>::
919 _M_group_float(
const char* __grouping,
size_t __grouping_size,
920 _CharT __sep,
const _CharT* __p, _CharT* __new,
921 _CharT* __cs,
int& __len)
const
926 const int __declen = __p ? __p - __cs : __len;
927 _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping,
929 __cs, __cs + __declen);
932 int __newlen = __p2 - __new;
935 char_traits<_CharT>::copy(__p2, __p, __len - __declen);
936 __newlen += __len - __declen;
951 template<
typename _CharT,
typename _OutIter>
952 template<
typename _ValueT>
954 num_put<_CharT, _OutIter>::
955 _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill,
char __mod,
958 typedef __numpunct_cache<_CharT> __cache_type;
959 __use_cache<__cache_type> __uc;
960 const locale& __loc = __io._M_getloc();
961 const __cache_type* __lc = __uc(__loc);
964 const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision();
966 const int __max_digits =
967 __gnu_cxx::__numeric_traits<_ValueT>::__digits10;
973 __num_base::_S_format_float(__io, __fbuf, __mod);
975 #ifdef _GLIBCXX_USE_C99
978 int __cs_size = __max_digits * 3;
979 char* __cs =
static_cast<char*
>(__builtin_alloca(__cs_size));
980 __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
981 __fbuf, __prec, __v);
984 if (__len >= __cs_size)
986 __cs_size = __len + 1;
987 __cs =
static_cast<char*
>(__builtin_alloca(__cs_size));
988 __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
989 __fbuf, __prec, __v);
994 const int __max_exp =
995 __gnu_cxx::__numeric_traits<_ValueT>::__max_exponent10;
1003 const int __cs_size = __fixed ? __max_exp + __prec + 4
1004 : __max_digits * 2 + __prec;
1005 char* __cs =
static_cast<char*
>(__builtin_alloca(__cs_size));
1006 __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf,
1012 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
1014 _CharT* __ws =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
1016 __ctype.widen(__cs, __cs + __len, __ws);
1020 const char* __p = char_traits<char>::find(__cs, __len,
'.');
1023 __wp = __ws + (__p - __cs);
1024 *__wp = __lc->_M_decimal_point;
1030 if (__lc->_M_use_grouping
1031 && (__wp || __len < 3 || (__cs[1] <=
'9' && __cs[2] <=
'9'
1032 && __cs[1] >=
'0' && __cs[2] >=
'0')))
1036 _CharT* __ws2 =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
1040 if (__cs[0] ==
'-' || __cs[0] ==
'+')
1047 _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size,
1048 __lc->_M_thousands_sep, __wp, __ws2 + __off,
1049 __ws + __off, __len);
1057 if (__w > static_cast<streamsize>(__len))
1059 _CharT* __ws3 =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
1061 _M_pad(__fill, __w, __io, __ws3, __ws, __len);
1068 return std::__write(__s, __ws, __len);
1071 template<
typename _CharT,
typename _OutIter>
1073 num_put<_CharT, _OutIter>::
1076 const ios_base::fmtflags __flags = __io.
flags();
1079 const long __l = __v;
1080 __s = _M_insert_int(__s, __io, __fill, __l);
1084 typedef __numpunct_cache<_CharT> __cache_type;
1085 __use_cache<__cache_type> __uc;
1087 const __cache_type* __lc = __uc(__loc);
1089 const _CharT* __name = __v ? __lc->_M_truename
1090 : __lc->_M_falsename;
1091 int __len = __v ? __lc->_M_truename_size
1092 : __lc->_M_falsename_size;
1095 if (__w > static_cast<streamsize>(__len))
1099 =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
1107 __s = std::__write(__s, __name, __len);
1108 __s = std::__write(__s, __ps, __plen);
1112 __s = std::__write(__s, __ps, __plen);
1113 __s = std::__write(__s, __name, __len);
1118 __s = std::__write(__s, __name, __len);
1123 template<
typename _CharT,
typename _OutIter>
1127 {
return _M_insert_float(__s, __io, __fill,
char(), __v); }
1129 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
1130 template<
typename _CharT,
typename _OutIter>
1133 __do_put(iter_type __s,
ios_base& __io, char_type __fill,
double __v)
const
1134 {
return _M_insert_float(__s, __io, __fill,
char(), __v); }
1137 template<
typename _CharT,
typename _OutIter>
1139 num_put<_CharT, _OutIter>::
1141 long double __v)
const
1142 {
return _M_insert_float(__s, __io, __fill,
'L', __v); }
1144 template<
typename _CharT,
typename _OutIter>
1148 const void* __v)
const
1150 const ios_base::fmtflags __flags = __io.
flags();
1151 const ios_base::fmtflags __fmt = ~(ios_base::basefield
1155 typedef __gnu_cxx::__conditional_type<(
sizeof(
const void*)
1156 <=
sizeof(
unsigned long)),
1157 unsigned long,
unsigned long long>::__type _UIntPtrType;
1159 __s = _M_insert_int(__s, __io, __fill,
1160 reinterpret_cast<_UIntPtrType>(__v));
1161 __io.
flags(__flags);
1165 _GLIBCXX_END_LDBL_NAMESPACE
1174 template<
typename _CharT,
typename _Traits>
1176 __pad<_CharT, _Traits>::_S_pad(
ios_base& __io, _CharT __fill,
1177 _CharT* __news,
const _CharT* __olds,
1180 const size_t __plen =
static_cast<size_t>(__newlen - __oldlen);
1181 const ios_base::fmtflags __adjust = __io.
flags() & ios_base::adjustfield;
1186 _Traits::copy(__news, __olds, __oldlen);
1187 _Traits::assign(__news + __oldlen, __plen, __fill);
1198 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
1200 if (__ctype.widen(
'-') == __olds[0]
1201 || __ctype.widen(
'+') == __olds[0])
1203 __news[0] = __olds[0];
1207 else if (__ctype.widen(
'0') == __olds[0]
1209 && (__ctype.widen(
'x') == __olds[1]
1210 || __ctype.widen(
'X') == __olds[1]))
1212 __news[0] = __olds[0];
1213 __news[1] = __olds[1];
1219 _Traits::assign(__news, __plen, __fill);
1220 _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod);
1223 template<
typename _CharT>
1225 __add_grouping(_CharT* __s, _CharT __sep,
1226 const char* __gbeg,
size_t __gsize,
1227 const _CharT* __first,
const _CharT* __last)
1232 while (__last - __first > __gbeg[__idx]
1233 && static_cast<signed char>(__gbeg[__idx]) > 0
1234 && __gbeg[__idx] != __gnu_cxx::__numeric_traits<char>::__max)
1236 __last -= __gbeg[__idx];
1237 __idx < __gsize - 1 ? ++__idx : ++__ctr;
1240 while (__first != __last)
1241 *__s++ = *__first++;
1246 for (
char __i = __gbeg[__idx]; __i > 0; --__i)
1247 *__s++ = *__first++;
1253 for (
char __i = __gbeg[__idx]; __i > 0; --__i)
1254 *__s++ = *__first++;
1263 #if _GLIBCXX_EXTERN_TEMPLATE
1264 extern template class numpunct<char>;
1265 extern template class numpunct_byname<char>;
1266 extern template class _GLIBCXX_LDBL_NAMESPACE num_get<char>;
1267 extern template class _GLIBCXX_LDBL_NAMESPACE num_put<char>;
1268 extern template class ctype_byname<char>;
1272 use_facet<ctype<char> >(
const locale&);
1275 const numpunct<char>&
1276 use_facet<numpunct<char> >(
const locale&);
1279 const num_put<char>&
1280 use_facet<num_put<char> >(
const locale&);
1283 const num_get<char>&
1284 use_facet<num_get<char> >(
const locale&);
1288 has_facet<ctype<char> >(
const locale&);
1292 has_facet<numpunct<char> >(
const locale&);
1296 has_facet<num_put<char> >(
const locale&);
1300 has_facet<num_get<char> >(
const locale&);
1302 #ifdef _GLIBCXX_USE_WCHAR_T
1303 extern template class numpunct<wchar_t>;
1304 extern template class numpunct_byname<wchar_t>;
1305 extern template class _GLIBCXX_LDBL_NAMESPACE num_get<wchar_t>;
1306 extern template class _GLIBCXX_LDBL_NAMESPACE num_put<wchar_t>;
1307 extern template class ctype_byname<wchar_t>;
1310 const ctype<wchar_t>&
1311 use_facet<ctype<wchar_t> >(
const locale&);
1314 const numpunct<wchar_t>&
1315 use_facet<numpunct<wchar_t> >(
const locale&);
1318 const num_put<wchar_t>&
1319 use_facet<num_put<wchar_t> >(
const locale&);
1322 const num_get<wchar_t>&
1323 use_facet<num_get<wchar_t> >(
const locale&);
1327 has_facet<ctype<wchar_t> >(
const locale&);
1331 has_facet<numpunct<wchar_t> >(
const locale&);
1335 has_facet<num_put<wchar_t> >(
const locale&);
1339 has_facet<num_get<wchar_t> >(
const locale&);
1343 _GLIBCXX_END_NAMESPACE