]> gcc.gnu.org Git - gcc.git/blob - libstdc++-v3/src/locale-inst.cc
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale.
[gcc.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
49 #ifdef _GLIBCPP_USE_WCHAR_T
50 template class moneypunct<wchar_t, false>;
51 template class moneypunct<wchar_t, true>;
52 template class moneypunct_byname<wchar_t, false>;
53 template class moneypunct_byname<wchar_t, true>;
54 template class money_get<wchar_t, istreambuf_iterator<wchar_t> >;
55 template class money_put<wchar_t, ostreambuf_iterator<wchar_t> >;
56 #endif
57
58 // numpunct, numpunct_byname, num_get, and num_put
59 template class numpunct<char>;
60 template struct __numpunct_cache<char>;
61 template class numpunct_byname<char>;
62 template class num_get<char, istreambuf_iterator<char> >;
63 template class num_put<char, ostreambuf_iterator<char> >;
64 template
65 ostreambuf_iterator<char>
66 num_put<char, ostreambuf_iterator<char> >::
67 _M_convert_int(ostreambuf_iterator<char>, ios_base&, char,
68 long) const;
69
70 template
71 ostreambuf_iterator<char>
72 num_put<char, ostreambuf_iterator<char> >::
73 _M_convert_int(ostreambuf_iterator<char>, ios_base&, char,
74 unsigned long) const;
75
76 #ifdef _GLIBCPP_USE_LONG_LONG
77 template
78 ostreambuf_iterator<char>
79 num_put<char, ostreambuf_iterator<char> >::
80 _M_convert_int(ostreambuf_iterator<char>, ios_base&, char,
81 long long) const;
82
83 template
84 ostreambuf_iterator<char>
85 num_put<char, ostreambuf_iterator<char> >::
86 _M_convert_int(ostreambuf_iterator<char>, ios_base&, char,
87 unsigned long long) const;
88 #endif
89
90 template
91 ostreambuf_iterator<char>
92 num_put<char, ostreambuf_iterator<char> >::
93 _M_convert_float(ostreambuf_iterator<char>, ios_base&, char, char,
94 double) const;
95
96 template
97 ostreambuf_iterator<char>
98 num_put<char, ostreambuf_iterator<char> >::
99 _M_convert_float(ostreambuf_iterator<char>, ios_base&, char, char,
100 long double) const;
101
102 #ifdef _GLIBCPP_USE_WCHAR_T
103 template class numpunct<wchar_t>;
104 template struct __numpunct_cache<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
This page took 0.066532 seconds and 6 git commands to generate.