30 #ifndef _LOCALE_FACETS_NONIO_TCC
31 #define _LOCALE_FACETS_NONIO_TCC 1
33 #pragma GCC system_header
35 _GLIBCXX_BEGIN_NAMESPACE(std)
37 template<typename _CharT,
bool _Intl>
38 struct __use_cache<__moneypunct_cache<_CharT, _Intl> >
40 const __moneypunct_cache<_CharT, _Intl>*
41 operator() (
const locale& __loc)
const
43 const size_t __i = moneypunct<_CharT, _Intl>::id._M_id();
44 const locale::facet** __caches = __loc._M_impl->_M_caches;
47 __moneypunct_cache<_CharT, _Intl>* __tmp = NULL;
50 __tmp =
new __moneypunct_cache<_CharT, _Intl>;
51 __tmp->_M_cache(__loc);
56 __throw_exception_again;
58 __loc._M_impl->_M_install_cache(__tmp, __i);
61 const __moneypunct_cache<_CharT, _Intl>*
>(__caches[__i]);
65 template<
typename _CharT,
bool _Intl>
67 __moneypunct_cache<_CharT, _Intl>::_M_cache(
const locale& __loc)
71 const moneypunct<_CharT, _Intl>& __mp =
72 use_facet<moneypunct<_CharT, _Intl> >(__loc);
74 _M_grouping_size = __mp.grouping().size();
75 char* __grouping =
new char[_M_grouping_size];
76 __mp.grouping().copy(__grouping, _M_grouping_size);
77 _M_grouping = __grouping;
78 _M_use_grouping = (_M_grouping_size
79 &&
static_cast<signed char>(_M_grouping[0]) > 0
81 != __gnu_cxx::__numeric_traits<char>::__max));
83 _M_decimal_point = __mp.decimal_point();
84 _M_thousands_sep = __mp.thousands_sep();
85 _M_frac_digits = __mp.frac_digits();
87 _M_curr_symbol_size = __mp.curr_symbol().size();
88 _CharT* __curr_symbol =
new _CharT[_M_curr_symbol_size];
89 __mp.curr_symbol().copy(__curr_symbol, _M_curr_symbol_size);
90 _M_curr_symbol = __curr_symbol;
92 _M_positive_sign_size = __mp.positive_sign().size();
93 _CharT* __positive_sign =
new _CharT[_M_positive_sign_size];
94 __mp.positive_sign().copy(__positive_sign, _M_positive_sign_size);
95 _M_positive_sign = __positive_sign;
97 _M_negative_sign_size = __mp.negative_sign().size();
98 _CharT* __negative_sign =
new _CharT[_M_negative_sign_size];
99 __mp.negative_sign().copy(__negative_sign, _M_negative_sign_size);
100 _M_negative_sign = __negative_sign;
102 _M_pos_format = __mp.pos_format();
103 _M_neg_format = __mp.neg_format();
105 const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
106 __ct.widen(money_base::_S_atoms,
107 money_base::_S_atoms + money_base::_S_end, _M_atoms);
110 _GLIBCXX_BEGIN_LDBL_NAMESPACE
112 template<
typename _CharT,
typename _InIter>
115 money_get<_CharT, _InIter>::
116 _M_extract(iter_type __beg, iter_type __end, ios_base& __io,
117 ios_base::iostate& __err,
string& __units)
const
119 typedef char_traits<_CharT> __traits_type;
120 typedef typename string_type::size_type size_type;
121 typedef money_base::part part;
122 typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
124 const locale& __loc = __io._M_getloc();
125 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
127 __use_cache<__cache_type> __uc;
128 const __cache_type* __lc = __uc(__loc);
129 const char_type* __lit = __lc->_M_atoms;
132 bool __negative =
false;
134 size_type __sign_size = 0;
136 const bool __mandatory_sign = (__lc->_M_positive_sign_size
137 && __lc->_M_negative_sign_size);
139 string __grouping_tmp;
140 if (__lc->_M_use_grouping)
141 __grouping_tmp.reserve(32);
147 bool __testvalid =
true;
149 bool __testdecfound =
false;
155 const char_type* __lit_zero = __lit + money_base::_S_zero;
156 const money_base::pattern __p = __lc->_M_neg_format;
157 for (
int __i = 0; __i < 4 && __testvalid; ++__i)
159 const part __which =
static_cast<part
>(__p.field[__i]);
162 case money_base::symbol:
169 || (__i == 1 && (__mandatory_sign
170 || (
static_cast<part
>(__p.field[0])
172 || (
static_cast<part
>(__p.field[2])
173 == money_base::space)))
174 || (__i == 2 && ((
static_cast<part
>(__p.field[3])
175 == money_base::value)
177 && (
static_cast<part
>(__p.field[3])
178 == money_base::sign)))))
180 const size_type __len = __lc->_M_curr_symbol_size;
182 for (; __beg != __end && __j < __len
183 && *__beg == __lc->_M_curr_symbol[__j];
190 case money_base::sign:
192 if (__lc->_M_positive_sign_size && __beg != __end
193 && *__beg == __lc->_M_positive_sign[0])
195 __sign_size = __lc->_M_positive_sign_size;
198 else if (__lc->_M_negative_sign_size && __beg != __end
199 && *__beg == __lc->_M_negative_sign[0])
202 __sign_size = __lc->_M_negative_sign_size;
205 else if (__lc->_M_positive_sign_size
206 && !__lc->_M_negative_sign_size)
210 else if (__mandatory_sign)
213 case money_base::value:
216 for (; __beg != __end; ++__beg)
218 const char_type __c = *__beg;
219 const char_type* __q = __traits_type::find(__lit_zero,
223 __res += money_base::_S_atoms[__q - __lit];
226 else if (__c == __lc->_M_decimal_point
229 if (__lc->_M_frac_digits <= 0)
234 __testdecfound =
true;
236 else if (__lc->_M_use_grouping
237 && __c == __lc->_M_thousands_sep
243 __grouping_tmp +=
static_cast<char>(__n);
258 case money_base::space:
260 if (__beg != __end && __ctype.is(ctype_base::space, *__beg))
264 case money_base::none:
267 for (; __beg != __end
268 && __ctype.is(ctype_base::space, *__beg); ++__beg);
274 if (__sign_size > 1 && __testvalid)
276 const char_type* __sign = __negative ? __lc->_M_negative_sign
277 : __lc->_M_positive_sign;
279 for (; __beg != __end && __i < __sign_size
280 && *__beg == __sign[__i]; ++__beg, ++__i);
282 if (__i != __sign_size)
289 if (__res.size() > 1)
291 const size_type __first = __res.find_first_not_of(
'0');
292 const bool __only_zeros = __first == string::npos;
294 __res.erase(0, __only_zeros ? __res.size() - 1 : __first);
298 if (__negative && __res[0] !=
'0')
299 __res.insert(__res.begin(),
'-');
302 if (__grouping_tmp.size())
305 __grouping_tmp +=
static_cast<char>(__testdecfound ? __last_pos
307 if (!std::__verify_grouping(__lc->_M_grouping,
308 __lc->_M_grouping_size,
310 __err |= ios_base::failbit;
314 if (__testdecfound && __n != __lc->_M_frac_digits)
320 __err |= ios_base::failbit;
326 __err |= ios_base::eofbit;
330 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
331 template<
typename _CharT,
typename _InIter>
333 money_get<_CharT, _InIter>::
334 __do_get(iter_type __beg, iter_type __end,
bool __intl, ios_base& __io,
335 ios_base::iostate& __err,
double& __units)
const
338 __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
339 : _M_extract<false>(__beg, __end, __io, __err, __str);
340 std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale());
345 template<
typename _CharT,
typename _InIter>
347 money_get<_CharT, _InIter>::
349 ios_base::iostate& __err,
long double& __units)
const
352 __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
353 : _M_extract<false>(__beg, __end, __io, __err, __str);
354 std::__convert_to_v(__str.
c_str(), __units, __err, _S_get_c_locale());
358 template<
typename _CharT,
typename _InIter>
362 ios_base::iostate& __err,
string_type& __digits)
const
364 typedef typename string::size_type size_type;
367 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
370 __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
371 : _M_extract<false>(__beg, __end, __io, __err, __str);
372 const size_type __len = __str.size();
376 __ctype.
widen(__str.data(), __str.data() + __len, &__digits[0]);
381 template<
typename _CharT,
typename _OutIter>
386 const string_type& __digits)
const
388 typedef typename string_type::size_type size_type;
389 typedef money_base::part part;
390 typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
393 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
395 __use_cache<__cache_type> __uc;
396 const __cache_type* __lc = __uc(__loc);
397 const char_type* __lit = __lc->_M_atoms;
401 const char_type* __beg = __digits.data();
403 money_base::pattern __p;
404 const char_type* __sign;
405 size_type __sign_size;
406 if (!(*__beg == __lit[money_base::_S_minus]))
408 __p = __lc->_M_pos_format;
409 __sign = __lc->_M_positive_sign;
410 __sign_size = __lc->_M_positive_sign_size;
414 __p = __lc->_M_neg_format;
415 __sign = __lc->_M_negative_sign;
416 __sign_size = __lc->_M_negative_sign_size;
422 size_type __len = __ctype.
scan_not(ctype_base::digit, __beg,
423 __beg + __digits.size()) - __beg;
430 __value.reserve(2 * __len);
434 long __paddec = __len - __lc->_M_frac_digits;
437 if (__lc->_M_frac_digits < 0)
439 if (__lc->_M_grouping_size)
441 __value.assign(2 * __paddec, char_type());
443 std::__add_grouping(&__value[0], __lc->_M_thousands_sep,
445 __lc->_M_grouping_size,
446 __beg, __beg + __paddec);
447 __value.erase(__vend - &__value[0]);
450 __value.assign(__beg, __paddec);
454 if (__lc->_M_frac_digits > 0)
456 __value += __lc->_M_decimal_point;
458 __value.append(__beg + __paddec, __lc->_M_frac_digits);
462 __value.append(-__paddec, __lit[money_base::_S_zero]);
463 __value.append(__beg, __len);
468 const ios_base::fmtflags __f = __io.
flags()
469 & ios_base::adjustfield;
470 __len = __value.size() + __sign_size;
472 ? __lc->_M_curr_symbol_size : 0);
475 __res.reserve(2 * __len);
477 const size_type __width =
static_cast<size_type
>(__io.
width());
481 for (
int __i = 0; __i < 4; ++__i)
483 const part __which =
static_cast<part
>(__p.field[__i]);
486 case money_base::symbol:
488 __res.append(__lc->_M_curr_symbol,
489 __lc->_M_curr_symbol_size);
491 case money_base::sign:
498 case money_base::value:
501 case money_base::space:
506 __res.append(__width - __len, __fill);
510 case money_base::none:
512 __res.append(__width - __len, __fill);
519 __res.append(__sign + 1, __sign_size - 1);
522 __len = __res.size();
527 __res.append(__width - __len, __fill);
530 __res.insert(0, __width - __len, __fill);
535 __s = std::__write(__s, __res.data(), __len);
541 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
542 template<
typename _CharT,
typename _OutIter>
544 money_put<_CharT, _OutIter>::
545 __do_put(iter_type __s,
bool __intl, ios_base& __io, char_type __fill,
546 double __units)
const
547 {
return this->do_put(__s, __intl, __io, __fill, (
long double) __units); }
550 template<
typename _CharT,
typename _OutIter>
552 money_put<_CharT, _OutIter>::
554 long double __units)
const
557 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
558 #ifdef _GLIBCXX_USE_C99
561 char* __cs =
static_cast<char*
>(__builtin_alloca(__cs_size));
564 int __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
565 "%.*Lf", 0, __units);
567 if (__len >= __cs_size)
569 __cs_size = __len + 1;
570 __cs =
static_cast<char*
>(__builtin_alloca(__cs_size));
571 __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
572 "%.*Lf", 0, __units);
576 const int __cs_size =
577 __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 3;
578 char* __cs =
static_cast<char*
>(__builtin_alloca(__cs_size));
579 int __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0,
"%.*Lf",
583 __ctype.
widen(__cs, __cs + __len, &__digits[0]);
584 return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
585 : _M_insert<false>(__s, __io, __fill, __digits);
588 template<
typename _CharT,
typename _OutIter>
593 {
return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
594 : _M_insert<false>(__s, __io, __fill, __digits); }
596 _GLIBCXX_END_LDBL_NAMESPACE
601 template<
typename _CharT,
typename _InIter>
604 {
return time_base::no_order; }
608 template<
typename _CharT,
typename _InIter>
612 ios_base::iostate& __err, tm* __tm,
613 const _CharT* __format)
const
616 const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
617 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
620 ios_base::iostate __tmperr = ios_base::goodbit;
621 for (
size_t __i = 0; __beg != __end && __i < __len && !__tmperr; ++__i)
623 if (__ctype.narrow(__format[__i], 0) ==
'%')
626 char __c = __ctype.narrow(__format[++__i], 0);
628 if (__c ==
'E' || __c ==
'O')
629 __c = __ctype.narrow(__format[++__i], 0);
636 const char_type* __days1[7];
637 __tp._M_days_abbreviated(__days1);
638 __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days1,
643 const char_type* __days2[7];
644 __tp._M_days(__days2);
645 __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days2,
651 const char_type* __months1[12];
652 __tp._M_months_abbreviated(__months1);
653 __beg = _M_extract_name(__beg, __end, __tm->tm_mon,
654 __months1, 12, __io, __tmperr);
658 const char_type* __months2[12];
659 __tp._M_months(__months2);
660 __beg = _M_extract_name(__beg, __end, __tm->tm_mon,
661 __months2, 12, __io, __tmperr);
665 const char_type* __dt[2];
666 __tp._M_date_time_formats(__dt);
667 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
672 __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 1, 31, 2,
678 if (__ctype.is(ctype_base::space, *__beg))
679 __beg = _M_extract_num(++__beg, __end, __tm->tm_mday, 1, 9,
682 __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 10, 31,
688 __ctype.widen(__cs, __cs + 9, __wcs);
689 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
694 __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 0, 23, 2,
699 __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 1, 12, 2,
704 __beg = _M_extract_num(__beg, __end, __mem, 1, 12, 2,
707 __tm->tm_mon = __mem - 1;
711 __beg = _M_extract_num(__beg, __end, __tm->tm_min, 0, 59, 2,
715 if (__ctype.narrow(*__beg, 0) ==
'\n')
718 __tmperr |= ios_base::failbit;
723 __ctype.widen(__cs, __cs + 6, __wcs);
724 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
730 #ifdef _GLIBCXX_USE_C99
731 __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 60, 2,
733 __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 61, 2,
738 if (__ctype.narrow(*__beg, 0) ==
'\t')
741 __tmperr |= ios_base::failbit;
746 __ctype.widen(__cs, __cs + 9, __wcs);
747 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
752 const char_type* __dates[2];
753 __tp._M_date_formats(__dates);
754 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
759 const char_type* __times[2];
760 __tp._M_time_formats(__times);
761 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
767 __beg = _M_extract_num(__beg, __end, __tm->tm_year, 0, 99, 2,
772 __beg = _M_extract_num(__beg, __end, __mem, 0, 9999, 4,
775 __tm->tm_year = __mem - 1900;
779 if (__ctype.is(ctype_base::upper, *__beg))
782 __beg = _M_extract_name(__beg, __end, __tmp,
783 __timepunct_cache<_CharT>::_S_timezones,
787 if (__beg != __end && !__tmperr && __tmp == 0
788 && (*__beg == __ctype.widen(
'-')
789 || *__beg == __ctype.widen(
'+')))
791 __beg = _M_extract_num(__beg, __end, __tmp, 0, 23, 2,
793 __beg = _M_extract_num(__beg, __end, __tmp, 0, 59, 2,
798 __tmperr |= ios_base::failbit;
802 __tmperr |= ios_base::failbit;
808 if (__format[__i] == *__beg)
811 __tmperr |= ios_base::failbit;
816 __err |= ios_base::failbit;
821 template<
typename _CharT,
typename _InIter>
823 time_get<_CharT, _InIter>::
824 _M_extract_num(iter_type __beg, iter_type __end,
int& __member,
825 int __min,
int __max,
size_t __len,
826 ios_base& __io, ios_base::iostate& __err)
const
828 const locale& __loc = __io._M_getloc();
829 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
832 int __mult = __len == 2 ? 10 : (__len == 4 ? 1000 : 1);
837 for (; __beg != __end && __i < __len; ++__beg, ++__i)
839 const char __c = __ctype.narrow(*__beg,
'*');
840 if (__c >=
'0' && __c <=
'9')
842 __value = __value * 10 + (__c -
'0');
843 const int __valuec = __value * __mult;
844 if (__valuec > __max || __valuec + __mult < __min)
854 __err |= ios_base::failbit;
861 template<
typename _CharT,
typename _InIter>
863 time_get<_CharT, _InIter>::
864 _M_extract_name(iter_type __beg, iter_type __end,
int& __member,
865 const _CharT** __names,
size_t __indexlen,
866 ios_base& __io, ios_base::iostate& __err)
const
868 typedef char_traits<_CharT> __traits_type;
869 const locale& __loc = __io._M_getloc();
870 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
872 int* __matches =
static_cast<int*
>(__builtin_alloca(
sizeof(
int)
874 size_t __nmatches = 0;
876 bool __testvalid =
true;
877 const char_type* __name;
885 const char_type __c = *__beg;
886 for (
size_t __i1 = 0; __i1 < __indexlen; ++__i1)
887 if (__c == __names[__i1][0]
888 || __c == __ctype.toupper(__names[__i1][0]))
889 __matches[__nmatches++] = __i1;
892 while (__nmatches > 1)
895 size_t __minlen = __traits_type::length(__names[__matches[0]]);
896 for (
size_t __i2 = 1; __i2 < __nmatches; ++__i2)
898 __traits_type::length(__names[__matches[__i2]]));
900 if (__pos < __minlen && __beg != __end)
901 for (
size_t __i3 = 0; __i3 < __nmatches;)
903 __name = __names[__matches[__i3]];
904 if (!(__name[__pos] == *__beg))
905 __matches[__i3] = __matches[--__nmatches];
917 __name = __names[__matches[0]];
918 const size_t __len = __traits_type::length(__name);
919 while (__pos < __len && __beg != __end && __name[__pos] == *__beg)
923 __member = __matches[0];
930 __err |= ios_base::failbit;
935 template<
typename _CharT,
typename _InIter>
937 time_get<_CharT, _InIter>::
939 ios_base::iostate& __err, tm* __tm)
const
942 const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
944 __tp._M_time_formats(__times);
945 __beg = _M_extract_via_format(__beg, __end, __io, __err,
948 __err |= ios_base::eofbit;
952 template<
typename _CharT,
typename _InIter>
956 ios_base::iostate& __err, tm* __tm)
const
959 const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
961 __tp._M_date_formats(__dates);
962 __beg = _M_extract_via_format(__beg, __end, __io, __err,
965 __err |= ios_base::eofbit;
969 template<
typename _CharT,
typename _InIter>
973 ios_base::iostate& __err, tm* __tm)
const
977 const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
978 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
980 __tp._M_days_abbreviated(__days);
982 ios_base::iostate __tmperr = ios_base::goodbit;
983 __beg = _M_extract_name(__beg, __end, __tmpwday, __days, 7,
992 if (!__tmperr && __beg != __end)
994 size_t __pos = __traits_type::length(__days[__tmpwday]);
995 __tp._M_days(__days);
996 const char_type* __name = __days[__tmpwday];
997 if (__name[__pos] == *__beg)
1000 const size_t __len = __traits_type::length(__name);
1001 while (__pos < __len && __beg != __end
1002 && __name[__pos] == *__beg)
1005 __tmperr |= ios_base::failbit;
1009 __tm->tm_wday = __tmpwday;
1011 __err |= ios_base::failbit;
1014 __err |= ios_base::eofbit;
1018 template<
typename _CharT,
typename _InIter>
1022 ios_base& __io, ios_base::iostate& __err, tm* __tm)
const
1026 const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
1027 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
1029 __tp._M_months_abbreviated(__months);
1031 ios_base::iostate __tmperr = ios_base::goodbit;
1032 __beg = _M_extract_name(__beg, __end, __tmpmon, __months, 12,
1041 if (!__tmperr && __beg != __end)
1043 size_t __pos = __traits_type::length(__months[__tmpmon]);
1044 __tp._M_months(__months);
1045 const char_type* __name = __months[__tmpmon];
1046 if (__name[__pos] == *__beg)
1049 const size_t __len = __traits_type::length(__name);
1050 while (__pos < __len && __beg != __end
1051 && __name[__pos] == *__beg)
1054 __tmperr |= ios_base::failbit;
1058 __tm->tm_mon = __tmpmon;
1060 __err |= ios_base::failbit;
1063 __err |= ios_base::eofbit;
1067 template<
typename _CharT,
typename _InIter>
1071 ios_base::iostate& __err, tm* __tm)
const
1074 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
1078 for (; __beg != __end && __i < 4; ++__beg, ++__i)
1080 const char __c = __ctype.
narrow(*__beg,
'*');
1081 if (__c >=
'0' && __c <=
'9')
1082 __value = __value * 10 + (__c -
'0');
1086 if (__i == 2 || __i == 4)
1087 __tm->tm_year = __i == 2 ? __value : __value - 1900;
1089 __err |= ios_base::failbit;
1092 __err |= ios_base::eofbit;
1096 template<
typename _CharT,
typename _OutIter>
1100 const _CharT* __beg,
const _CharT* __end)
const
1103 ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
1104 for (; __beg != __end; ++__beg)
1105 if (__ctype.
narrow(*__beg, 0) !=
'%')
1110 else if (++__beg != __end)
1114 const char __c = __ctype.
narrow(*__beg, 0);
1115 if (__c !=
'E' && __c !=
'O')
1117 else if (++__beg != __end)
1120 __format = __ctype.
narrow(*__beg, 0);
1124 __s = this->do_put(__s, __io, __fill, __tm, __format, __mod);
1131 template<
typename _CharT,
typename _OutIter>
1135 char __format,
char __mod)
const
1138 ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
1139 __timepunct<_CharT>
const& __tp = use_facet<__timepunct<_CharT> >(__loc);
1143 const size_t __maxlen = 128;
1153 __fmt[0] = __ctype.
widen(
'%');
1156 __fmt[1] = __format;
1162 __fmt[2] = __format;
1166 __tp._M_put(__res, __maxlen, __fmt, __tm);
1176 #if _GLIBCXX_EXTERN_TEMPLATE
1183 extern template class __timepunct<char>;
1193 use_facet<moneypunct<char, true> >(
const locale&);
1197 use_facet<moneypunct<char, false> >(
const locale&);
1200 const money_put<char>&
1201 use_facet<money_put<char> >(
const locale&);
1204 const money_get<char>&
1205 use_facet<money_get<char> >(
const locale&);
1208 const __timepunct<char>&
1209 use_facet<__timepunct<char> >(
const locale&);
1213 use_facet<time_put<char> >(
const locale&);
1217 use_facet<time_get<char> >(
const locale&);
1221 use_facet<messages<char> >(
const locale&);
1225 has_facet<moneypunct<char> >(
const locale&);
1229 has_facet<money_put<char> >(
const locale&);
1233 has_facet<money_get<char> >(
const locale&);
1237 has_facet<__timepunct<char> >(
const locale&);
1241 has_facet<time_put<char> >(
const locale&);
1245 has_facet<time_get<char> >(
const locale&);
1249 has_facet<messages<char> >(
const locale&);
1251 #ifdef _GLIBCXX_USE_WCHAR_T
1258 extern template class __timepunct<wchar_t>;
1268 use_facet<moneypunct<wchar_t, true> >(
const locale&);
1271 const moneypunct<wchar_t, false>&
1272 use_facet<moneypunct<wchar_t, false> >(
const locale&);
1275 const money_put<wchar_t>&
1276 use_facet<money_put<wchar_t> >(
const locale&);
1279 const money_get<wchar_t>&
1280 use_facet<money_get<wchar_t> >(
const locale&);
1283 const __timepunct<wchar_t>&
1284 use_facet<__timepunct<wchar_t> >(
const locale&);
1288 use_facet<time_put<wchar_t> >(
const locale&);
1292 use_facet<time_get<wchar_t> >(
const locale&);
1296 use_facet<messages<wchar_t> >(
const locale&);
1300 has_facet<moneypunct<wchar_t> >(
const locale&);
1304 has_facet<money_put<wchar_t> >(
const locale&);
1308 has_facet<money_get<wchar_t> >(
const locale&);
1312 has_facet<__timepunct<wchar_t> >(
const locale&);
1316 has_facet<time_put<wchar_t> >(
const locale&);
1320 has_facet<time_get<wchar_t> >(
const locale&);
1324 has_facet<messages<wchar_t> >(
const locale&);
1328 _GLIBCXX_END_NAMESPACE