OSDN Git Service

* src/Makefile.am (version_dep): New variable.
[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 struct __moneypunct_cache<char>;
45   template class moneypunct_byname<char, false>;
46   template class moneypunct_byname<char, true>;
47   template class money_get<char, istreambuf_iterator<char> >;
48   template class money_put<char, ostreambuf_iterator<char> >;
49
50 #ifdef _GLIBCXX_USE_WCHAR_T
51   template class moneypunct<wchar_t, false>;
52   template class moneypunct<wchar_t, true>;
53   template struct __moneypunct_cache<wchar_t>;
54   template class moneypunct_byname<wchar_t, false>;
55   template class moneypunct_byname<wchar_t, true>;
56   template class money_get<wchar_t, istreambuf_iterator<wchar_t> >;
57   template class money_put<wchar_t, ostreambuf_iterator<wchar_t> >;
58 #endif
59
60   // numpunct, numpunct_byname, num_get, and num_put
61   template class numpunct<char>;
62   template struct __numpunct_cache<char>;
63   template class numpunct_byname<char>;
64   template class num_get<char, istreambuf_iterator<char> >;
65   template class num_put<char, ostreambuf_iterator<char> >; 
66   template
67     ostreambuf_iterator<char>
68     num_put<char, ostreambuf_iterator<char> >::
69     _M_insert_int(ostreambuf_iterator<char>, ios_base&, char, 
70                   long) const;
71
72   template
73     ostreambuf_iterator<char>
74     num_put<char, ostreambuf_iterator<char> >::
75     _M_insert_int(ostreambuf_iterator<char>, ios_base&, char, 
76                   unsigned long) const;
77
78 #ifdef _GLIBCXX_USE_LONG_LONG
79   template
80     ostreambuf_iterator<char>
81     num_put<char, ostreambuf_iterator<char> >::
82     _M_insert_int(ostreambuf_iterator<char>, ios_base&, char, 
83                   long long) const;
84
85   template
86     ostreambuf_iterator<char>
87     num_put<char, ostreambuf_iterator<char> >::
88     _M_insert_int(ostreambuf_iterator<char>, ios_base&, char, 
89                   unsigned long long) const;
90 #endif
91
92   template
93     ostreambuf_iterator<char>
94     num_put<char, ostreambuf_iterator<char> >::
95     _M_insert_float(ostreambuf_iterator<char>, ios_base&, char, char, 
96                     double) const;
97
98   template
99     ostreambuf_iterator<char>
100     num_put<char, ostreambuf_iterator<char> >::
101     _M_insert_float(ostreambuf_iterator<char>, ios_base&, char, char, 
102                     long double) const;
103   
104 #ifdef _GLIBCXX_USE_WCHAR_T
105   template class numpunct<wchar_t>;
106   template struct __numpunct_cache<wchar_t>;
107   template class numpunct_byname<wchar_t>;
108   template class num_get<wchar_t, istreambuf_iterator<wchar_t> >;
109   template class num_put<wchar_t, ostreambuf_iterator<wchar_t> >;
110
111   template
112     ostreambuf_iterator<wchar_t>
113     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
114     _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, 
115                   long) const;
116
117   template
118     ostreambuf_iterator<wchar_t>
119     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
120     _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, 
121                   unsigned long) const;
122
123 #ifdef _GLIBCXX_USE_LONG_LONG
124   template
125     ostreambuf_iterator<wchar_t>
126     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
127     _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
128                   long long) const;
129
130   template
131     ostreambuf_iterator<wchar_t>
132     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
133     _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
134                   unsigned long long) const;
135 #endif
136
137   template
138     ostreambuf_iterator<wchar_t>
139     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
140     _M_insert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, 
141                     double) const;
142   
143   template
144     ostreambuf_iterator<wchar_t>
145     num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
146     _M_insert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, 
147                     long double) const;
148 #endif
149
150   // time_get and time_put
151   template class __timepunct<char>;
152   template struct __timepunct_cache<char>;
153   template class time_put<char, ostreambuf_iterator<char> >;
154   template class time_put_byname<char, ostreambuf_iterator<char> >;
155   template class time_get<char, istreambuf_iterator<char> >;
156   template class time_get_byname<char, istreambuf_iterator<char> >;
157
158 #ifdef _GLIBCXX_USE_WCHAR_T
159   template class __timepunct<wchar_t>;
160   template struct __timepunct_cache<wchar_t>;
161   template class time_put<wchar_t, ostreambuf_iterator<wchar_t> >;
162   template class time_put_byname<wchar_t, ostreambuf_iterator<wchar_t> >;
163   template class time_get<wchar_t, istreambuf_iterator<wchar_t> >;
164   template class time_get_byname<wchar_t, istreambuf_iterator<wchar_t> >;
165 #endif
166
167   // messages
168   template class messages<char>;
169   template class messages_byname<char>;
170 #ifdef _GLIBCXX_USE_WCHAR_T
171   template class messages<wchar_t>;
172   template class messages_byname<wchar_t>;
173 #endif
174   
175   // ctype
176   inline template class __ctype_abstract_base<char>;
177   template class ctype_byname<char>;
178 #ifdef _GLIBCXX_USE_WCHAR_T
179   inline template class __ctype_abstract_base<wchar_t>;
180   template class ctype_byname<wchar_t>;
181 #endif
182   
183   // codecvt
184   inline template class __codecvt_abstract_base<char, char, mbstate_t>;
185   template class codecvt_byname<char, char, mbstate_t>;
186 #ifdef _GLIBCXX_USE_WCHAR_T
187   inline template class __codecvt_abstract_base<wchar_t, char, mbstate_t>;
188   template class codecvt_byname<wchar_t, char, mbstate_t>;
189 #endif
190
191   // collate
192   template class collate<char>;
193   template class collate_byname<char>;
194 #ifdef _GLIBCXX_USE_WCHAR_T
195   template class collate<wchar_t>;
196   template class collate_byname<wchar_t>;
197 #endif
198     
199   // use_facet
200   // NB: use_facet<ctype> is specialized
201   template
202     const codecvt<char, char, mbstate_t>& 
203     use_facet<codecvt<char, char, mbstate_t> >(const locale&);
204
205   template
206     const collate<char>& 
207     use_facet<collate<char> >(const locale&);
208
209   template
210     const numpunct<char>& 
211     use_facet<numpunct<char> >(const locale&);
212
213   template 
214     const num_put<char>& 
215     use_facet<num_put<char> >(const locale&);
216
217   template 
218     const num_get<char>& 
219     use_facet<num_get<char> >(const locale&);
220
221   template
222     const moneypunct<char, true>& 
223     use_facet<moneypunct<char, true> >(const locale&);
224
225   template
226     const moneypunct<char, false>& 
227     use_facet<moneypunct<char, false> >(const locale&);
228
229   template 
230     const money_put<char>& 
231     use_facet<money_put<char> >(const locale&);
232
233   template 
234     const money_get<char>& 
235     use_facet<money_get<char> >(const locale&);
236
237   template
238     const __timepunct<char>& 
239     use_facet<__timepunct<char> >(const locale&);
240
241   template 
242     const time_put<char>& 
243     use_facet<time_put<char> >(const locale&);
244
245   template 
246     const time_get<char>& 
247     use_facet<time_get<char> >(const locale&);
248
249   template 
250     const messages<char>& 
251     use_facet<messages<char> >(const locale&);
252
253 #ifdef _GLIBCXX_USE_WCHAR_T
254   template
255     const codecvt<wchar_t, char, mbstate_t>& 
256     use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&);
257
258   template
259     const collate<wchar_t>& 
260     use_facet<collate<wchar_t> >(const locale&);
261
262   template
263     const numpunct<wchar_t>& 
264     use_facet<numpunct<wchar_t> >(const locale&);
265
266   template 
267     const num_put<wchar_t>& 
268     use_facet<num_put<wchar_t> >(const locale&);
269
270   template 
271     const num_get<wchar_t>& 
272     use_facet<num_get<wchar_t> >(const locale&);
273
274   template
275     const moneypunct<wchar_t, true>& 
276     use_facet<moneypunct<wchar_t, true> >(const locale&);
277
278   template
279     const moneypunct<wchar_t, false>& 
280     use_facet<moneypunct<wchar_t, false> >(const locale&);
281  
282   template 
283     const money_put<wchar_t>& 
284     use_facet<money_put<wchar_t> >(const locale&);
285
286   template 
287     const money_get<wchar_t>& 
288     use_facet<money_get<wchar_t> >(const locale&);
289
290   template
291     const __timepunct<wchar_t>& 
292     use_facet<__timepunct<wchar_t> >(const locale&);
293
294   template 
295     const time_put<wchar_t>& 
296     use_facet<time_put<wchar_t> >(const locale&);
297
298   template 
299     const time_get<wchar_t>& 
300     use_facet<time_get<wchar_t> >(const locale&);
301
302   template 
303     const messages<wchar_t>& 
304     use_facet<messages<wchar_t> >(const locale&);
305 #endif
306
307   // has_facet
308   template 
309     bool
310     has_facet<ctype<char> >(const locale&);
311
312   template 
313     bool
314     has_facet<codecvt<char, char, mbstate_t> >(const locale&);
315
316   template 
317     bool
318     has_facet<collate<char> >(const locale&);
319
320   template 
321     bool
322     has_facet<numpunct<char> >(const locale&);
323
324   template 
325     bool
326     has_facet<num_put<char> >(const locale&);
327
328   template 
329     bool
330     has_facet<num_get<char> >(const locale&);
331
332   template 
333     bool
334     has_facet<moneypunct<char> >(const locale&);
335
336   template 
337     bool
338     has_facet<money_put<char> >(const locale&);
339
340   template 
341     bool
342     has_facet<money_get<char> >(const locale&);
343
344   template 
345     bool
346     has_facet<__timepunct<char> >(const locale&);
347
348   template 
349     bool
350     has_facet<time_put<char> >(const locale&);
351
352   template 
353     bool
354     has_facet<time_get<char> >(const locale&);
355
356   template 
357     bool
358     has_facet<messages<char> >(const locale&);
359
360 #ifdef _GLIBCXX_USE_WCHAR_T
361  template 
362     bool
363     has_facet<ctype<wchar_t> >(const locale&);
364
365   template 
366     bool
367     has_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);
368
369   template 
370     bool
371     has_facet<collate<wchar_t> >(const locale&);
372
373   template 
374     bool
375     has_facet<numpunct<wchar_t> >(const locale&);
376
377   template 
378     bool
379     has_facet<num_put<wchar_t> >(const locale&);
380
381   template 
382     bool
383     has_facet<num_get<wchar_t> >(const locale&);
384
385   template 
386     bool
387     has_facet<moneypunct<wchar_t> >(const locale&);
388
389   template 
390     bool
391     has_facet<money_put<wchar_t> >(const locale&);
392
393   template 
394     bool
395     has_facet<money_get<wchar_t> >(const locale&);
396
397   template 
398     bool
399     has_facet<__timepunct<wchar_t> >(const locale&);
400
401   template 
402     bool
403     has_facet<time_put<wchar_t> >(const locale&);
404
405   template 
406     bool
407     has_facet<time_get<wchar_t> >(const locale&);
408
409   template 
410     bool
411     has_facet<messages<wchar_t> >(const locale&);
412 #endif
413
414   // locale
415   template
416     char*
417     __add_grouping<char>(char*, char, char const*, char const*, 
418                          char const*, char const*);
419
420   template
421     bool
422     __verify_grouping<char>(const basic_string<char>&, basic_string<char>&);
423
424   template class __pad<char, char_traits<char> >;
425
426 #ifdef _GLIBCXX_USE_WCHAR_T
427   template
428     wchar_t*
429     __add_grouping<wchar_t>(wchar_t*, wchar_t, char const*, char const*, 
430                             wchar_t const*, wchar_t const*);
431   template
432     bool
433     __verify_grouping<wchar_t>(const basic_string<wchar_t>&, 
434                                basic_string<wchar_t>&);
435
436   template class __pad<wchar_t, char_traits<wchar_t> >;
437 #endif 
438
439   template
440     int
441     __convert_from_v(char*, const int, const char*, double, 
442                      const __c_locale&, int);
443
444   template
445     int
446     __convert_from_v(char*, const int, const char*, long double, 
447                      const __c_locale&, int);
448
449   template
450     int
451     __convert_from_v(char*, const int, const char*, long, 
452                      const __c_locale&, int);
453
454   template
455     int
456     __convert_from_v(char*, const int, const char*, unsigned long, 
457                      const __c_locale&, int);
458
459 #ifdef _GLIBCXX_USE_LONG_LONG
460   template
461     int
462     __convert_from_v(char*, const int, const char*, long long, 
463                      const __c_locale&, int);
464
465   template
466     int
467     __convert_from_v(char*, const int, const char*, unsigned long long, 
468                      const __c_locale&, int);
469 #endif
470
471   template
472     int
473     __int_to_char(char*, const int, unsigned long, const char*, 
474                   ios_base::fmtflags, bool);
475
476 #ifdef _GLIBCXX_USE_WCHAR_T
477   template
478     int
479     __int_to_char(wchar_t*, const int, unsigned long, const wchar_t*, 
480                   ios_base::fmtflags, bool);
481 #endif
482
483 #ifdef _GLIBCXX_USE_LONG_LONG
484   template
485     int
486     __int_to_char(char*, const int, unsigned long long, const char*, 
487                   ios_base::fmtflags, bool);
488
489 #ifdef _GLIBCXX_USE_WCHAR_T
490   template
491     int
492     __int_to_char(wchar_t*, const int, unsigned long long, const wchar_t*,
493                   ios_base::fmtflags, bool);
494 #endif
495 #endif
496 } // namespace std