1 // Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 2, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING. If not, write to the Free
16 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 // As a special exception, you may use this file as part of a free software
20 // library without restriction. Specifically, if other files instantiate
21 // templates or use macros or inline functions from this file, or you compile
22 // this file and link it with other files to produce an executable, this
23 // file does not by itself cause the resulting executable to be covered by
24 // the GNU General Public License. This exception does not however
25 // invalidate any other reasons why the executable file might be covered by
26 // the GNU General Public License.
28 #include <bits/std_clocale.h>
29 #include <bits/std_cstring.h>
30 #include <bits/std_cassert.h>
31 #include <bits/std_cctype.h>
32 #include <bits/std_limits.h>
34 #include <bits/std_stdexcept.h>
35 #include <bits/std_locale.h>
36 #include <bits/std_istream.h>
37 #include <bits/std_ostream.h>
38 #include <bits/std_vector.h>
39 #include <bits/std_memory.h> // for auto_ptr
40 #ifdef _GLIBCPP_USE_WCHAR_T
41 # include <bits/std_cwctype.h> // for towupper, etc.
46 // Definitions for static const data members of locale.
47 const locale::category locale::none;
48 const locale::category locale::collate;
49 const locale::category locale::ctype;
50 const locale::category locale::monetary;
51 const locale::category locale::numeric;
52 const locale::category locale::time;
53 const locale::category locale::messages;
54 const locale::category locale::all;
56 locale::_Impl* locale::_S_global;
57 locale::_Impl* locale::_S_classic;
58 const int locale::_S_categories_num;
59 const int locale::_S_facets_num;
61 // Definitions for static const data members of locale::_Impl
62 const locale::id* const
63 locale::_Impl::_S_id_collate[] =
65 &std::collate<char>::id,
66 #ifdef _GLIBCPP_USE_WCHAR_T
67 &std::collate<wchar_t>::id,
72 const locale::id* const
73 locale::_Impl::_S_id_ctype[] =
75 &std::ctype<char>::id,
76 #ifdef _GLIBCPP_USE_WCHAR_T
77 &std::ctype<wchar_t>::id,
79 &std::codecvt<char, char, mbstate_t>::id,
80 #ifdef _GLIBCPP_USE_WCHAR_T
81 &std::codecvt<wchar_t, char, mbstate_t>::id,
86 const locale::id* const
87 locale::_Impl::_S_id_monetary[] =
89 &std::moneypunct<char, false>::id,
90 #ifdef _GLIBCPP_USE_WCHAR_T
91 &std::moneypunct<wchar_t, false>::id,
93 &std::moneypunct<char,true >::id,
94 #ifdef _GLIBCPP_USE_WCHAR_T
95 &std::moneypunct<wchar_t,true >::id,
97 &std::money_get<char>::id,
98 #ifdef _GLIBCPP_USE_WCHAR_T
99 &std::money_get<wchar_t>::id,
101 &std::money_put<char>::id,
102 #ifdef _GLIBCPP_USE_WCHAR_T
103 &std::money_put<wchar_t>::id,
108 const locale::id* const
109 locale::_Impl::_S_id_numeric[] =
111 &std::numpunct<char>::id,
112 #ifdef _GLIBCPP_USE_WCHAR_T
113 &std::numpunct<wchar_t>::id,
115 &std::num_get<char>::id,
116 #ifdef _GLIBCPP_USE_WCHAR_T
117 &std::num_get<wchar_t>::id,
119 &std::num_put<char>::id,
120 #ifdef _GLIBCPP_USE_WCHAR_T
121 &std::num_put<wchar_t>::id,
126 const locale::id* const
127 locale::_Impl::_S_id_time[] =
129 &std::time_get<char>::id,
130 #ifdef _GLIBCPP_USE_WCHAR_T
131 &std::time_get<wchar_t>::id,
133 &std::time_put<char>::id,
134 #ifdef _GLIBCPP_USE_WCHAR_T
135 &std::time_put<wchar_t>::id,
140 const locale::id* const
141 locale::_Impl::_S_id_messages[] =
143 &std::time_get<char>::id,
144 #ifdef _GLIBCPP_USE_WCHAR_T
145 &std::time_get<wchar_t>::id,
147 &std::time_put<char>::id,
148 #ifdef _GLIBCPP_USE_WCHAR_T
149 &std::time_put<wchar_t>::id,
154 const locale::id* const* const
155 locale::_Impl::_S_facet_categories[] =
157 // order must match the decl order in class locale.
158 locale::_Impl::_S_id_collate,
159 locale::_Impl::_S_id_ctype,
160 locale::_Impl::_S_id_monetary,
161 locale::_Impl::_S_id_numeric,
162 locale::_Impl::_S_id_time,
163 locale::_Impl::_S_id_messages,
167 // Definitions for static const data members of locale::id
168 size_t locale::id::_S_highwater; // init'd to 0 by linker
170 // Definitions for static const data members of money_base
171 const money_base::pattern
172 money_base::_S_default_pattern = {{symbol, sign, none, value}};;
175 _Format_cache<char>::_Format_cache()
177 _M_decimal_point('.'), _M_thousands_sep(','),
178 _M_truename("true"), _M_falsename("false"), _M_use_grouping(false)
181 #ifdef _GLIBCPP_USE_WCHAR_T
183 _Format_cache<wchar_t>::_Format_cache()
185 _M_decimal_point(L'.'), _M_thousands_sep(L','),
186 _M_truename(L"true"), _M_falsename(L"false"), _M_use_grouping(false)
192 use_facet<const ctype<char> > (const locale& __loc)
194 size_t __i = ctype<char>::id._M_index;
195 const locale::_Impl* __tmp = __loc._M_impl;
196 return static_cast<const ctype<char>&>(* (*(__tmp->_M_facets))[__i]);
199 #ifdef _GLIBCPP_USE_WCHAR_T
201 const ctype<wchar_t>&
202 use_facet< const ctype<wchar_t> > (const locale& __loc)
204 size_t __i = ctype<wchar_t>::id._M_index;
205 const locale::_Impl* __tmp = __loc._M_impl;
206 return static_cast<const ctype<wchar_t>&>(* (*(__tmp->_M_facets))[__i]);
212 num_get<char, istreambuf_iterator<char> >::
213 _M_extract(istreambuf_iterator<char> __beg,
214 istreambuf_iterator<char> __end, ios_base& __io,
215 ios_base::iostate& __err, char* __xtrc, int& __base,
218 typedef _Format_cache<char> __cache_type;
220 // Prepare for possible failure
223 // Stage 1: determine a conversion specifier.
224 ios_base::fmtflags __basefield = __io.flags() & ios_base::basefield;
225 if (__basefield == ios_base::dec)
227 else if (__basefield == ios_base::oct)
229 else if (__basefield == ios_base::hex)
233 // As far as I can tell, bases other than 10 are not available for
234 // floating point types
238 // Stage 2: extract characters.
239 __cache_type const* __fmt = __cache_type::_S_get(__io);
240 bool __valid = __beg != __end;
241 // Fail quickly if !__valid
244 __err |= (ios_base::eofbit | ios_base::failbit);
248 // Acceptable formats for numbers here are based on 22.2.3.1
252 const char* __lits = __fmt->_S_literals;
255 // Check first for sign
256 bool __testsign = false;
257 if ((__c == __lits[__cache_type::_S_minus])
258 || (__c == __lits[__cache_type::_S_plus]))
260 __xtrc[__pos++] = __c;
263 // whitespace may follow a sign
264 while ((__beg != __end) && (isspace(*__beg)))
267 // There had better be more to come...
270 __xtrc[__pos] = '\0';
271 __err |= (ios_base::eofbit | ios_base::failbit);
276 bool __testzero = false; // Has there been a leading zero?
278 // Now check if first character is a zero
280 if (__c == __lits[__cache_type::_S_digits])
285 // We have to check for __beg == __end here. If so,
286 // a plain '0' (possibly with a sign) can be got rid of now
289 __xtrc[__pos++] = __c;
290 __xtrc[__pos] = '\0';
291 __err |= ios_base::eofbit;
295 // Figure out base for integer types only
296 // Based on Table 55 of 22.2.2.1.2
297 if (!__fp && __base != 10 && __base != 8)
299 // Here, __base == 0 or 16
301 if ((__c == __lits[__cache_type::_S_x])
302 || (__c == __lits[__cache_type::_S_X]))
306 __testzero = false; // "0x" is not a leading zero
308 else if (__base == 0)
312 // Remove any more leading zeros
313 while (__beg != __end)
315 if (*__beg == __lits[__cache_type::_S_digits])
324 else if (__base == 0) // 1st character is not zero
327 // We now seek "units", i.e. digits and thousands separators.
328 // We may need to know if anything is found here. A leading zero
329 // (removed by now) would count.
330 bool __testunits = __testzero;
331 while (__valid && __beg != __end)
335 const char* __p = strchr(__fmt->_S_literals, __c);
337 // NB: strchr returns true for __c == 0x0
340 // Try first for acceptable digit; record it if found
341 if ((__p >= &__lits[__cache_type::_S_digits]
342 && __p < &__lits[__cache_type::_S_digits + __base])
343 || (__p >= &__lits[__cache_type::_S_udigits]
344 && __p < &__lits[__cache_type::_S_udigits + __base]))
346 __xtrc[__pos++] = __c;
352 else if (__c == __fmt->_M_thousands_sep
353 && __fmt->_M_use_grouping)
355 // NB: Thousands separator at the beginning of a string
356 // is a no-no, as is two consecutive thousands
360 __grp += static_cast<char>(__sep_pos);
365 __err |= ios_base::failbit;
371 // Digit grouping is checked. If _M_groupings() doesn't
372 // match, then get very very upset, and set failbit.
373 if (__fmt->_M_use_grouping && !__grp.empty())
375 // Add the ending grouping
376 __grp += static_cast<char>(__sep_pos);
378 // __grp is parsed L to R
379 // 1,222,444 == __grp of "/1/3/3"
380 // __fmt->_M_grouping is parsed R to L
381 // 1,222,444 == __fmt->_M_grouping of "/3" == "/3/3/3"
384 const int __len = __fmt->_M_grouping.size();
385 int __n = __grp.size();
388 // Parsed number groupings have to match the
389 // numpunct::grouping string exactly, starting at the
390 // right-most point of the parsed sequence of elements ...
391 while (__test && __i < __n - 1)
392 for (__j = 0; __test && __j < __len && __i < __n - 1; ++__j,++__i)
393 __test &= __fmt->_M_grouping[__j] == __grp[__n - __i - 1];
394 // ... but the last parsed grouping can be <= numpunct
396 __j == __len ? __j = 0 : __j;
397 __test &= __fmt->_M_grouping[__j] >= __grp[__n - __i - 1];
401 __err |= ios_base::failbit;
402 __xtrc[__pos] = '\0';
404 __err |= ios_base::eofbit;
409 // If there was nothing but zeros, put one in the output string
410 if (__testzero && (__pos == 0 || (__pos == 1 && __testsign)))
411 __xtrc[__pos++] = __lits[__cache_type::_S_digits];
413 // That's it for integer types. Remaining code is for floating point
414 if (__fp && __beg != __end)
417 // Check first for decimal point. There MUST be one if
418 // __testunits is false.
419 bool __testdec = false; // Is there a decimal point
420 // with digits following it?
421 if (__c == __fmt->_M_decimal_point)
423 __xtrc[__pos++] = '.';
425 // Now we get any digits after the decimal point
426 // There MUST be some if __testunits is false.
427 while (__beg != __end)
430 const char* __p = strchr(__fmt->_S_literals, __c);
431 if ((__p >= &__lits[__cache_type::_S_digits]
432 && __p < &__lits[__cache_type::_S_digits + __base])
433 || (__p >= &__lits[__cache_type::_S_udigits]
434 && __p < &__lits[__cache_type::_S_udigits + __base]))
436 __xtrc[__pos++] = __c;
444 if (!__testunits && !__testdec) // Ill formed
446 __err |= ios_base::failbit;
447 __xtrc[__pos] = '\0';
449 __err |= ios_base::eofbit;
453 // Now we may find an exponent
457 if ((__c == __lits[__cache_type::_S_ee])
458 || (__c == __lits[__cache_type::_S_Ee]))
460 __xtrc[__pos++] = __c;
462 // Now there may be a sign
466 if ((__c == __lits[__cache_type::_S_minus])
467 || (__c == __lits[__cache_type::_S_plus]))
469 __xtrc[__pos++] = __c;
471 // whitespace may follow a sign
472 while ((__beg != __end) && (isspace(*__beg)))
477 // And now there must be some digits
480 __xtrc[__pos] = '\0';
481 __err |= (ios_base::eofbit | ios_base::failbit);
484 while (__beg != __end)
487 const char* __p = strchr(__fmt->_S_literals, __c);
488 if ((__p >= &__lits[__cache_type::_S_digits]
489 && __p < &__lits[__cache_type::_S_digits + __base])
490 || (__p >= &__lits[__cache_type::_S_udigits]
491 && __p < &__lits[__cache_type::_S_udigits + __base]))
493 __xtrc[__pos++] = __c;
501 // Finally, that's it for floating point
505 __xtrc[__pos] = '\0';
507 __err |= ios_base::eofbit;
510 // The following code uses sprintf() to convert floating point
511 // values for insertion into a stream. The current implementation
512 // replicates the code in _S_pad_numeric() (in _S_output_float()) in
513 // order to prevent having to create a "wide" buffer in addition to
514 // the "narrow" buffer passed to sprintf(). An optimization would be
515 // to replace sprintf() with code that works directly on a wide
516 // buffer and then use _S_pad_numeric() to do the padding. It would
517 // be good to replace sprintf() anyway to avoid accidental buffer
518 // overruns and to gain back the efficiency that C++ provides by
519 // knowing up front the type of the values to insert. This
520 // implementation follows the C++ standard fairly directly as
521 // outlined in 22.2.2.2 [lib.locale.num.put]
523 _S_build_float_format(ios_base& __io, char* __fptr, char __modifier,
526 bool __incl_prec = false;
527 ios_base::fmtflags __flags = __io.flags();
529 // [22.2.2.2.2] Table 60
530 if (__flags & ios_base::showpos)
532 if (__flags & ios_base::showpoint)
534 // As per [22.2.2.2.2.11]
535 if (__flags & ios_base::fixed || __prec > 0)
542 *__fptr++ = __modifier;
543 ios_base::fmtflags __fltfield = __flags & ios_base::floatfield;
544 // [22.2.2.2.2] Table 58
545 if (__fltfield == ios_base::fixed)
547 else if (__fltfield == ios_base::scientific)
548 *__fptr++ = (__flags & ios_base::uppercase) ? 'E' : 'e';
550 *__fptr++ = (__flags & ios_base::uppercase) ? 'G' : 'g';
556 locale::locale(_Impl* __ip) throw()
558 { __ip->_M_add_reference(); }
561 locale::locale(const char* __name)
565 if (strcmp(__name, "C") == 0 || strcmp(__name, "POSIX") == 0)
566 (_M_impl = _S_classic)->_M_add_reference();
569 _M_impl = new _Impl(_S_facets_num, 1, true, __name);
572 throw runtime_error("attempt to create named locale from NULL name");
575 locale::locale(const locale& __other, const char* __name, category __cat)
579 if (__other.name() == __name)
580 (_M_impl = __other._M_impl)->_M_add_reference();
583 _M_impl = new _Impl(*__other._M_impl, __name, __cat, 1);
586 throw runtime_error("attempt to create locale from NULL named locale");
589 locale::locale(const locale& __other, const locale& __one, category __cat)
591 __cat = _S_normalize_category(__cat); // might throw
592 _M_impl = new _Impl(*__other._M_impl, 1); // might throw
595 _M_impl->_M_replace_categories(__one._M_impl, __cat);
598 _M_impl->_M_remove_reference();
603 // _M_impl->_M_cached_name_ok = false;
604 if (!__other._M_impl->_M_has_name)
605 _M_impl->_M_has_name = false;
609 locale::operator==(const locale& __rhs) const throw()
611 return((this->name() != "*" && this->name() == __rhs.name())
612 || _M_impl == __rhs._M_impl);
616 locale::operator=(const locale& __other) throw()
618 __other._M_impl->_M_add_reference();
619 _M_impl->_M_remove_reference();
620 _M_impl = __other._M_impl;
625 locale::global(const locale& __other)
629 locale __keep(_S_global);
630 __other._M_impl->_M_add_reference();
631 _S_global->_M_remove_reference();
632 _S_global = __other._M_impl;
633 if (_S_global->_M_has_name)
634 setlocale(LC_ALL, __other.name().c_str());
640 { return _M_impl->_M_name; }
645 static locale* __classic_locale;
650 // 26 Standard facets, 2 references.
651 // One reference for _M_classic, one for _M_global
652 _S_classic = new _Impl(_S_facets_num, 2, true, "C");
653 _S_global = _S_classic;
655 _S_classic->_M_facet_init(new std::collate<char>);
656 _S_classic->_M_facet_init(new std::ctype<char>);
657 _S_classic->_M_facet_init(new codecvt<char, char, mbstate_t>);
658 _S_classic->_M_facet_init(new moneypunct<char, false>);
659 _S_classic->_M_facet_init(new moneypunct<char,true >);
660 _S_classic->_M_facet_init(new money_get<char>);
661 _S_classic->_M_facet_init(new money_put<char>);
662 _S_classic->_M_facet_init(new numpunct<char>);
663 _S_classic->_M_facet_init(new num_get<char>);
664 _S_classic->_M_facet_init(new num_put<char>);
665 _S_classic->_M_facet_init(new time_get<char>);
666 _S_classic->_M_facet_init(new time_put<char>);
667 _S_classic->_M_facet_init(new std::messages<char>);
669 #ifdef _GLIBCPP_USE_WCHAR_T
670 _S_classic->_M_facet_init(new std::collate<wchar_t>);
671 _S_classic->_M_facet_init(new std::ctype<wchar_t>);
672 _S_classic->_M_facet_init(new codecvt<wchar_t, char, mbstate_t>);
673 _S_classic->_M_facet_init(new moneypunct<wchar_t, false>);
674 _S_classic->_M_facet_init(new moneypunct<wchar_t,true >);
675 _S_classic->_M_facet_init(new money_get<wchar_t>);
676 _S_classic->_M_facet_init(new money_put<wchar_t>);
677 _S_classic->_M_facet_init(new numpunct<wchar_t>);
678 _S_classic->_M_facet_init(new num_get<wchar_t>);
679 _S_classic->_M_facet_init(new num_put<wchar_t>);
680 _S_classic->_M_facet_init(new time_get<wchar_t>);
681 _S_classic->_M_facet_init(new time_put<wchar_t>);
682 _S_classic->_M_facet_init(new std::messages<wchar_t>);
685 // Finesse static init order hassles
686 __classic_locale = new locale(_S_classic);
689 delete __classic_locale;
692 _S_classic->_M_remove_reference();
693 _S_global->_M_remove_reference();
695 _S_classic = _S_global = 0;
700 return *__classic_locale;
704 locale::_S_normalize_category(int __cat)
707 if ((__cat & all) && !(__cat & ~all))
711 // NB: May be a C-style "LC_ALL" category; convert.
729 #ifdef _GLIBCPP_HAVE_LC_MESSAGES
738 throw runtime_error("bad locale category");
745 facet(size_t __refs) throw()
746 : _M_references(__refs - 1)
751 _M_add_reference() throw()
759 _M_remove_reference() throw()
761 if (this && _M_references-- == 0)
774 { return "bad_cast thrown from use_facet"; }
777 ~_Bad_use_facet() throw() { }
779 // Platform-specific initialization code for ctype tables.
780 #include <bits/ctype_noninline.h>
782 locale::id ctype<char>::id;
784 const size_t ctype<char>::table_size;
786 ctype<char>::~ctype()
787 { if (_M_del) delete[] this->table(); }
790 ctype<char>::do_widen(char __c) const
794 ctype<char>::do_widen(const char* __low, const char* __high,
797 memcpy(__dest, __low, __high - __low);
802 ctype<char>::do_narrow(char __c, char /*__dfault*/) const
806 ctype<char>::do_narrow(const char* __low, const char* __high,
807 char /*__dfault*/, char* __dest) const
809 memcpy(__dest, __low, __high - __low);
813 ctype_byname<char>::ctype_byname(const char* /*__s*/, size_t __refs)
814 : ctype<char>(new mask[table_size], true, __refs)
817 locale::id collate<char>::id;
819 collate<char>::collate(size_t __refs)
820 : _Collate<char>(__refs) { }
822 collate<char>::~collate() { }
825 collate<char>::do_compare(const char* __lo1, const char* __hi1,
826 const char* __lo2, const char* __hi2) const
828 for (; __lo1 < __hi1 && __lo2 < __hi2; ++__lo1, ++__lo2)
829 if (*__lo1 != *__lo2)
830 return (*__lo1 < *__lo2) ? -1 : 1;
833 else if (__lo2 < __hi2)
841 do_transform(const char* __lo, const char* __hi) const
842 { return string(__lo, __hi - __lo); }
846 do_hash(const char* __lo, const char* __hi) const
848 unsigned long __val = 0xdeadbeef;
849 for (; __lo < __hi; ++__lo)
850 __val = *__lo ^ ((__val << 7) &
851 (__val >> (numeric_limits<unsigned long>::digits - 1)));
855 collate_byname<char>::collate_byname(const char* /*__s*/, size_t __refs)
856 : collate<char>(__refs) { }
858 numpunct_byname<char>::numpunct_byname(const char* /*__s*/, size_t __refs)
859 : numpunct<char>(__refs) { }
861 moneypunct_byname<char, false>::moneypunct_byname(const char* /*__s*/,
863 : moneypunct<char, false>(__refs) { }
865 moneypunct_byname<char, true>::moneypunct_byname(const char* /*__s*/,
867 : moneypunct<char, true>(__refs) { }
869 messages_byname<char>::
870 messages_byname(const char* /*__s*/, size_t __refs)
871 : messages<char>(__refs) { }
873 #ifdef _GLIBCPP_USE_WCHAR_T
874 locale::id ctype<wchar_t>::id;
879 // NB: These ctype<wchar_t> methods are not configuration-specific,
880 // unlike the ctype<char> bits.
881 ctype<wchar_t>::ctype(size_t __refs) : _Ctype<wchar_t>(__refs) { }
884 ctype<wchar_t>::do_toupper(wchar_t __c) const
885 { return towupper(__c); }
888 ctype<wchar_t>::do_toupper(wchar_t* __low, const wchar_t* __high) const
890 while (__low < __high)
892 *__low = towupper(*__low);
899 ctype<wchar_t>::do_tolower(wchar_t __c) const
900 { return towlower(__c); }
903 ctype<wchar_t>::do_tolower(wchar_t* __low, const wchar_t* __high) const
905 while (__low < __high)
907 *__low = towlower(*__low);
915 do_is(mask __m, char_type __c) const
916 { return static_cast<bool>(iswctype(__c, _M_convert_to_wmask(__m))); }
920 do_is(const wchar_t* __low, const wchar_t* __high, mask* __m) const
922 while (__low < __high && !this->is(*__m, *__low))
929 do_scan_is(mask __m, const wchar_t* __low, const wchar_t* __high) const
931 while (__low < __high && !this->is(__m, *__low))
938 do_scan_not(mask __m, const char_type* __low, const char_type* __high) const
940 while (__low < __high && this->is(__m, *__low) != 0)
947 do_widen(char __c) const
948 { return btowc(__c); }
952 do_widen(const char* __low, const char* __high, wchar_t* __dest) const
955 memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
956 mbsrtowcs(__dest, &__low, __high - __low, &__state);
962 do_narrow(wchar_t __wc, char __dfault) const
964 int __c = wctob(__wc);
965 return (__c == EOF ? __dfault : static_cast<char>(__c));
970 do_narrow(const wchar_t* __low, const wchar_t* __high, char __dfault,
974 memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
975 size_t __len = __high - __low;
976 size_t __conv = wcsrtombs(__dest, &__low, __len, &__state);
982 ctype_byname<wchar_t>::
983 ctype_byname(const char* /*__s*/, size_t __refs)
984 : ctype<wchar_t>(__refs) { }
986 locale::id collate<wchar_t>::id;
989 collate(size_t __refs)
990 : _Collate<wchar_t> (__refs) { }
997 do_compare(const wchar_t* /*__lo1*/, const wchar_t* /*__hi1*/,
998 const wchar_t* /*__lo2*/, const wchar_t* /*__hi2*/) const
1000 return 0; // XXX not done
1003 wstring collate<wchar_t>::
1004 do_transform(const wchar_t* /*__lo*/, const wchar_t* /*__hi*/) const
1006 return wstring(); // XXX not done
1009 long collate<wchar_t>::
1010 do_hash(const wchar_t* /*__lo*/, const wchar_t* /*__hi*/) const
1012 return 0; // XXX not done
1015 numpunct_byname<wchar_t>::
1016 numpunct_byname(const char* /*__s*/, size_t __refs)
1017 : numpunct<wchar_t> (__refs) { }
1019 collate_byname<wchar_t>::
1020 collate_byname(const char* /*__s*/, size_t __refs)
1021 : collate<wchar_t> (__refs) { }
1023 moneypunct_byname<wchar_t, false>::
1024 moneypunct_byname(const char* /*__s*/, size_t __refs)
1025 : moneypunct<wchar_t, false> (__refs) { }
1027 moneypunct_byname<wchar_t, true>::
1028 moneypunct_byname(const char* /*__s*/, size_t __refs)
1029 : moneypunct<wchar_t, true> (__refs) { }
1031 messages_byname<wchar_t>::
1032 messages_byname(const char* /*__s*/, size_t __refs)
1033 : messages<wchar_t> (__refs) { }
1034 #endif // _GLIBCPP_USE_WCHAR_T