ReactOS 0.4.15-dev-7942-gd23573b
_monetary.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1999
3 * Silicon Graphics Computer Systems, Inc.
4 *
5 * Copyright (c) 1999
6 * Boris Fomitchev
7 *
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
10 *
11 * Permission to use or copy this software for any purpose is hereby granted
12 * without fee, provided the above notices are retained on all copies.
13 * Permission to modify the code and to distribute modified code is granted,
14 * provided the above notices are retained, and a notice that the code was
15 * modified is included with the above copyright notice.
16 *
17 */
18// WARNING: This is an internal header file, included by other C++
19// standard library headers. You should not attempt to use this header
20// file directly.
21
22
23#ifndef _STLP_INTERNAL_MONETARY_H
24#define _STLP_INTERNAL_MONETARY_H
25
26#ifndef _STLP_INTERNAL_OSTREAMBUF_ITERATOR_H
28#endif
29
30#ifndef _STLP_INTERNAL_ISTREAMBUF_ITERATOR_H
32#endif
33
34#ifndef _STLP_FACETS_FWD_H
35# include <stl/_facets_fwd.h>
36#endif
37
39
41public:
43 struct pattern {
44 char field[4];
45 };
46};
47
48// moneypunct facets: forward declaration
49template <class _charT, _STLP_DFL_NON_TYPE_PARAM(bool, _International, false) > class moneypunct {};
50
51// money_get facets
52
53template <class _CharT, class _InputIter>
54class money_get : public locale::facet {
55public:
56 typedef _CharT char_type;
57 typedef _InputIter iter_type;
59
60 explicit money_get(size_t __refs = 0) : locale::facet(__refs) {}
61 iter_type get(iter_type __s, iter_type __end, bool __intl,
62 ios_base& __str, ios_base::iostate& __err,
63 _STLP_LONGEST_FLOAT_TYPE& __units) const
64 { return do_get(__s, __end, __intl, __str, __err, __units); }
65 iter_type get(iter_type __s, iter_type __end, bool __intl,
66 ios_base& __str, ios_base::iostate& __err,
67 string_type& __digits) const
68 { return do_get(__s, __end, __intl, __str, __err, __digits); }
69
70 static locale::id id;
71
72protected:
74 virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl,
75 ios_base& __str, ios_base::iostate& __err,
76 _STLP_LONGEST_FLOAT_TYPE& __units) const;
77 virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl,
78 ios_base& __str, ios_base::iostate& __err,
79 string_type& __digits) const;
80};
81
82
83// moneypunct facets: definition of specializations
84
87public:
88 typedef char char_type;
89 typedef string string_type;
90 explicit moneypunct _STLP_PSPEC2(char, true) (size_t __refs = 0);
91
92 char decimal_point() const { return do_decimal_point(); }
93 char thousands_sep() const { return do_thousands_sep(); }
94 string grouping() const { return do_grouping(); }
95 string_type curr_symbol() const { return do_curr_symbol(); }
96 string_type positive_sign() const { return do_positive_sign(); }
97 string_type negative_sign() const { return do_negative_sign(); }
98 int frac_digits() const { return do_frac_digits(); }
99 pattern pos_format() const { return do_pos_format(); }
100 pattern neg_format() const { return do_neg_format(); }
101
103 _STLP_STATIC_CONSTANT(bool, intl = true);
104
105protected:
108
109 ~moneypunct _STLP_PSPEC2(char, true) ();
110
111 virtual char do_decimal_point() const;
112 virtual char do_thousands_sep() const;
113 virtual string do_grouping() const;
114
115 virtual string do_curr_symbol() const;
116
117 virtual string do_positive_sign() const;
118 virtual string do_negative_sign() const;
119 virtual int do_frac_digits() const;
120 virtual pattern do_pos_format() const;
121 virtual pattern do_neg_format() const;
122};
123
126public:
127 typedef char char_type;
128 typedef string string_type;
129
130 explicit moneypunct _STLP_PSPEC2(char, false) (size_t __refs = 0);
131
132 char decimal_point() const { return do_decimal_point(); }
133 char thousands_sep() const { return do_thousands_sep(); }
134 string grouping() const { return do_grouping(); }
135 string_type curr_symbol() const { return do_curr_symbol(); }
136 string_type positive_sign() const { return do_positive_sign(); }
137 string_type negative_sign() const { return do_negative_sign(); }
138 int frac_digits() const { return do_frac_digits(); }
139 pattern pos_format() const { return do_pos_format(); }
140 pattern neg_format() const { return do_neg_format(); }
141
143 _STLP_STATIC_CONSTANT(bool, intl = false);
144
145protected:
148
149 ~moneypunct _STLP_PSPEC2(char, false) ();
150
151 virtual char do_decimal_point() const;
152 virtual char do_thousands_sep() const;
153 virtual string do_grouping() const;
154
155 virtual string do_curr_symbol() const;
156
157 virtual string do_positive_sign() const;
158 virtual string do_negative_sign() const;
159 virtual int do_frac_digits() const;
160 virtual pattern do_pos_format() const;
161 virtual pattern do_neg_format() const;
162};
163
164
165#ifndef _STLP_NO_WCHAR_T
166
169public:
170 typedef wchar_t char_type;
171 typedef wstring string_type;
172 explicit moneypunct _STLP_PSPEC2(wchar_t, true) (size_t __refs = 0);
173 wchar_t decimal_point() const { return do_decimal_point(); }
174 wchar_t thousands_sep() const { return do_thousands_sep(); }
175 string grouping() const { return do_grouping(); }
176 string_type curr_symbol() const { return do_curr_symbol(); }
177 string_type positive_sign() const { return do_positive_sign(); }
178 string_type negative_sign() const { return do_negative_sign(); }
179 int frac_digits() const { return do_frac_digits(); }
180 pattern pos_format() const { return do_pos_format(); }
181 pattern neg_format() const { return do_neg_format(); }
182
184 _STLP_STATIC_CONSTANT(bool, intl = true);
185
186protected:
189
190 ~moneypunct _STLP_PSPEC2(wchar_t, true) ();
191
192 virtual wchar_t do_decimal_point() const;
193 virtual wchar_t do_thousands_sep() const;
194 virtual string do_grouping() const;
195
196 virtual string_type do_curr_symbol() const;
197
198 virtual string_type do_positive_sign() const;
199 virtual string_type do_negative_sign() const;
200 virtual int do_frac_digits() const;
201 virtual pattern do_pos_format() const;
202 virtual pattern do_neg_format() const;
203};
204
205
208public:
209 typedef wchar_t char_type;
210 typedef wstring string_type;
211 explicit moneypunct _STLP_PSPEC2(wchar_t, false) (size_t __refs = 0);
212 wchar_t decimal_point() const { return do_decimal_point(); }
213 wchar_t thousands_sep() const { return do_thousands_sep(); }
214 string grouping() const { return do_grouping(); }
215 string_type curr_symbol() const { return do_curr_symbol(); }
216 string_type positive_sign() const { return do_positive_sign(); }
217 string_type negative_sign() const { return do_negative_sign(); }
218 int frac_digits() const { return do_frac_digits(); }
219 pattern pos_format() const { return do_pos_format(); }
220 pattern neg_format() const { return do_neg_format(); }
221
223 _STLP_STATIC_CONSTANT(bool, intl = false);
224
225protected:
228
229 ~moneypunct _STLP_PSPEC2(wchar_t, false) ();
230
231 virtual wchar_t do_decimal_point() const;
232 virtual wchar_t do_thousands_sep() const;
233 virtual string do_grouping() const;
234
235 virtual string_type do_curr_symbol() const;
236
237 virtual string_type do_positive_sign() const;
238 virtual string_type do_negative_sign() const;
239 virtual int do_frac_digits() const;
240 virtual pattern do_pos_format() const;
241 virtual pattern do_neg_format() const;
242};
243
244# endif
245
246template <class _charT, _STLP_DFL_NON_TYPE_PARAM(bool , _International , false) > class moneypunct_byname {};
247
250 friend class _Locale_impl;
251public:
253 typedef char char_type;
254 typedef string string_type;
255
256 explicit moneypunct_byname _STLP_PSPEC2(char, true) (const char * __name, size_t __refs = 0);
257
258protected:
260 virtual char do_decimal_point() const;
261 virtual char do_thousands_sep() const;
262 virtual string do_grouping() const;
263
264 virtual string_type do_curr_symbol() const;
265
266 virtual string_type do_positive_sign() const;
267 virtual string_type do_negative_sign() const;
268 virtual int do_frac_digits() const;
269
270private:
272
274 //explicitely defined as private to avoid warnings:
275 moneypunct_byname(_Self const&);
277
279};
280
283 friend class _Locale_impl;
284public:
286 typedef char char_type;
287 typedef string string_type;
288
289 explicit moneypunct_byname _STLP_PSPEC2(char, false) (const char * __name, size_t __refs = 0);
290
291protected:
293 virtual char do_decimal_point() const;
294 virtual char do_thousands_sep() const;
295 virtual string do_grouping() const;
296
297 virtual string_type do_curr_symbol() const;
298
299 virtual string_type do_positive_sign() const;
300 virtual string_type do_negative_sign() const;
301 virtual int do_frac_digits() const;
302
303private:
305
307 //explicitely defined as private to avoid warnings:
308 moneypunct_byname(_Self const&);
310
312};
313
314#if !defined (_STLP_NO_WCHAR_T)
317 friend class _Locale_impl;
318public:
320 typedef wchar_t char_type;
321 typedef wstring string_type;
322
323 explicit moneypunct_byname _STLP_PSPEC2(wchar_t, true) (const char * __name, size_t __refs = 0);
324
325protected:
327 virtual wchar_t do_decimal_point() const;
328 virtual wchar_t do_thousands_sep() const;
329 virtual string do_grouping() const;
330
331 virtual string_type do_curr_symbol() const;
332
333 virtual string_type do_positive_sign() const;
334 virtual string_type do_negative_sign() const;
335 virtual int do_frac_digits() const;
336
337private:
338 moneypunct_byname _STLP_PSPEC2(wchar_t, true) (_Locale_monetary *__monetary);
339
341 //explicitely defined as private to avoid warnings:
342 moneypunct_byname(_Self const&);
344
346};
347
350 friend class _Locale_impl;
351public:
353 typedef wchar_t char_type;
354 typedef wstring string_type;
355
356 explicit moneypunct_byname _STLP_PSPEC2(wchar_t, false) (const char * __name, size_t __refs = 0);
357
358protected:
360 virtual wchar_t do_decimal_point() const;
361 virtual wchar_t do_thousands_sep() const;
362 virtual string do_grouping() const;
363
364 virtual string_type do_curr_symbol() const;
365
366 virtual string_type do_positive_sign() const;
367 virtual string_type do_negative_sign() const;
368 virtual int do_frac_digits() const;
369
370private:
371 moneypunct_byname _STLP_PSPEC2(wchar_t, false) (_Locale_monetary *__monetary);
372
374 //explicitely defined as private to avoid warnings:
375 moneypunct_byname(_Self const&);
377
379};
380#endif
381
382//===== methods ======
383
384
385// money_put facets
386
387template <class _CharT, class _OutputIter>
388class money_put : public locale::facet {
389public:
390 typedef _CharT char_type;
391 typedef _OutputIter iter_type;
393
394 explicit money_put(size_t __refs = 0) : locale::facet(__refs) {}
395 iter_type put(iter_type __s, bool __intl, ios_base& __str,
397 { return do_put(__s, __intl, __str, __fill, __units); }
398 iter_type put(iter_type __s, bool __intl, ios_base& __str,
400 const string_type& __digits) const
401 { return do_put(__s, __intl, __str, __fill, __digits); }
402
404
405protected:
407 virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __str,
409 virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __str,
411 const string_type& __digits) const;
412};
413
414#if defined (_STLP_USE_TEMPLATE_EXPORT)
417# if ! defined (_STLP_NO_WCHAR_T)
420# endif
421#endif
422
424
425#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
426# include <stl/_monetary.c>
427#endif
428
429#endif /* _STLP_INTERNAL_MONETARY_H */
430
431// Local Variables:
432// mode:C++
433// End:
434
435
void __fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val, const input_iterator_tag &, _Distance *)
Definition: _algobase.h:417
int iostate
Definition: _ios_base.h:58
facet(size_t __init_count=0)
Definition: _locale.h:84
void operator=(const facet &)
Definition: _locale.h:75
basic_string< _CharT, char_traits< _CharT >, allocator< _CharT > > string_type
Definition: _monetary.h:58
_InputIter iter_type
Definition: _monetary.h:57
~money_get()
Definition: _monetary.h:73
static locale::id id
Definition: _monetary.h:70
virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl, ios_base &__str, ios_base::iostate &__err, _STLP_LONGEST_FLOAT_TYPE &__units) const
Definition: _monetary.c:279
money_get(size_t __refs=0)
Definition: _monetary.h:60
iter_type get(iter_type __s, iter_type __end, bool __intl, ios_base &__str, ios_base::iostate &__err, string_type &__digits) const
Definition: _monetary.h:65
iter_type get(iter_type __s, iter_type __end, bool __intl, ios_base &__str, ios_base::iostate &__err, _STLP_LONGEST_FLOAT_TYPE &__units) const
Definition: _monetary.h:61
_CharT char_type
Definition: _monetary.h:56
money_put(size_t __refs=0)
Definition: _monetary.h:394
_OutputIter iter_type
Definition: _monetary.h:391
iter_type put(iter_type __s, bool __intl, ios_base &__str, char_type __fill, const string_type &__digits) const
Definition: _monetary.h:398
virtual iter_type do_put(iter_type __s, bool __intl, ios_base &__str, char_type __fill, _STLP_LONGEST_FLOAT_TYPE __units) const
Definition: _monetary.c:506
_CharT char_type
Definition: _monetary.h:390
~money_put()
Definition: _monetary.h:406
basic_string< _CharT, char_traits< _CharT >, allocator< _CharT > > string_type
Definition: _monetary.h:392
iter_type put(iter_type __s, bool __intl, ios_base &__str, char_type __fill, _STLP_LONGEST_FLOAT_TYPE __units) const
Definition: _monetary.h:395
static locale::id id
Definition: _monetary.h:403
_STLP_STATIC_CONSTANT(bool, intl=false)
string_type negative_sign() const
Definition: _monetary.h:137
string_type curr_symbol() const
Definition: _monetary.h:135
static _STLP_STATIC_DECLSPEC locale::id id
Definition: _monetary.h:142
~moneypunct _STLP_PSPEC2(char, false)()
string grouping() const
Definition: _monetary.h:134
string_type positive_sign() const
Definition: _monetary.h:136
char decimal_point() const
Definition: _monetary.h:132
pattern neg_format() const
Definition: _monetary.h:140
pattern pos_format() const
Definition: _monetary.h:139
char thousands_sep() const
Definition: _monetary.h:133
moneypunct _STLP_PSPEC2(char, false)(size_t __refs=0)
string_type positive_sign() const
Definition: _monetary.h:96
~moneypunct _STLP_PSPEC2(char, true)()
string_type curr_symbol() const
Definition: _monetary.h:95
moneypunct _STLP_PSPEC2(char, true)(size_t __refs=0)
pattern pos_format() const
Definition: _monetary.h:99
_STLP_STATIC_CONSTANT(bool, intl=true)
char thousands_sep() const
Definition: _monetary.h:93
pattern neg_format() const
Definition: _monetary.h:100
int frac_digits() const
Definition: _monetary.h:98
string_type negative_sign() const
Definition: _monetary.h:97
string grouping() const
Definition: _monetary.h:94
char decimal_point() const
Definition: _monetary.h:92
static _STLP_STATIC_DECLSPEC locale::id id
Definition: _monetary.h:102
wchar_t thousands_sep() const
Definition: _monetary.h:213
~moneypunct _STLP_PSPEC2(wchar_t, false)()
wchar_t decimal_point() const
Definition: _monetary.h:212
static _STLP_STATIC_DECLSPEC locale::id id
Definition: _monetary.h:222
string_type negative_sign() const
Definition: _monetary.h:217
pattern pos_format() const
Definition: _monetary.h:219
string_type curr_symbol() const
Definition: _monetary.h:215
moneypunct _STLP_PSPEC2(wchar_t, false)(size_t __refs=0)
string_type positive_sign() const
Definition: _monetary.h:216
pattern neg_format() const
Definition: _monetary.h:220
_STLP_STATIC_CONSTANT(bool, intl=false)
~moneypunct _STLP_PSPEC2(wchar_t, true)()
wchar_t decimal_point() const
Definition: _monetary.h:173
wchar_t thousands_sep() const
Definition: _monetary.h:174
string_type curr_symbol() const
Definition: _monetary.h:176
moneypunct _STLP_PSPEC2(wchar_t, true)(size_t __refs=0)
string_type negative_sign() const
Definition: _monetary.h:178
pattern neg_format() const
Definition: _monetary.h:181
string_type positive_sign() const
Definition: _monetary.h:177
static _STLP_STATIC_DECLSPEC locale::id id
Definition: _monetary.h:183
_STLP_STATIC_CONSTANT(bool, intl=true)
string grouping() const
Definition: _monetary.h:175
pattern pos_format() const
Definition: _monetary.h:180
moneypunct_byname< char, false > _Self
Definition: _monetary.h:306
money_base::pattern pattern
Definition: _monetary.h:285
~moneypunct_byname _STLP_PSPEC2(char, false)()
_Locale_monetary * _M_monetary
Definition: _monetary.h:311
moneypunct_byname _STLP_PSPEC2(char, false)(_Locale_monetary *__monetary)
money_base::pattern pattern
Definition: _monetary.h:252
moneypunct_byname< char, true > _Self
Definition: _monetary.h:273
_Locale_monetary * _M_monetary
Definition: _monetary.h:278
~moneypunct_byname _STLP_PSPEC2(char, true)()
moneypunct_byname _STLP_PSPEC2(char, true)(_Locale_monetary *__monetary)
moneypunct_byname _STLP_PSPEC2(wchar_t, false)(_Locale_monetary *__monetary)
moneypunct_byname< wchar_t, false > _Self
Definition: _monetary.h:373
_Locale_monetary * _M_monetary
Definition: _monetary.h:378
~moneypunct_byname _STLP_PSPEC2(wchar_t, false)()
_Locale_monetary * _M_monetary
Definition: _monetary.h:345
money_base::pattern pattern
Definition: _monetary.h:319
moneypunct_byname< wchar_t, true > _Self
Definition: _monetary.h:340
moneypunct_byname _STLP_PSPEC2(wchar_t, true)(_Locale_monetary *__monetary)
~moneypunct_byname _STLP_PSPEC2(wchar_t, true)()
unsigned short wchar_t
Definition: crtdefs.h:345
unsigned char
Definition: typeof.h:29
#define _STLP_TEMPLATE_NULL
Definition: features.h:652
#define _STLP_PSPEC2(t1, t2)
Definition: features.h:1027
#define _STLP_STATIC_DECLSPEC
Definition: features.h:992
#define _STLP_CLASS_DECLSPEC
Definition: features.h:983
#define _STLP_EXPORT_TEMPLATE_CLASS
Definition: features.h:987
#define _STLP_LONGEST_FLOAT_TYPE
Definition: features.h:213
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
#define _STLP_END_NAMESPACE
Definition: features.h:503
#define true
Definition: stdbool.h:36
#define false
Definition: stdbool.h:37
Definition: parser.c:44
Definition: pdh_main.c:94