Import gcc-4.4.1
[dragonfly.git] / contrib / gcc-4.4 / libstdc++-v3 / src / locale-inst.cc
1 // Locale support -*- C++ -*-
2
3 // Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
4 // 2009 Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library.  This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
11
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 // GNU General Public License for more details.
16
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
20
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
24 // <http://www.gnu.org/licenses/>.
25
26 //
27 // ISO C++ 14882: 22.1  Locales
28 //
29
30 #include <locale>
31
32 // Instantiation configuration.
33 #ifndef C
34 # define C char
35 # define C_is_char
36 #endif
37
38 _GLIBCXX_BEGIN_NAMESPACE(std)
39
40   // moneypunct, money_get, and money_put
41   template class moneypunct<C, false>;
42   template class moneypunct<C, true>;
43   template struct __moneypunct_cache<C, false>;
44   template struct __moneypunct_cache<C, true>;
45   template class moneypunct_byname<C, false>;
46   template class moneypunct_byname<C, true>;
47 _GLIBCXX_BEGIN_LDBL_NAMESPACE
48   template class money_get<C, istreambuf_iterator<C> >;
49   template class money_put<C, ostreambuf_iterator<C> >;
50   template
51     istreambuf_iterator<C>
52     money_get<C, istreambuf_iterator<C> >::
53     _M_extract<true>(istreambuf_iterator<C>, istreambuf_iterator<C>,
54                      ios_base&, ios_base::iostate&, string&) const;
55
56   template
57     istreambuf_iterator<C>
58     money_get<C, istreambuf_iterator<C> >::
59     _M_extract<false>(istreambuf_iterator<C>, istreambuf_iterator<C>,
60                       ios_base&, ios_base::iostate&, string&) const;
61
62   template
63     ostreambuf_iterator<C>
64     money_put<C, ostreambuf_iterator<C> >::
65     _M_insert<true>(ostreambuf_iterator<C>, ios_base&, C, 
66                     const string_type&) const;
67
68   template
69     ostreambuf_iterator<C>
70     money_put<C, ostreambuf_iterator<C> >::
71     _M_insert<false>(ostreambuf_iterator<C>, ios_base&, C, 
72                      const string_type&) const;
73 _GLIBCXX_END_LDBL_NAMESPACE
74
75   // numpunct, numpunct_byname, num_get, and num_put
76   template class numpunct<C>;
77   template struct __numpunct_cache<C>;
78   template class numpunct_byname<C>;
79 _GLIBCXX_BEGIN_LDBL_NAMESPACE
80   template class num_get<C, istreambuf_iterator<C> >;
81   template class num_put<C, ostreambuf_iterator<C> >; 
82   template
83     istreambuf_iterator<C>
84     num_get<C, istreambuf_iterator<C> >::
85     _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
86                    ios_base&, ios_base::iostate&,
87                    long&) const;
88
89   template
90     istreambuf_iterator<C>
91     num_get<C, istreambuf_iterator<C> >::
92     _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
93                    ios_base&, ios_base::iostate&, 
94                    unsigned short&) const;
95
96   template
97     istreambuf_iterator<C>
98     num_get<C, istreambuf_iterator<C> >::
99     _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
100                    ios_base&, ios_base::iostate&,
101                    unsigned int&) const;
102
103   template
104     istreambuf_iterator<C>
105     num_get<C, istreambuf_iterator<C> >::
106     _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
107                    ios_base&, ios_base::iostate&,
108                    unsigned long&) const;
109
110 #ifdef _GLIBCXX_USE_LONG_LONG
111   template
112     istreambuf_iterator<C>
113     num_get<C, istreambuf_iterator<C> >::
114     _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
115                    ios_base&, ios_base::iostate&,
116                    long long&) const;
117
118   template
119     istreambuf_iterator<C>
120     num_get<C, istreambuf_iterator<C> >::
121     _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
122                    ios_base&, ios_base::iostate&,
123                    unsigned long long&) const;
124 #endif
125
126   template
127     ostreambuf_iterator<C>
128     num_put<C, ostreambuf_iterator<C> >::
129     _M_insert_int(ostreambuf_iterator<C>, ios_base&, C, 
130                   long) const;
131
132   template
133     ostreambuf_iterator<C>
134     num_put<C, ostreambuf_iterator<C> >::
135     _M_insert_int(ostreambuf_iterator<C>, ios_base&, C, 
136                   unsigned long) const;
137
138 #ifdef _GLIBCXX_USE_LONG_LONG
139   template
140     ostreambuf_iterator<C>
141     num_put<C, ostreambuf_iterator<C> >::
142     _M_insert_int(ostreambuf_iterator<C>, ios_base&, C, 
143                   long long) const;
144
145   template
146     ostreambuf_iterator<C>
147     num_put<C, ostreambuf_iterator<C> >::
148     _M_insert_int(ostreambuf_iterator<C>, ios_base&, C, 
149                   unsigned long long) const;
150 #endif
151
152   template
153     ostreambuf_iterator<C>
154     num_put<C, ostreambuf_iterator<C> >::
155     _M_insert_float(ostreambuf_iterator<C>, ios_base&, C, char, 
156                     double) const;
157
158   template
159     ostreambuf_iterator<C>
160     num_put<C, ostreambuf_iterator<C> >::
161     _M_insert_float(ostreambuf_iterator<C>, ios_base&, C, char, 
162                     long double) const;
163 _GLIBCXX_END_LDBL_NAMESPACE
164
165   // time_get and time_put
166   template class __timepunct<C>;
167   template struct __timepunct_cache<C>;
168   template class time_put<C, ostreambuf_iterator<C> >;
169   template class time_put_byname<C, ostreambuf_iterator<C> >;
170   template class time_get<C, istreambuf_iterator<C> >;
171   template class time_get_byname<C, istreambuf_iterator<C> >;
172
173   // messages
174   template class messages<C>;
175   template class messages_byname<C>;
176   
177   // ctype
178   inline template class __ctype_abstract_base<C>;
179   template class ctype_byname<C>;
180   
181   // codecvt
182   inline template class __codecvt_abstract_base<C, char, mbstate_t>;
183   template class codecvt_byname<C, char, mbstate_t>;
184
185   // collate
186   template class collate<C>;
187   template class collate_byname<C>;
188     
189   // use_facet
190   template
191     const ctype<C>& 
192     use_facet<ctype<C> >(const locale&);
193
194   template
195     const codecvt<C, char, mbstate_t>& 
196     use_facet<codecvt<C, char, mbstate_t> >(const locale&);
197
198   template
199     const collate<C>& 
200     use_facet<collate<C> >(const locale&);
201
202   template
203     const numpunct<C>& 
204     use_facet<numpunct<C> >(const locale&);
205
206   template 
207     const num_put<C>& 
208     use_facet<num_put<C> >(const locale&);
209
210   template 
211     const num_get<C>& 
212     use_facet<num_get<C> >(const locale&);
213
214   template
215     const moneypunct<C, true>& 
216     use_facet<moneypunct<C, true> >(const locale&);
217
218   template
219     const moneypunct<C, false>& 
220     use_facet<moneypunct<C, false> >(const locale&);
221
222   template 
223     const money_put<C>& 
224     use_facet<money_put<C> >(const locale&);
225
226   template 
227     const money_get<C>& 
228     use_facet<money_get<C> >(const locale&);
229
230   template
231     const __timepunct<C>& 
232     use_facet<__timepunct<C> >(const locale&);
233
234   template 
235     const time_put<C>& 
236     use_facet<time_put<C> >(const locale&);
237
238   template 
239     const time_get<C>& 
240     use_facet<time_get<C> >(const locale&);
241
242   template 
243     const messages<C>& 
244     use_facet<messages<C> >(const locale&);
245
246   // has_facet
247   template 
248     bool
249     has_facet<ctype<C> >(const locale&);
250
251   template 
252     bool
253     has_facet<codecvt<C, char, mbstate_t> >(const locale&);
254
255   template 
256     bool
257     has_facet<collate<C> >(const locale&);
258
259   template 
260     bool
261     has_facet<numpunct<C> >(const locale&);
262
263   template 
264     bool
265     has_facet<num_put<C> >(const locale&);
266
267   template 
268     bool
269     has_facet<num_get<C> >(const locale&);
270
271   template 
272     bool
273     has_facet<moneypunct<C> >(const locale&);
274
275   template 
276     bool
277     has_facet<money_put<C> >(const locale&);
278
279   template 
280     bool
281     has_facet<money_get<C> >(const locale&);
282
283   template 
284     bool
285     has_facet<__timepunct<C> >(const locale&);
286
287   template 
288     bool
289     has_facet<time_put<C> >(const locale&);
290
291   template 
292     bool
293     has_facet<time_get<C> >(const locale&);
294
295   template 
296     bool
297     has_facet<messages<C> >(const locale&);
298
299
300   // locale functions.
301   template
302     C*
303     __add_grouping<C>(C*, C, char const*, size_t, 
304                          C const*, C const*);
305
306   template class __pad<C, char_traits<C> >;
307
308   template
309     int
310     __int_to_char(C*, unsigned long, const C*,
311                   ios_base::fmtflags, bool);
312
313 #ifdef _GLIBCXX_USE_LONG_LONG
314   template
315     int
316     __int_to_char(C*, unsigned long long, const C*, 
317                   ios_base::fmtflags, bool);
318 #endif
319
320 _GLIBCXX_END_NAMESPACE
321
322 // XXX GLIBCXX_ABI Deprecated
323 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined C_is_char
324
325 #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
326   extern "C" void ldbl (void) __attribute__ ((alias (#dbl), weak))
327
328 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIjEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
329                      _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIjEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
330 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIlEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
331                      _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIlEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
332 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intImEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
333                      _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intImEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
334 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intItEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
335                      _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intItEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
336 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIxEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
337                      _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIxEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
338 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIyEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_,
339                      _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIyEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_);
340 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_basecT_,
341                      _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES3_S3_RSt8ios_basecT_);
342 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intImEES4_S4_RSt8ios_basecT_,
343                      _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intImEES3_S3_RSt8ios_basecT_);
344 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIxEES4_S4_RSt8ios_basecT_,
345                      _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIxEES3_S3_RSt8ios_basecT_);
346 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIyEES4_S4_RSt8ios_basecT_,
347                      _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIyEES3_S3_RSt8ios_basecT_);
348 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES4_S4_RSt8ios_baseccT_,
349                      _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_);
350 _GLIBCXX_LDBL_COMPAT(_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_,
351                      _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIeEES3_S3_RSt8ios_baseccT_);
352 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb0EEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRSs,
353                      _ZNKSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb0EEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRSs);
354 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb1EEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRSs,
355                      _ZNKSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb1EEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRSs);
356 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb0EEES4_S4_RSt8ios_basecRKSs,
357                      _ZNKSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb0EEES3_S3_RSt8ios_basecRKSs);
358 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb1EEES4_S4_RSt8ios_basecRKSs,
359                      _ZNKSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb1EEES3_S3_RSt8ios_basecRKSs);
360
361 #endif // _GLIBCXX_LONG_DOUBLE_COMPAT