aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src/locale-inst.cc
blob: 2a12a93220644ab938db75db2386ddc635a4658a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
// Locale support -*- C++ -*-

// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING.  If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.

// As a special exception, you may use this file as part of a free software
// library without restriction.  Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License.  This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.

//
// ISO C++ 14882: 22.1  Locales
//

#include <cstdlib>
#include <clocale>
#include <cstring>
#include <locale>

namespace std
{
  // moneypunct, money_get, and money_put
  template class moneypunct<char, false>;
  template class moneypunct<char, true>;
  template struct __moneypunct_cache<char>;
  template class moneypunct_byname<char, false>;
  template class moneypunct_byname<char, true>;
  template class money_get<char, istreambuf_iterator<char> >;
  template class money_put<char, ostreambuf_iterator<char> >;

#ifdef _GLIBCXX_USE_WCHAR_T
  template class moneypunct<wchar_t, false>;
  template class moneypunct<wchar_t, true>;
  template struct __moneypunct_cache<wchar_t>;
  template class moneypunct_byname<wchar_t, false>;
  template class moneypunct_byname<wchar_t, true>;
  template class money_get<wchar_t, istreambuf_iterator<wchar_t> >;
  template class money_put<wchar_t, ostreambuf_iterator<wchar_t> >;
#endif

  // numpunct, numpunct_byname, num_get, and num_put
  template class numpunct<char>;
  template struct __numpunct_cache<char>;
  template class numpunct_byname<char>;
  template class num_get<char, istreambuf_iterator<char> >;
  template class num_put<char, ostreambuf_iterator<char> >; 
  template
    ostreambuf_iterator<char>
    num_put<char, ostreambuf_iterator<char> >::
    _M_insert_int(ostreambuf_iterator<char>, ios_base&, char, 
		  long) const;

  template
    ostreambuf_iterator<char>
    num_put<char, ostreambuf_iterator<char> >::
    _M_insert_int(ostreambuf_iterator<char>, ios_base&, char, 
		  unsigned long) const;

#ifdef _GLIBCXX_USE_LONG_LONG
  template
    ostreambuf_iterator<char>
    num_put<char, ostreambuf_iterator<char> >::
    _M_insert_int(ostreambuf_iterator<char>, ios_base&, char, 
		  long long) const;

  template
    ostreambuf_iterator<char>
    num_put<char, ostreambuf_iterator<char> >::
    _M_insert_int(ostreambuf_iterator<char>, ios_base&, char, 
		  unsigned long long) const;
#endif

  template
    ostreambuf_iterator<char>
    num_put<char, ostreambuf_iterator<char> >::
    _M_insert_float(ostreambuf_iterator<char>, ios_base&, char, char, 
		    double) const;

  template
    ostreambuf_iterator<char>
    num_put<char, ostreambuf_iterator<char> >::
    _M_insert_float(ostreambuf_iterator<char>, ios_base&, char, char, 
		    long double) const;
  
#ifdef _GLIBCXX_USE_WCHAR_T
  template class numpunct<wchar_t>;
  template struct __numpunct_cache<wchar_t>;
  template class numpunct_byname<wchar_t>;
  template class num_get<wchar_t, istreambuf_iterator<wchar_t> >;
  template class num_put<wchar_t, ostreambuf_iterator<wchar_t> >;

  template
    ostreambuf_iterator<wchar_t>
    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
    _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, 
		  long) const;

  template
    ostreambuf_iterator<wchar_t>
    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
    _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, 
		  unsigned long) const;

#ifdef _GLIBCXX_USE_LONG_LONG
  template
    ostreambuf_iterator<wchar_t>
    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
    _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
		  long long) const;

  template
    ostreambuf_iterator<wchar_t>
    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
    _M_insert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
		  unsigned long long) const;
#endif

  template
    ostreambuf_iterator<wchar_t>
    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
    _M_insert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, 
		    double) const;
  
  template
    ostreambuf_iterator<wchar_t>
    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
    _M_insert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, 
		    long double) const;
#endif

  // time_get and time_put
  template class __timepunct<char>;
  template struct __timepunct_cache<char>;
  template class time_put<char, ostreambuf_iterator<char> >;
  template class time_put_byname<char, ostreambuf_iterator<char> >;
  template class time_get<char, istreambuf_iterator<char> >;
  template class time_get_byname<char, istreambuf_iterator<char> >;

#ifdef _GLIBCXX_USE_WCHAR_T
  template class __timepunct<wchar_t>;
  template struct __timepunct_cache<wchar_t>;
  template class time_put<wchar_t, ostreambuf_iterator<wchar_t> >;
  template class time_put_byname<wchar_t, ostreambuf_iterator<wchar_t> >;
  template class time_get<wchar_t, istreambuf_iterator<wchar_t> >;
  template class time_get_byname<wchar_t, istreambuf_iterator<wchar_t> >;
#endif

  // messages
  template class messages<char>;
  template class messages_byname<char>;
#ifdef _GLIBCXX_USE_WCHAR_T
  template class messages<wchar_t>;
  template class messages_byname<wchar_t>;
#endif
  
  // ctype
  inline template class __ctype_abstract_base<char>;
  template class ctype_byname<char>;
#ifdef _GLIBCXX_USE_WCHAR_T
  inline template class __ctype_abstract_base<wchar_t>;
  template class ctype_byname<wchar_t>;
#endif
  
  // codecvt
  inline template class __codecvt_abstract_base<char, char, mbstate_t>;
  template class codecvt_byname<char, char, mbstate_t>;
#ifdef _GLIBCXX_USE_WCHAR_T
  inline template class __codecvt_abstract_base<wchar_t, char, mbstate_t>;
  template class codecvt_byname<wchar_t, char, mbstate_t>;
#endif

  // collate
  template class collate<char>;
  template class collate_byname<char>;
#ifdef _GLIBCXX_USE_WCHAR_T
  template class collate<wchar_t>;
  template class collate_byname<wchar_t>;
#endif
    
  // use_facet
  // NB: use_facet<ctype> is specialized
  template
    const codecvt<char, char, mbstate_t>& 
    use_facet<codecvt<char, char, mbstate_t> >(const locale&);

  template
    const collate<char>& 
    use_facet<collate<char> >(const locale&);

  template
    const numpunct<char>& 
    use_facet<numpunct<char> >(const locale&);

  template 
    const num_put<char>& 
    use_facet<num_put<char> >(const locale&);

  template 
    const num_get<char>& 
    use_facet<num_get<char> >(const locale&);

  template
    const moneypunct<char, true>& 
    use_facet<moneypunct<char, true> >(const locale&);

  template
    const moneypunct<char, false>& 
    use_facet<moneypunct<char, false> >(const locale&);

  template 
    const money_put<char>& 
    use_facet<money_put<char> >(const locale&);

  template 
    const money_get<char>& 
    use_facet<money_get<char> >(const locale&);

  template
    const __timepunct<char>& 
    use_facet<__timepunct<char> >(const locale&);

  template 
    const time_put<char>& 
    use_facet<time_put<char> >(const locale&);

  template 
    const time_get<char>& 
    use_facet<time_get<char> >(const locale&);

  template 
    const messages<char>& 
    use_facet<messages<char> >(const locale&);

#ifdef _GLIBCXX_USE_WCHAR_T
  template
    const codecvt<wchar_t, char, mbstate_t>& 
    use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&);

  template
    const collate<wchar_t>& 
    use_facet<collate<wchar_t> >(const locale&);

  template
    const numpunct<wchar_t>& 
    use_facet<numpunct<wchar_t> >(const locale&);

  template 
    const num_put<wchar_t>& 
    use_facet<num_put<wchar_t> >(const locale&);

  template 
    const num_get<wchar_t>& 
    use_facet<num_get<wchar_t> >(const locale&);

  template
    const moneypunct<wchar_t, true>& 
    use_facet<moneypunct<wchar_t, true> >(const locale&);

  template
    const moneypunct<wchar_t, false>& 
    use_facet<moneypunct<wchar_t, false> >(const locale&);
 
  template 
    const money_put<wchar_t>& 
    use_facet<money_put<wchar_t> >(const locale&);

  template 
    const money_get<wchar_t>& 
    use_facet<money_get<wchar_t> >(const locale&);

  template
    const __timepunct<wchar_t>& 
    use_facet<__timepunct<wchar_t> >(const locale&);

  template 
    const time_put<wchar_t>& 
    use_facet<time_put<wchar_t> >(const locale&);

  template 
    const time_get<wchar_t>& 
    use_facet<time_get<wchar_t> >(const locale&);

  template 
    const messages<wchar_t>& 
    use_facet<messages<wchar_t> >(const locale&);
#endif

  // has_facet
  template 
    bool
    has_facet<ctype<char> >(const locale&);

  template 
    bool
    has_facet<codecvt<char, char, mbstate_t> >(const locale&);

  template 
    bool
    has_facet<collate<char> >(const locale&);

  template 
    bool
    has_facet<numpunct<char> >(const locale&);

  template 
    bool
    has_facet<num_put<char> >(const locale&);

  template 
    bool
    has_facet<num_get<char> >(const locale&);

  template 
    bool
    has_facet<moneypunct<char> >(const locale&);

  template 
    bool
    has_facet<money_put<char> >(const locale&);

  template 
    bool
    has_facet<money_get<char> >(const locale&);

  template 
    bool
    has_facet<__timepunct<char> >(const locale&);

  template 
    bool
    has_facet<time_put<char> >(const locale&);

  template 
    bool
    has_facet<time_get<char> >(const locale&);

  template 
    bool
    has_facet<messages<char> >(const locale&);

#ifdef _GLIBCXX_USE_WCHAR_T
 template 
    bool
    has_facet<ctype<wchar_t> >(const locale&);

  template 
    bool
    has_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);

  template 
    bool
    has_facet<collate<wchar_t> >(const locale&);

  template 
    bool
    has_facet<numpunct<wchar_t> >(const locale&);

  template 
    bool
    has_facet<num_put<wchar_t> >(const locale&);

  template 
    bool
    has_facet<num_get<wchar_t> >(const locale&);

  template 
    bool
    has_facet<moneypunct<wchar_t> >(const locale&);

  template 
    bool
    has_facet<money_put<wchar_t> >(const locale&);

  template 
    bool
    has_facet<money_get<wchar_t> >(const locale&);

  template 
    bool
    has_facet<__timepunct<wchar_t> >(const locale&);

  template 
    bool
    has_facet<time_put<wchar_t> >(const locale&);

  template 
    bool
    has_facet<time_get<wchar_t> >(const locale&);

  template 
    bool
    has_facet<messages<wchar_t> >(const locale&);
#endif

  // locale
  template
    char*
    __add_grouping<char>(char*, char, char const*, char const*, 
			 char const*, char const*);

  template
    bool
    __verify_grouping<char>(const basic_string<char>&, basic_string<char>&);

  template class __pad<char, char_traits<char> >;

#ifdef _GLIBCXX_USE_WCHAR_T
  template
    wchar_t*
    __add_grouping<wchar_t>(wchar_t*, wchar_t, char const*, char const*, 
			    wchar_t const*, wchar_t const*);
  template
    bool
    __verify_grouping<wchar_t>(const basic_string<wchar_t>&, 
			       basic_string<wchar_t>&);

  template class __pad<wchar_t, char_traits<wchar_t> >;
#endif 

  template
    int
    __convert_from_v(char*, const int, const char*, double, 
		     const __c_locale&, int);

  template
    int
    __convert_from_v(char*, const int, const char*, long double, 
		     const __c_locale&, int);

  template
    int
    __convert_from_v(char*, const int, const char*, long, 
		     const __c_locale&, int);

  template
    int
    __convert_from_v(char*, const int, const char*, unsigned long, 
		     const __c_locale&, int);

#ifdef _GLIBCXX_USE_LONG_LONG
  template
    int
    __convert_from_v(char*, const int, const char*, long long, 
		     const __c_locale&, int);

  template
    int
    __convert_from_v(char*, const int, const char*, unsigned long long, 
		     const __c_locale&, int);
#endif

  template
    int
    __int_to_char(char*, const int, unsigned long, const char*, 
		  ios_base::fmtflags, bool);

#ifdef _GLIBCXX_USE_WCHAR_T
  template
    int
    __int_to_char(wchar_t*, const int, unsigned long, const wchar_t*, 
		  ios_base::fmtflags, bool);
#endif

#ifdef _GLIBCXX_USE_LONG_LONG
  template
    int
    __int_to_char(char*, const int, unsigned long long, const char*, 
		  ios_base::fmtflags, bool);

#ifdef _GLIBCXX_USE_WCHAR_T
  template
    int
    __int_to_char(wchar_t*, const int, unsigned long long, const wchar_t*,
		  ios_base::fmtflags, bool);
#endif
#endif
} // namespace std