]> gcc.gnu.org Git - gcc.git/blob - libstdc++-v3/src/locale-inst.cc
* src/locale-inst.cc: Include <bits/std_cstdlib.h>
[gcc.git] / libstdc++-v3 / src / locale-inst.cc
1 // Locale support -*- C++ -*-
2
3 // Copyright (C) 1999, 2000, 2001 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 <bits/std_cstdlib.h>
35 #include <bits/std_clocale.h>
36 #include <bits/std_cstring.h>
37 #include <bits/std_cassert.h>
38 #include <bits/std_limits.h>
39 #include <exception>
40 #include <bits/std_stdexcept.h>
41 #include <bits/std_locale.h>
42 #include <bits/locale_facets.tcc>
43 #include <bits/std_istream.h>
44 #include <bits/std_ostream.h>
45
46 namespace std
47 {
48 typedef ostreambuf_iterator<char, char_traits<char> > obuf_iterator;
49 typedef istreambuf_iterator<char, char_traits<char> > ibuf_iterator;
50 typedef ostreambuf_iterator<wchar_t, char_traits<wchar_t> > wobuf_iterator;
51 typedef istreambuf_iterator<wchar_t, char_traits<wchar_t> > wibuf_iterator;
52
53 // moneypunct, money_get, and money_put
54 template class moneypunct<char, false>;
55 template class moneypunct<char, true>;
56 template class moneypunct_byname<char, false>;
57 template class moneypunct_byname<char, true>;
58 template class money_get<char, ibuf_iterator>;
59 template class money_put<char, obuf_iterator>;
60
61 #ifdef _GLIBCPP_USE_WCHAR_T
62 template class moneypunct<wchar_t, false>;
63 template class moneypunct<wchar_t, true>;
64 template class moneypunct_byname<wchar_t, false>;
65 template class moneypunct_byname<wchar_t, true>;
66 template class money_get<wchar_t, wibuf_iterator>;
67 template class money_put<wchar_t, wobuf_iterator>;
68 #endif
69
70 // numpunct, numpunct_byname, num_get, and num_put
71 template class numpunct<char>;
72 template class numpunct_byname<char>;
73 template class num_get<char, ibuf_iterator>;
74 template class num_put<char, obuf_iterator>;
75 template
76 obuf_iterator
77 num_put<char, obuf_iterator>::
78 _M_convert_int(obuf_iterator, ios_base&, char, char, char, long) const;
79
80 template
81 obuf_iterator
82 num_put<char, obuf_iterator>::
83 _M_convert_int(obuf_iterator, ios_base&, char, char, char,
84 unsigned long) const;
85
86 #ifdef _GLIBCPP_USE_LONG_LONG
87 template
88 obuf_iterator
89 num_put<char, obuf_iterator>::
90 _M_convert_int(obuf_iterator, ios_base&, char, char, char,
91 long long) const;
92
93 template
94 obuf_iterator
95 num_put<char, obuf_iterator>::
96 _M_convert_int(obuf_iterator, ios_base&, char, char, char,
97 unsigned long long) const;
98 #endif
99
100 template
101 obuf_iterator
102 num_put<char, obuf_iterator>::
103 _M_convert_float(obuf_iterator, ios_base&, char, char, double) const;
104
105 template
106 obuf_iterator
107 num_put<char, obuf_iterator>::
108 _M_convert_float(obuf_iterator, ios_base&, char, char,
109 long double) const;
110
111 #ifdef _GLIBCPP_USE_WCHAR_T
112 template class numpunct<wchar_t>;
113 template class numpunct_byname<wchar_t>;
114 template class num_get<wchar_t, wibuf_iterator>;
115 template class num_put<wchar_t, wobuf_iterator>;
116
117 template
118 wobuf_iterator
119 num_put<wchar_t, wobuf_iterator>::
120 _M_convert_int(wobuf_iterator, ios_base&, wchar_t, char, char, long) const;
121
122 template
123 wobuf_iterator
124 num_put<wchar_t, wobuf_iterator>::
125 _M_convert_int(wobuf_iterator, ios_base&, wchar_t, char, char,
126 unsigned long) const;
127
128 #ifdef _GLIBCPP_USE_LONG_LONG
129 template
130 wobuf_iterator
131 num_put<wchar_t, wobuf_iterator>::
132 _M_convert_int(wobuf_iterator, ios_base&, wchar_t, char, char,
133 long long) const;
134
135 template
136 wobuf_iterator
137 num_put<wchar_t, wobuf_iterator>::
138 _M_convert_int(wobuf_iterator, ios_base&, wchar_t, char, char,
139 unsigned long long) const;
140 #endif
141
142 template
143 wobuf_iterator
144 num_put<wchar_t, wobuf_iterator>::
145 _M_convert_float(wobuf_iterator, ios_base&, wchar_t, char,
146 double) const;
147
148 template
149 wobuf_iterator
150 num_put<wchar_t, wobuf_iterator>::
151 _M_convert_float(wobuf_iterator, ios_base&, wchar_t, char,
152 long double) const;
153 #endif
154
155 // time_get and time_put
156 template class __timepunct<char>;
157 template class time_put<char, obuf_iterator>;
158 template class time_put_byname<char, obuf_iterator>;
159 template class time_get<char, ibuf_iterator>;
160 template class time_get_byname<char, ibuf_iterator>;
161
162 #ifdef _GLIBCPP_USE_WCHAR_T
163 template class __timepunct<wchar_t>;
164 template class time_put<wchar_t, wobuf_iterator>;
165 template class time_put_byname<wchar_t, wobuf_iterator>;
166 template class time_get<wchar_t, wibuf_iterator>;
167 template class time_get_byname<wchar_t, wibuf_iterator>;
168 #endif
169
170 // messages
171 template class messages<char>;
172 template class messages_byname<char>;
173 #ifdef _GLIBCPP_USE_WCHAR_T
174 template class messages<wchar_t>;
175 template class messages_byname<wchar_t>;
176 #endif
177
178 // ctype
179 template class __ctype_abstract_base<char>;
180 template class ctype_byname<char>;
181 #ifdef _GLIBCPP_USE_WCHAR_T
182 template class __ctype_abstract_base<wchar_t>;
183 template class ctype_byname<wchar_t>;
184 #endif
185
186 // codecvt
187 template class __codecvt_abstract_base<char, char, mbstate_t>;
188 template class __codecvt_abstract_base<wchar_t, char, mbstate_t>;
189 template class codecvt_byname<char, char, mbstate_t>;
190 #ifdef _GLIBCPP_USE_WCHAR_T
191 template class codecvt_byname<wchar_t, char, mbstate_t>;
192 #endif
193
194 // collate
195 template class collate<char>;
196 template class collate_byname<char>;
197 #ifdef _GLIBCPP_USE_WCHAR_T
198 template class collate<wchar_t>;
199 template class collate_byname<wchar_t>;
200 #endif
201
202 // use_facet
203 template
204 const numpunct<char>&
205 use_facet<numpunct<char> >(const locale&);
206
207 template
208 const num_put<char, obuf_iterator >&
209 use_facet<num_put<char, obuf_iterator> >(const locale&);
210
211 template
212 const num_get<char, ibuf_iterator >&
213 use_facet<num_get<char, ibuf_iterator> >(const locale&);
214
215 template
216 const codecvt<char, char, mbstate_t>&
217 use_facet<codecvt<char, char, mbstate_t> >(const locale&);
218
219 template
220 const collate<char>&
221 use_facet<collate<char> >(const locale&);
222
223 template
224 const moneypunct<char, true>&
225 use_facet<moneypunct<char, true> >(const locale&);
226
227 template
228 const moneypunct<char, false>&
229 use_facet<moneypunct<char, false> >(const locale&);
230
231 template
232 const __timepunct<char>&
233 use_facet<__timepunct<char> >(const locale&);
234
235 #ifdef _GLIBCPP_USE_WCHAR_T
236 template
237 const numpunct<wchar_t>&
238 use_facet<numpunct<wchar_t> >(const locale&);
239
240 template
241 const num_put<wchar_t, wobuf_iterator>&
242 use_facet<num_put<wchar_t, wobuf_iterator> >(const locale&);
243
244 template
245 const num_get<wchar_t, wibuf_iterator>&
246 use_facet<num_get<wchar_t, wibuf_iterator> >(const locale&);
247
248 template
249 const codecvt<wchar_t, char, mbstate_t>&
250 use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&);
251
252 template
253 const collate<wchar_t>&
254 use_facet<collate<wchar_t> >(const locale&);
255
256 template
257 const moneypunct<wchar_t, true>&
258 use_facet<moneypunct<wchar_t, true> >(const locale&);
259
260 template
261 const moneypunct<wchar_t, false>&
262 use_facet<moneypunct<wchar_t, false> >(const locale&);
263
264 template
265 const __timepunct<wchar_t>&
266 use_facet<__timepunct<wchar_t> >(const locale&);
267 #endif
268
269 // has_facet
270 template
271 bool
272 has_facet<numpunct<char> >(const locale&);
273 template
274 bool
275 has_facet<num_put<char> >(const locale&);
276 template
277 bool
278 has_facet<num_get<char> >(const locale&);
279 template
280 bool
281 has_facet<ctype<char> >(const locale&);
282
283 #ifdef _GLIBCPP_USE_WCHAR_T
284 template
285 bool
286 has_facet<numpunct<wchar_t> >(const locale&);
287 template
288 bool
289 has_facet<num_put<wchar_t> >(const locale&);
290 template
291 bool
292 has_facet<num_get<wchar_t> >(const locale&);
293 template
294 bool
295 has_facet<ctype<wchar_t> >(const locale&);
296 #endif
297
298 //
299 // iterator
300 //
301 typedef vector<locale::facet*> vec_pfacet;
302 template
303 void
304 vec_pfacet::
305 insert(vec_pfacet::iterator, vec_pfacet::size_type,
306 const vec_pfacet::value_type&);
307 template
308 void
309 vec_pfacet::
310 _M_fill_insert(vec_pfacet::iterator, vec_pfacet::size_type,
311 const vec_pfacet::value_type&);
312
313
314 //
315 // locale
316 //
317 typedef istreambuf_iterator<char, char_traits<char> > istreambuf_iter;
318 typedef ostreambuf_iterator<char, char_traits<char> > ostreambuf_iter;
319
320 #ifdef _GLIBCPP_USE_WCHAR_T
321 typedef istreambuf_iterator<wchar_t, char_traits<wchar_t> > wistreambuf_iter;
322 typedef ostreambuf_iterator<wchar_t, char_traits<wchar_t> > wostreambuf_iter;
323 #endif
324
325 template
326 bool
327 locale::operator()(const string&, const string&) const;
328
329 template
330 char*
331 __add_grouping<char>(char*, char, char const*, char const*,
332 char const*, char const*);
333
334 template
335 bool
336 __verify_grouping<char>(const basic_string<char>&, basic_string<char>&);
337
338 template
339 void
340 __pad<char>(ios_base&, char, char*, const char *, streamsize,
341 streamsize, const bool);
342
343 template
344 void
345 __pad<char, char_traits<char> >(ios_base&, char, char*, const char *,
346 streamsize, streamsize, const bool);
347
348 #ifdef _GLIBCPP_USE_WCHAR_T
349 template
350 bool
351 locale::operator()(const wstring&, const wstring&) const;
352
353 typedef ostreambuf_iterator<wchar_t> wostreambuf_iter;
354
355 template
356 wchar_t*
357 __add_grouping<wchar_t>(wchar_t*, wchar_t, char const*, char const*,
358 wchar_t const*, wchar_t const*);
359 template
360 bool
361 __verify_grouping<wchar_t>(const basic_string<wchar_t>&,
362 basic_string<wchar_t>&);
363
364 template
365 void
366 __pad<wchar_t>(ios_base&, wchar_t, wchar_t*, const wchar_t*,
367 streamsize, streamsize, const bool);
368
369 template
370 void
371 __pad<wchar_t, char_traits<wchar_t> >(ios_base&, wchar_t, wchar_t*,
372 const wchar_t*, streamsize,
373 streamsize, const bool);
374 #endif // _GLIBCPP_USE_WCHAR_T
375
376 template
377 locale::facet**
378 fill_n<locale::facet**, size_t, locale::facet*>
379 (locale::facet**, size_t, locale::facet* const&);
380
381 template
382 __normal_iterator<locale::facet**, vector<locale::facet*> >
383 fill_n(__normal_iterator<locale::facet**, vector<locale::facet*> >,
384 size_t, locale::facet* const&);
385
386 template
387 void
388 fill(__normal_iterator<locale::facet**, vector<locale::facet*> >,
389 __normal_iterator<locale::facet**, vector<locale::facet*> >,
390 locale::facet* const&);
391 } // namespace std
This page took 0.060615 seconds and 6 git commands to generate.