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