OSDN Git Service

* config/alpha/osf5.h (TARGET_C99_FUNCTIONS): Define.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / src / locale-inst.cc
1 // Locale support -*- C++ -*-
2
3 // Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library.  This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 2, or (at your option)
9 // any later version.
10
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING.  If not, write to the Free
18 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 // USA.
20
21 // As a special exception, you may use this file as part of a free software
22 // library without restriction.  Specifically, if other files instantiate
23 // templates or use macros or inline functions from this file, or you compile
24 // this file and link it with other files to produce an executable, this
25 // file does not by itself cause the resulting executable to be covered by
26 // the GNU General Public License.  This exception does not however
27 // invalidate any other reasons why the executable file might be covered by
28 // the GNU General Public License.
29
30 //
31 // ISO C++ 14882: 22.1  Locales
32 //
33
34 #include <cstdlib>
35 #include <clocale>
36 #include <cstring>
37 #include <locale>
38
39 namespace std
40 {
41   // moneypunct, money_get, and money_put
42   template class moneypunct<char, false>;
43   template class moneypunct<char, true>;
44   template class moneypunct_byname<char, false>;
45   template class moneypunct_byname<char, true>;
46   template class money_get<char, istreambuf_iterator<char> >;
47   template class money_put<char, ostreambuf_iterator<char> >;
48   template class __locale_cache<char>;
49
50 #ifdef _GLIBCPP_USE_WCHAR_T
51   template class moneypunct<wchar_t, false>;
52   template class moneypunct<wchar_t, true>;
53   template class moneypunct_byname<wchar_t, false>;
54   template class moneypunct_byname<wchar_t, true>;
55   template class money_get<wchar_t, istreambuf_iterator<wchar_t> >;
56   template class money_put<wchar_t, ostreambuf_iterator<wchar_t> >;
57   template class __locale_cache<wchar_t>;
58 #endif
59
60   // numpunct, numpunct_byname, num_get, and num_put
61   template class numpunct<char>;
62   template class numpunct_byname<char>;
63   template class num_get<char, istreambuf_iterator<char> >;
64   template class num_put<char, ostreambuf_iterator<char> >; 
65   template
66     ostreambuf_iterator<char>
67     num_put<char, ostreambuf_iterator<char> >::
68     _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, 
69                    long) const;
70
71   template
72     ostreambuf_iterator<char>
73     num_put<char, ostreambuf_iterator<char> >::
74     _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, 
75                    unsigned long) const;
76
77 #ifdef _GLIBCPP_USE_LONG_LONG
78   template
79     ostreambuf_iterator<char>
80     num_put<char, ostreambuf_iterator<char> >::
81     _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, 
82                    long long) const;
83
84   template
85     ostreambuf_iterator<char>
86     num_put<char, ostreambuf_iterator<char> >::
87     _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, 
88                    unsigned long long) const;
89 #endif
90
91   template
92     ostreambuf_iterator<char>
93     num_put<char, ostreambuf_iterator<char> >::
94     _M_convert_float(ostreambuf_iterator<char>, ios_base&, char, char, 
95                      double) const;
96
97   template
98     ostreambuf_iterator<char>
99     num_put<char, ostreambuf_iterator<char> >::
100     _M_convert_float(ostreambuf_iterator<char>, ios_base&, char, char, 
101                      long double) const;
102   
103 #ifdef _GLIBCPP_USE_WCHAR_T
104   template class numpunct<wchar_t>;
105   template class numpunct_byname<wchar_t>;
106   template class num_get<wchar_t, istreambuf_iterator<wchar_t> >;
107   template class num_put<wchar_t, ostreambuf_iterator<wchar_t> >;
108
109   template
110     ostreambuf_iterator<wchar_t>
111     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
112     _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, 
113                    long) const;
114
115   template
116     ostreambuf_iterator<wchar_t>
117     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
118     _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, 
119                    unsigned long) const;
120
121 #ifdef _GLIBCPP_USE_LONG_LONG
122   template
123     ostreambuf_iterator<wchar_t>
124     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
125     _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
126                    long long) const;
127
128   template
129     ostreambuf_iterator<wchar_t>
130     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
131     _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
132                    unsigned long long) const;
133 #endif
134
135   template
136     ostreambuf_iterator<wchar_t>
137     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
138     _M_convert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, 
139                      double) const;
140
141   template
142     ostreambuf_iterator<wchar_t>
143     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
144     _M_convert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, 
145                      long double) const;
146 #endif
147
148   // time_get and time_put
149   template class __timepunct<char>;
150   template class time_put<char, ostreambuf_iterator<char> >;
151   template class time_put_byname<char, ostreambuf_iterator<char> >;
152   template class time_get<char, istreambuf_iterator<char> >;
153   template class time_get_byname<char, istreambuf_iterator<char> >;
154
155 #ifdef _GLIBCPP_USE_WCHAR_T
156   template class __timepunct<wchar_t>;
157   template class time_put<wchar_t, ostreambuf_iterator<wchar_t> >;
158   template class time_put_byname<wchar_t, ostreambuf_iterator<wchar_t> >;
159   template class time_get<wchar_t, istreambuf_iterator<wchar_t> >;
160   template class time_get_byname<wchar_t, istreambuf_iterator<wchar_t> >;
161 #endif
162
163   // messages
164   template class messages<char>;
165   template class messages_byname<char>;
166 #ifdef _GLIBCPP_USE_WCHAR_T
167   template class messages<wchar_t>;
168   template class messages_byname<wchar_t>;
169 #endif
170   
171   // ctype
172   inline template class __ctype_abstract_base<char>;
173   template class ctype_byname<char>;
174 #ifdef _GLIBCPP_USE_WCHAR_T
175   inline template class __ctype_abstract_base<wchar_t>;
176   template class ctype_byname<wchar_t>;
177 #endif
178   
179   // codecvt
180   inline template class __codecvt_abstract_base<char, char, mbstate_t>;
181   template class codecvt_byname<char, char, mbstate_t>;
182 #ifdef _GLIBCPP_USE_WCHAR_T
183   inline template class __codecvt_abstract_base<wchar_t, char, mbstate_t>;
184   template class codecvt_byname<wchar_t, char, mbstate_t>;
185 #endif
186
187   // collate
188   template class collate<char>;
189   template class collate_byname<char>;
190 #ifdef _GLIBCPP_USE_WCHAR_T
191   template class collate<wchar_t>;
192   template class collate_byname<wchar_t>;
193 #endif
194     
195   // use_facet
196   // NB: use_facet<ctype> is specialized
197   template
198     const codecvt<char, char, mbstate_t>& 
199     use_facet<codecvt<char, char, mbstate_t> >(const locale&);
200
201   template
202     const collate<char>& 
203     use_facet<collate<char> >(const locale&);
204
205   template
206     const numpunct<char>& 
207     use_facet<numpunct<char> >(const locale&);
208
209   template 
210     const num_put<char>& 
211     use_facet<num_put<char> >(const locale&);
212
213   template 
214     const num_get<char>& 
215     use_facet<num_get<char> >(const locale&);
216
217   template
218     const moneypunct<char, true>& 
219     use_facet<moneypunct<char, true> >(const locale&);
220
221   template
222     const moneypunct<char, false>& 
223     use_facet<moneypunct<char, false> >(const locale&);
224
225   template 
226     const money_put<char>& 
227     use_facet<money_put<char> >(const locale&);
228
229   template 
230     const money_get<char>& 
231     use_facet<money_get<char> >(const locale&);
232
233   template
234     const __timepunct<char>& 
235     use_facet<__timepunct<char> >(const locale&);
236
237   template 
238     const time_put<char>& 
239     use_facet<time_put<char> >(const locale&);
240
241   template 
242     const time_get<char>& 
243     use_facet<time_get<char> >(const locale&);
244
245   template 
246     const messages<char>& 
247     use_facet<messages<char> >(const locale&);
248
249 #ifdef _GLIBCPP_USE_WCHAR_T
250   template
251     const codecvt<wchar_t, char, mbstate_t>& 
252     use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&);
253
254   template
255     const collate<wchar_t>& 
256     use_facet<collate<wchar_t> >(const locale&);
257
258   template
259     const numpunct<wchar_t>& 
260     use_facet<numpunct<wchar_t> >(const locale&);
261
262   template 
263     const num_put<wchar_t>& 
264     use_facet<num_put<wchar_t> >(const locale&);
265
266   template 
267     const num_get<wchar_t>& 
268     use_facet<num_get<wchar_t> >(const locale&);
269
270   template
271     const moneypunct<wchar_t, true>& 
272     use_facet<moneypunct<wchar_t, true> >(const locale&);
273
274   template
275     const moneypunct<wchar_t, false>& 
276     use_facet<moneypunct<wchar_t, false> >(const locale&);
277  
278   template 
279     const money_put<wchar_t>& 
280     use_facet<money_put<wchar_t> >(const locale&);
281
282   template 
283     const money_get<wchar_t>& 
284     use_facet<money_get<wchar_t> >(const locale&);
285
286   template
287     const __timepunct<wchar_t>& 
288     use_facet<__timepunct<wchar_t> >(const locale&);
289
290   template 
291     const time_put<wchar_t>& 
292     use_facet<time_put<wchar_t> >(const locale&);
293
294   template 
295     const time_get<wchar_t>& 
296     use_facet<time_get<wchar_t> >(const locale&);
297
298   template 
299     const messages<wchar_t>& 
300     use_facet<messages<wchar_t> >(const locale&);
301 #endif
302
303   // has_facet
304   template 
305     bool
306     has_facet<ctype<char> >(const locale&);
307
308   template 
309     bool
310     has_facet<codecvt<char, char, mbstate_t> >(const locale&);
311
312   template 
313     bool
314     has_facet<collate<char> >(const locale&);
315
316   template 
317     bool
318     has_facet<numpunct<char> >(const locale&);
319
320   template 
321     bool
322     has_facet<num_put<char> >(const locale&);
323
324   template 
325     bool
326     has_facet<num_get<char> >(const locale&);
327
328   template 
329     bool
330     has_facet<moneypunct<char> >(const locale&);
331
332   template 
333     bool
334     has_facet<money_put<char> >(const locale&);
335
336   template 
337     bool
338     has_facet<money_get<char> >(const locale&);
339
340   template 
341     bool
342     has_facet<__timepunct<char> >(const locale&);
343
344   template 
345     bool
346     has_facet<time_put<char> >(const locale&);
347
348   template 
349     bool
350     has_facet<time_get<char> >(const locale&);
351
352   template 
353     bool
354     has_facet<messages<char> >(const locale&);
355
356 #ifdef _GLIBCPP_USE_WCHAR_T
357  template 
358     bool
359     has_facet<ctype<wchar_t> >(const locale&);
360
361   template 
362     bool
363     has_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);
364
365   template 
366     bool
367     has_facet<collate<wchar_t> >(const locale&);
368
369   template 
370     bool
371     has_facet<numpunct<wchar_t> >(const locale&);
372
373   template 
374     bool
375     has_facet<num_put<wchar_t> >(const locale&);
376
377   template 
378     bool
379     has_facet<num_get<wchar_t> >(const locale&);
380
381   template 
382     bool
383     has_facet<moneypunct<wchar_t> >(const locale&);
384
385   template 
386     bool
387     has_facet<money_put<wchar_t> >(const locale&);
388
389   template 
390     bool
391     has_facet<money_get<wchar_t> >(const locale&);
392
393   template 
394     bool
395     has_facet<__timepunct<wchar_t> >(const locale&);
396
397   template 
398     bool
399     has_facet<time_put<wchar_t> >(const locale&);
400
401   template 
402     bool
403     has_facet<time_get<wchar_t> >(const locale&);
404
405   template 
406     bool
407     has_facet<messages<wchar_t> >(const locale&);
408 #endif
409
410   // locale
411   template
412     char*
413     __add_grouping<char>(char*, char, char const*, char const*, 
414                          char const*, char const*);
415
416   template
417     bool
418     __verify_grouping<char>(const basic_string<char>&, basic_string<char>&);
419
420   template class __pad<char, char_traits<char> >;
421
422 #ifdef _GLIBCPP_USE_WCHAR_T
423   template
424     wchar_t*
425     __add_grouping<wchar_t>(wchar_t*, wchar_t, char const*, char const*, 
426                             wchar_t const*, wchar_t const*);
427   template
428     bool
429     __verify_grouping<wchar_t>(const basic_string<wchar_t>&, 
430                                basic_string<wchar_t>&);
431
432   template class __pad<wchar_t, char_traits<wchar_t> >;
433 #endif 
434
435   template
436     int
437     __convert_from_v(char*, const int, const char*, double, 
438                      const __c_locale&, int);
439
440   template
441     int
442     __convert_from_v(char*, const int, const char*, long double, 
443                      const __c_locale&, int);
444
445   template
446     int
447     __convert_from_v(char*, const int, const char*, long, 
448                      const __c_locale&, int);
449
450   template
451     int
452     __convert_from_v(char*, const int, const char*, unsigned long, 
453                      const __c_locale&, int);
454
455 #ifdef _GLIBCPP_USE_LONG_LONG
456   template
457     int
458     __convert_from_v(char*, const int, const char*, long long, 
459                      const __c_locale&, int);
460
461   template
462     int
463     __convert_from_v(char*, const int, const char*, unsigned long long, 
464                      const __c_locale&, int);
465 #endif
466
467   template
468     int
469     __int_to_char(char*, const int, unsigned long, const char*, 
470                   ios_base::fmtflags, bool);
471
472 #ifdef _GLIBCPP_USE_WCHAR_T
473   template
474     int
475     __int_to_char(wchar_t*, const int, unsigned long, const wchar_t*, 
476                   ios_base::fmtflags, bool);
477 #endif
478
479 #ifdef _GLIBCPP_USE_LONG_LONG
480   template
481     int
482     __int_to_char(char*, const int, unsigned long long, const char*, 
483                   ios_base::fmtflags, bool);
484
485 #ifdef _GLIBCPP_USE_WCHAR_T
486   template
487     int
488     __int_to_char(wchar_t*, const int, unsigned long long, const wchar_t*,
489                   ios_base::fmtflags, bool);
490 #endif
491 #endif
492 } // namespace std