williamr@2
|
1 |
/*
|
williamr@4
|
2 |
* Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
|
williamr@2
|
3 |
*
|
williamr@2
|
4 |
* Copyright (c) 1999
|
williamr@2
|
5 |
* Silicon Graphics Computer Systems, Inc.
|
williamr@2
|
6 |
*
|
williamr@4
|
7 |
* Copyright (c) 1999
|
williamr@2
|
8 |
* Boris Fomitchev
|
williamr@2
|
9 |
*
|
williamr@2
|
10 |
* This material is provided "as is", with absolutely no warranty expressed
|
williamr@2
|
11 |
* or implied. Any use is at your own risk.
|
williamr@2
|
12 |
*
|
williamr@4
|
13 |
* Permission to use or copy this software for any purpose is hereby granted
|
williamr@2
|
14 |
* without fee, provided the above notices are retained on all copies.
|
williamr@2
|
15 |
* Permission to modify the code and to distribute modified code is granted,
|
williamr@2
|
16 |
* provided the above notices are retained, and a notice that the code was
|
williamr@2
|
17 |
* modified is included with the above copyright notice.
|
williamr@2
|
18 |
*
|
williamr@4
|
19 |
*/
|
williamr@2
|
20 |
// WARNING: This is an internal header file, included by other C++
|
williamr@2
|
21 |
// standard library headers. You should not attempt to use this header
|
williamr@2
|
22 |
// file directly.
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#ifndef _STLP_INTERNAL_MONETARY_H
|
williamr@2
|
26 |
#define _STLP_INTERNAL_MONETARY_H
|
williamr@2
|
27 |
|
williamr@2
|
28 |
#ifndef _STLP_INTERNAL_CTYPE_H
|
williamr@4
|
29 |
# include <stl/_ctype.h>
|
williamr@2
|
30 |
#endif
|
williamr@2
|
31 |
|
williamr@2
|
32 |
#ifndef _STLP_INTERNAL_OSTREAMBUF_ITERATOR_H
|
williamr@4
|
33 |
# include <stl/_ostreambuf_iterator.h>
|
williamr@2
|
34 |
#endif
|
williamr@2
|
35 |
|
williamr@2
|
36 |
#ifndef _STLP_INTERNAL_ISTREAMBUF_ITERATOR_H
|
williamr@4
|
37 |
# include <stl/_istreambuf_iterator.h>
|
williamr@2
|
38 |
#endif
|
williamr@2
|
39 |
|
williamr@2
|
40 |
_STLP_BEGIN_NAMESPACE
|
williamr@2
|
41 |
|
williamr@2
|
42 |
class money_base {
|
williamr@2
|
43 |
public:
|
williamr@2
|
44 |
enum part {none, space, symbol, sign, value};
|
williamr@2
|
45 |
struct pattern {
|
williamr@2
|
46 |
char field[4];
|
williamr@2
|
47 |
};
|
williamr@2
|
48 |
};
|
williamr@2
|
49 |
|
williamr@2
|
50 |
// moneypunct facets: forward declaration
|
williamr@4
|
51 |
template <class _charT, _STLP_DFL_NON_TYPE_PARAM(bool, _International, false) > class moneypunct {};
|
williamr@2
|
52 |
|
williamr@2
|
53 |
// money_get facets
|
williamr@2
|
54 |
|
williamr@4
|
55 |
#if defined (_STLP_LIMITED_DEFAULT_TEMPLATES)
|
williamr@4
|
56 |
template <class _CharT, class _InputIter>
|
williamr@4
|
57 |
#else
|
williamr@4
|
58 |
template <class _CharT, class _InputIter = istreambuf_iterator<_CharT, char_traits<_CharT> > >
|
williamr@4
|
59 |
#endif
|
williamr@4
|
60 |
class money_get : public locale::facet {
|
williamr@4
|
61 |
friend class _Locale_impl;
|
williamr@4
|
62 |
|
williamr@2
|
63 |
public:
|
williamr@2
|
64 |
typedef _CharT char_type;
|
williamr@2
|
65 |
typedef _InputIter iter_type;
|
williamr@2
|
66 |
typedef basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > string_type;
|
williamr@2
|
67 |
|
williamr@4
|
68 |
money_get(size_t __refs = 0) : locale::facet(__refs) {}
|
williamr@2
|
69 |
iter_type get(iter_type __s, iter_type __end, bool __intl,
|
williamr@2
|
70 |
ios_base& __str, ios_base::iostate& __err,
|
williamr@4
|
71 |
_STLP_LONGEST_FLOAT_TYPE& __units) const
|
williamr@2
|
72 |
{ return do_get(__s, __end, __intl, __str, __err, __units); }
|
williamr@2
|
73 |
iter_type get(iter_type __s, iter_type __end, bool __intl,
|
williamr@2
|
74 |
ios_base& __str, ios_base::iostate& __err,
|
williamr@2
|
75 |
string_type& __digits) const
|
williamr@2
|
76 |
{ return do_get(__s, __end, __intl, __str, __err, __digits); }
|
williamr@2
|
77 |
|
williamr@4
|
78 |
#if defined(__SYMBIAN32__WSD__)
|
williamr@4
|
79 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
80 |
#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
|
williamr@4
|
81 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
82 |
static locale::id id;
|
williamr@4
|
83 |
#else
|
williamr@4
|
84 |
// NOTE: Symbian doesn't support exporting static data.
|
williamr@4
|
85 |
// Users of this class should use GetFacetLocaleId() to access the data member id
|
williamr@4
|
86 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
|
williamr@2
|
87 |
#endif
|
williamr@2
|
88 |
|
williamr@2
|
89 |
protected:
|
williamr@2
|
90 |
~money_get() {}
|
williamr@2
|
91 |
virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl,
|
williamr@2
|
92 |
ios_base& __str, ios_base::iostate& __err,
|
williamr@4
|
93 |
_STLP_LONGEST_FLOAT_TYPE& __units) const;
|
williamr@2
|
94 |
virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl,
|
williamr@2
|
95 |
ios_base& __str, ios_base::iostate& __err,
|
williamr@2
|
96 |
string_type& __digits) const;
|
williamr@2
|
97 |
};
|
williamr@2
|
98 |
|
williamr@2
|
99 |
|
williamr@2
|
100 |
// moneypunct facets: definition of specializations
|
williamr@2
|
101 |
|
williamr@2
|
102 |
_STLP_TEMPLATE_NULL
|
williamr@4
|
103 |
class _STLP_CLASS_DECLSPEC moneypunct<char, true> : public locale::facet, public money_base {
|
williamr@2
|
104 |
|
williamr@2
|
105 |
public:
|
williamr@2
|
106 |
typedef char char_type;
|
williamr@2
|
107 |
typedef string string_type;
|
williamr@4
|
108 |
_STLP_DECLSPEC explicit moneypunct _STLP_PSPEC2(char, true) (size_t __refs = 0);
|
williamr@2
|
109 |
|
williamr@2
|
110 |
char decimal_point() const { return do_decimal_point(); }
|
williamr@2
|
111 |
char thousands_sep() const { return do_thousands_sep(); }
|
williamr@2
|
112 |
string grouping() const { return do_grouping(); }
|
williamr@2
|
113 |
string_type curr_symbol() const { return do_curr_symbol(); }
|
williamr@2
|
114 |
string_type positive_sign() const { return do_positive_sign(); }
|
williamr@2
|
115 |
string_type negative_sign() const { return do_negative_sign(); }
|
williamr@2
|
116 |
int frac_digits() const { return do_frac_digits(); }
|
williamr@2
|
117 |
pattern pos_format() const { return do_pos_format(); }
|
williamr@2
|
118 |
pattern neg_format() const { return do_neg_format(); }
|
williamr@2
|
119 |
|
williamr@4
|
120 |
#if defined(__SYMBIAN32__WSD__)
|
williamr@4
|
121 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
122 |
#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
|
williamr@4
|
123 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
124 |
static locale::id id;
|
williamr@2
|
125 |
#else
|
williamr@4
|
126 |
// NOTE: Symbian doesn't support exporting static data.
|
williamr@4
|
127 |
// Users of this class should use GetFacetLocaleId() to access the data member id
|
williamr@4
|
128 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
|
williamr@2
|
129 |
#endif
|
williamr@2
|
130 |
# if defined (_STLP_STATIC_CONST_INIT_BUG)
|
williamr@2
|
131 |
enum _IntlVal { intl = 1 } ;
|
williamr@2
|
132 |
# else
|
williamr@2
|
133 |
static const bool intl = true;
|
williamr@2
|
134 |
# endif
|
williamr@2
|
135 |
|
williamr@2
|
136 |
protected:
|
williamr@2
|
137 |
pattern _M_pos_format;
|
williamr@2
|
138 |
pattern _M_neg_format;
|
williamr@2
|
139 |
|
williamr@4
|
140 |
_STLP_DECLSPEC ~moneypunct _STLP_PSPEC2(char, true) ();
|
williamr@2
|
141 |
|
williamr@4
|
142 |
_STLP_DECLSPEC virtual char do_decimal_point() const;
|
williamr@2
|
143 |
_STLP_DECLSPEC virtual char do_thousands_sep() const;
|
williamr@4
|
144 |
_STLP_DECLSPEC virtual string do_grouping() const;
|
williamr@2
|
145 |
|
williamr@4
|
146 |
_STLP_DECLSPEC virtual string do_curr_symbol() const;
|
williamr@2
|
147 |
|
williamr@4
|
148 |
_STLP_DECLSPEC virtual string do_positive_sign() const;
|
williamr@4
|
149 |
_STLP_DECLSPEC virtual string do_negative_sign() const;
|
williamr@4
|
150 |
_STLP_DECLSPEC virtual int do_frac_digits() const;
|
williamr@4
|
151 |
_STLP_DECLSPEC virtual pattern do_pos_format() const;
|
williamr@4
|
152 |
_STLP_DECLSPEC virtual pattern do_neg_format() const;
|
williamr@2
|
153 |
|
williamr@4
|
154 |
friend class _Locale_impl;
|
williamr@2
|
155 |
};
|
williamr@2
|
156 |
|
williamr@2
|
157 |
_STLP_TEMPLATE_NULL
|
williamr@2
|
158 |
class _STLP_CLASS_DECLSPEC moneypunct<char, false> : public locale::facet, public money_base
|
williamr@2
|
159 |
{
|
williamr@2
|
160 |
public:
|
williamr@2
|
161 |
typedef char char_type;
|
williamr@2
|
162 |
typedef string string_type;
|
williamr@2
|
163 |
|
williamr@4
|
164 |
_STLP_DECLSPEC explicit moneypunct _STLP_PSPEC2(char, false) (size_t __refs = 0);
|
williamr@2
|
165 |
|
williamr@2
|
166 |
char decimal_point() const { return do_decimal_point(); }
|
williamr@2
|
167 |
char thousands_sep() const { return do_thousands_sep(); }
|
williamr@2
|
168 |
string grouping() const { return do_grouping(); }
|
williamr@2
|
169 |
string_type curr_symbol() const { return do_curr_symbol(); }
|
williamr@2
|
170 |
string_type positive_sign() const { return do_positive_sign(); }
|
williamr@2
|
171 |
string_type negative_sign() const { return do_negative_sign(); }
|
williamr@2
|
172 |
int frac_digits() const { return do_frac_digits(); }
|
williamr@2
|
173 |
pattern pos_format() const { return do_pos_format(); }
|
williamr@2
|
174 |
pattern neg_format() const { return do_neg_format(); }
|
williamr@2
|
175 |
|
williamr@4
|
176 |
#if defined(__SYMBIAN32__WSD__)
|
williamr@4
|
177 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
178 |
#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
|
williamr@4
|
179 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
180 |
static locale::id id;
|
williamr@2
|
181 |
#else
|
williamr@4
|
182 |
// NOTE: Symbian doesn't support exporting static data.
|
williamr@4
|
183 |
// Users of this class should use GetFacetLocaleId() to access the data member id
|
williamr@4
|
184 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
|
williamr@2
|
185 |
#endif
|
williamr@4
|
186 |
|
williamr@2
|
187 |
# if defined (_STLP_STATIC_CONST_INIT_BUG)
|
williamr@2
|
188 |
enum _IntlVal { intl = 0 } ;
|
williamr@2
|
189 |
# else
|
williamr@2
|
190 |
static const bool intl = false;
|
williamr@2
|
191 |
# endif
|
williamr@2
|
192 |
|
williamr@2
|
193 |
protected:
|
williamr@2
|
194 |
pattern _M_pos_format;
|
williamr@2
|
195 |
pattern _M_neg_format;
|
williamr@2
|
196 |
|
williamr@4
|
197 |
_STLP_DECLSPEC ~moneypunct _STLP_PSPEC2(char, false) ();
|
williamr@2
|
198 |
|
williamr@4
|
199 |
_STLP_DECLSPEC virtual char do_decimal_point() const;
|
williamr@2
|
200 |
_STLP_DECLSPEC virtual char do_thousands_sep() const;
|
williamr@4
|
201 |
_STLP_DECLSPEC virtual string do_grouping() const;
|
williamr@2
|
202 |
|
williamr@4
|
203 |
_STLP_DECLSPEC virtual string do_curr_symbol() const;
|
williamr@2
|
204 |
|
williamr@4
|
205 |
_STLP_DECLSPEC virtual string do_positive_sign() const;
|
williamr@4
|
206 |
_STLP_DECLSPEC virtual string do_negative_sign() const;
|
williamr@4
|
207 |
_STLP_DECLSPEC virtual int do_frac_digits() const;
|
williamr@4
|
208 |
_STLP_DECLSPEC virtual pattern do_pos_format() const;
|
williamr@4
|
209 |
_STLP_DECLSPEC virtual pattern do_neg_format() const;
|
williamr@2
|
210 |
|
williamr@4
|
211 |
friend class _Locale_impl;
|
williamr@2
|
212 |
};
|
williamr@2
|
213 |
|
williamr@2
|
214 |
|
williamr@2
|
215 |
# ifndef _STLP_NO_WCHAR_T
|
williamr@2
|
216 |
|
williamr@2
|
217 |
_STLP_TEMPLATE_NULL
|
williamr@2
|
218 |
class _STLP_CLASS_DECLSPEC moneypunct<wchar_t, true> : public locale::facet, public money_base
|
williamr@2
|
219 |
{
|
williamr@4
|
220 |
friend class _Locale_impl;
|
williamr@2
|
221 |
public:
|
williamr@2
|
222 |
typedef wchar_t char_type;
|
williamr@2
|
223 |
typedef wstring string_type;
|
williamr@4
|
224 |
_STLP_DECLSPEC explicit moneypunct _STLP_PSPEC2(wchar_t, true) (size_t __refs = 0);
|
williamr@2
|
225 |
wchar_t decimal_point() const { return do_decimal_point(); }
|
williamr@2
|
226 |
wchar_t thousands_sep() const { return do_thousands_sep(); }
|
williamr@2
|
227 |
string grouping() const { return do_grouping(); }
|
williamr@2
|
228 |
string_type curr_symbol() const { return do_curr_symbol(); }
|
williamr@2
|
229 |
string_type positive_sign() const { return do_positive_sign(); }
|
williamr@2
|
230 |
string_type negative_sign() const { return do_negative_sign(); }
|
williamr@2
|
231 |
int frac_digits() const { return do_frac_digits(); }
|
williamr@2
|
232 |
pattern pos_format() const { return do_pos_format(); }
|
williamr@2
|
233 |
pattern neg_format() const { return do_neg_format(); }
|
williamr@2
|
234 |
|
williamr@4
|
235 |
#if defined(__SYMBIAN32__WSD__)
|
williamr@4
|
236 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
237 |
#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
|
williamr@4
|
238 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
239 |
static locale::id id;
|
williamr@2
|
240 |
#else
|
williamr@4
|
241 |
// NOTE: Symbian doesn't support exporting static data.
|
williamr@4
|
242 |
// Users of this class should use GetFacetLocaleId() to access the data member id
|
williamr@4
|
243 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
|
williamr@2
|
244 |
#endif
|
williamr@4
|
245 |
|
williamr@2
|
246 |
# if defined (_STLP_STATIC_CONST_INIT_BUG)
|
williamr@2
|
247 |
enum _IntlVal { intl = 1 } ;
|
williamr@2
|
248 |
# else
|
williamr@2
|
249 |
static const bool intl = true;
|
williamr@2
|
250 |
# endif
|
williamr@2
|
251 |
|
williamr@2
|
252 |
protected:
|
williamr@2
|
253 |
pattern _M_pos_format;
|
williamr@2
|
254 |
pattern _M_neg_format;
|
williamr@2
|
255 |
|
williamr@4
|
256 |
_STLP_DECLSPEC ~moneypunct _STLP_PSPEC2(wchar_t, true) ();
|
williamr@2
|
257 |
|
williamr@4
|
258 |
_STLP_DECLSPEC virtual wchar_t do_decimal_point() const;
|
williamr@2
|
259 |
_STLP_DECLSPEC virtual wchar_t do_thousands_sep() const;
|
williamr@4
|
260 |
_STLP_DECLSPEC virtual string do_grouping() const;
|
williamr@2
|
261 |
|
williamr@4
|
262 |
_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
|
williamr@2
|
263 |
|
williamr@4
|
264 |
_STLP_DECLSPEC virtual string_type do_positive_sign() const;
|
williamr@4
|
265 |
_STLP_DECLSPEC virtual string_type do_negative_sign() const;
|
williamr@4
|
266 |
_STLP_DECLSPEC virtual int do_frac_digits() const;
|
williamr@4
|
267 |
_STLP_DECLSPEC virtual pattern do_pos_format() const;
|
williamr@4
|
268 |
_STLP_DECLSPEC virtual pattern do_neg_format() const;
|
williamr@2
|
269 |
};
|
williamr@2
|
270 |
|
williamr@2
|
271 |
|
williamr@2
|
272 |
_STLP_TEMPLATE_NULL
|
williamr@2
|
273 |
class _STLP_CLASS_DECLSPEC moneypunct<wchar_t, false> : public locale::facet, public money_base
|
williamr@2
|
274 |
{
|
williamr@4
|
275 |
friend class _Locale_impl;
|
williamr@2
|
276 |
public:
|
williamr@2
|
277 |
typedef wchar_t char_type;
|
williamr@2
|
278 |
typedef wstring string_type;
|
williamr@4
|
279 |
_STLP_DECLSPEC explicit moneypunct _STLP_PSPEC2(wchar_t, false) (size_t __refs = 0);
|
williamr@2
|
280 |
wchar_t decimal_point() const { return do_decimal_point(); }
|
williamr@2
|
281 |
wchar_t thousands_sep() const { return do_thousands_sep(); }
|
williamr@2
|
282 |
string grouping() const { return do_grouping(); }
|
williamr@2
|
283 |
string_type curr_symbol() const { return do_curr_symbol(); }
|
williamr@2
|
284 |
string_type positive_sign() const { return do_positive_sign(); }
|
williamr@2
|
285 |
string_type negative_sign() const { return do_negative_sign(); }
|
williamr@2
|
286 |
int frac_digits() const { return do_frac_digits(); }
|
williamr@2
|
287 |
pattern pos_format() const { return do_pos_format(); }
|
williamr@2
|
288 |
pattern neg_format() const { return do_neg_format(); }
|
williamr@2
|
289 |
|
williamr@4
|
290 |
#if defined(__SYMBIAN32__WSD__)
|
williamr@4
|
291 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
292 |
#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
|
williamr@4
|
293 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
294 |
static locale::id id;
|
williamr@2
|
295 |
#else
|
williamr@4
|
296 |
// NOTE: Symbian doesn't support exporting static data.
|
williamr@4
|
297 |
// Users of this class should use GetFacetLocaleId() to access the data member id
|
williamr@4
|
298 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
|
williamr@2
|
299 |
#endif
|
williamr@4
|
300 |
|
williamr@2
|
301 |
# if defined (_STLP_STATIC_CONST_INIT_BUG)
|
williamr@2
|
302 |
enum _IntlVal { intl = 0 } ;
|
williamr@2
|
303 |
# else
|
williamr@2
|
304 |
static const bool intl = false;
|
williamr@2
|
305 |
# endif
|
williamr@2
|
306 |
|
williamr@2
|
307 |
protected:
|
williamr@2
|
308 |
pattern _M_pos_format;
|
williamr@2
|
309 |
pattern _M_neg_format;
|
williamr@2
|
310 |
|
williamr@4
|
311 |
_STLP_DECLSPEC ~moneypunct _STLP_PSPEC2(wchar_t, false) ();
|
williamr@2
|
312 |
|
williamr@4
|
313 |
_STLP_DECLSPEC virtual wchar_t do_decimal_point() const;
|
williamr@2
|
314 |
_STLP_DECLSPEC virtual wchar_t do_thousands_sep() const;
|
williamr@4
|
315 |
_STLP_DECLSPEC virtual string do_grouping() const;
|
williamr@2
|
316 |
|
williamr@4
|
317 |
_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
|
williamr@2
|
318 |
|
williamr@4
|
319 |
_STLP_DECLSPEC virtual string_type do_positive_sign() const;
|
williamr@4
|
320 |
_STLP_DECLSPEC virtual string_type do_negative_sign() const;
|
williamr@4
|
321 |
_STLP_DECLSPEC virtual int do_frac_digits() const;
|
williamr@4
|
322 |
_STLP_DECLSPEC virtual pattern do_pos_format() const;
|
williamr@4
|
323 |
_STLP_DECLSPEC virtual pattern do_neg_format() const;
|
williamr@2
|
324 |
};
|
williamr@2
|
325 |
|
williamr@2
|
326 |
# endif
|
williamr@2
|
327 |
|
williamr@4
|
328 |
template <class _charT, _STLP_DFL_NON_TYPE_PARAM(bool , _International , false) > class moneypunct_byname {};
|
williamr@2
|
329 |
|
williamr@4
|
330 |
_STLP_TEMPLATE_NULL
|
williamr@4
|
331 |
class _STLP_CLASS_DECLSPEC moneypunct_byname<char, true> : public moneypunct<char, true> {
|
williamr@2
|
332 |
public:
|
williamr@2
|
333 |
typedef money_base::pattern pattern;
|
williamr@2
|
334 |
typedef char char_type;
|
williamr@4
|
335 |
typedef string string_type;
|
williamr@2
|
336 |
|
williamr@4
|
337 |
_STLP_DECLSPEC explicit moneypunct_byname _STLP_PSPEC2(char, true) (const char * __name, size_t __refs = 0,
|
williamr@4
|
338 |
_Locale_name_hint* __hint = 0);
|
williamr@4
|
339 |
|
williamr@2
|
340 |
protected:
|
williamr@2
|
341 |
_Locale_monetary* _M_monetary;
|
williamr@4
|
342 |
_STLP_DECLSPEC ~moneypunct_byname _STLP_PSPEC2(char, true) ();
|
williamr@4
|
343 |
_STLP_DECLSPEC virtual char do_decimal_point() const;
|
williamr@4
|
344 |
_STLP_DECLSPEC virtual char do_thousands_sep() const;
|
williamr@4
|
345 |
_STLP_DECLSPEC virtual string do_grouping() const;
|
williamr@2
|
346 |
|
williamr@4
|
347 |
_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
|
williamr@2
|
348 |
|
williamr@4
|
349 |
_STLP_DECLSPEC virtual string_type do_positive_sign() const;
|
williamr@4
|
350 |
_STLP_DECLSPEC virtual string_type do_negative_sign() const;
|
williamr@4
|
351 |
_STLP_DECLSPEC virtual int do_frac_digits() const;
|
williamr@4
|
352 |
|
williamr@4
|
353 |
private:
|
williamr@4
|
354 |
typedef moneypunct_byname<char, true> _Self;
|
williamr@4
|
355 |
//explicitely defined as private to avoid warnings:
|
williamr@4
|
356 |
moneypunct_byname(_Self const&);
|
williamr@4
|
357 |
_Self& operator = (_Self const&);
|
williamr@2
|
358 |
};
|
williamr@2
|
359 |
|
williamr@2
|
360 |
_STLP_TEMPLATE_NULL
|
williamr@4
|
361 |
class _STLP_CLASS_DECLSPEC moneypunct_byname<char, false> : public moneypunct<char, false>
|
williamr@2
|
362 |
{
|
williamr@2
|
363 |
public:
|
williamr@2
|
364 |
typedef money_base::pattern pattern;
|
williamr@2
|
365 |
typedef char char_type;
|
williamr@2
|
366 |
typedef string string_type;
|
williamr@2
|
367 |
|
williamr@4
|
368 |
_STLP_DECLSPEC explicit moneypunct_byname _STLP_PSPEC2(char, false) (const char * __name, size_t __refs = 0,
|
williamr@4
|
369 |
_Locale_name_hint* __hint = 0);
|
williamr@2
|
370 |
|
williamr@2
|
371 |
protected:
|
williamr@2
|
372 |
_Locale_monetary* _M_monetary;
|
williamr@4
|
373 |
_STLP_DECLSPEC ~moneypunct_byname _STLP_PSPEC2(char, false) ();
|
williamr@4
|
374 |
_STLP_DECLSPEC virtual char do_decimal_point() const;
|
williamr@2
|
375 |
_STLP_DECLSPEC virtual char do_thousands_sep() const;
|
williamr@4
|
376 |
_STLP_DECLSPEC virtual string do_grouping() const;
|
williamr@2
|
377 |
|
williamr@4
|
378 |
_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
|
williamr@2
|
379 |
|
williamr@4
|
380 |
_STLP_DECLSPEC virtual string_type do_positive_sign() const;
|
williamr@4
|
381 |
_STLP_DECLSPEC virtual string_type do_negative_sign() const;
|
williamr@4
|
382 |
_STLP_DECLSPEC virtual int do_frac_digits() const;
|
williamr@4
|
383 |
|
williamr@4
|
384 |
private:
|
williamr@4
|
385 |
typedef moneypunct_byname<char, false> _Self;
|
williamr@4
|
386 |
//explicitely defined as private to avoid warnings:
|
williamr@4
|
387 |
moneypunct_byname(_Self const&);
|
williamr@4
|
388 |
_Self& operator = (_Self const&);
|
williamr@4
|
389 |
friend _Locale_name_hint* _Locale_extract_hint(moneypunct_byname<char, false>*);
|
williamr@2
|
390 |
};
|
williamr@2
|
391 |
|
williamr@4
|
392 |
#if !defined (_STLP_NO_WCHAR_T)
|
williamr@2
|
393 |
_STLP_TEMPLATE_NULL
|
williamr@4
|
394 |
class _STLP_CLASS_DECLSPEC moneypunct_byname<wchar_t, true> : public moneypunct<wchar_t, true>
|
williamr@2
|
395 |
{
|
williamr@2
|
396 |
public:
|
williamr@2
|
397 |
typedef money_base::pattern pattern;
|
williamr@2
|
398 |
typedef wchar_t char_type;
|
williamr@2
|
399 |
typedef wstring string_type;
|
williamr@2
|
400 |
|
williamr@4
|
401 |
_STLP_DECLSPEC explicit moneypunct_byname _STLP_PSPEC2(wchar_t, true) (const char * __name, size_t __refs = 0,
|
williamr@4
|
402 |
_Locale_name_hint* __hint = 0);
|
williamr@2
|
403 |
|
williamr@2
|
404 |
protected:
|
williamr@2
|
405 |
_Locale_monetary* _M_monetary;
|
williamr@4
|
406 |
_STLP_DECLSPEC ~moneypunct_byname _STLP_PSPEC2(wchar_t, true) ();
|
williamr@4
|
407 |
_STLP_DECLSPEC virtual wchar_t do_decimal_point() const;
|
williamr@2
|
408 |
_STLP_DECLSPEC virtual wchar_t do_thousands_sep() const;
|
williamr@4
|
409 |
_STLP_DECLSPEC virtual string do_grouping() const;
|
williamr@2
|
410 |
|
williamr@4
|
411 |
_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
|
williamr@2
|
412 |
|
williamr@4
|
413 |
_STLP_DECLSPEC virtual string_type do_positive_sign() const;
|
williamr@4
|
414 |
_STLP_DECLSPEC virtual string_type do_negative_sign() const;
|
williamr@4
|
415 |
_STLP_DECLSPEC virtual int do_frac_digits() const;
|
williamr@4
|
416 |
|
williamr@4
|
417 |
private:
|
williamr@4
|
418 |
typedef moneypunct_byname<wchar_t, true> _Self;
|
williamr@4
|
419 |
//explicitely defined as private to avoid warnings:
|
williamr@4
|
420 |
moneypunct_byname(_Self const&);
|
williamr@4
|
421 |
_Self& operator = (_Self const&);
|
williamr@2
|
422 |
};
|
williamr@2
|
423 |
|
williamr@2
|
424 |
_STLP_TEMPLATE_NULL
|
williamr@4
|
425 |
class _STLP_CLASS_DECLSPEC moneypunct_byname<wchar_t, false> : public moneypunct<wchar_t, false>
|
williamr@2
|
426 |
{
|
williamr@2
|
427 |
public:
|
williamr@2
|
428 |
typedef money_base::pattern pattern;
|
williamr@2
|
429 |
typedef wchar_t char_type;
|
williamr@2
|
430 |
typedef wstring string_type;
|
williamr@2
|
431 |
|
williamr@4
|
432 |
_STLP_DECLSPEC explicit moneypunct_byname _STLP_PSPEC2(wchar_t, false) (const char * __name, size_t __refs = 0,
|
williamr@4
|
433 |
_Locale_name_hint* __hint = 0);
|
williamr@2
|
434 |
|
williamr@2
|
435 |
protected:
|
williamr@2
|
436 |
_Locale_monetary* _M_monetary;
|
williamr@4
|
437 |
_STLP_DECLSPEC ~moneypunct_byname _STLP_PSPEC2(wchar_t, false) ();
|
williamr@4
|
438 |
_STLP_DECLSPEC virtual wchar_t do_decimal_point() const;
|
williamr@2
|
439 |
_STLP_DECLSPEC virtual wchar_t do_thousands_sep() const;
|
williamr@4
|
440 |
_STLP_DECLSPEC virtual string do_grouping() const;
|
williamr@2
|
441 |
|
williamr@4
|
442 |
_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
|
williamr@2
|
443 |
|
williamr@4
|
444 |
_STLP_DECLSPEC virtual string_type do_positive_sign() const;
|
williamr@4
|
445 |
_STLP_DECLSPEC virtual string_type do_negative_sign() const;
|
williamr@4
|
446 |
_STLP_DECLSPEC virtual int do_frac_digits() const;
|
williamr@4
|
447 |
|
williamr@4
|
448 |
private:
|
williamr@4
|
449 |
typedef moneypunct_byname<wchar_t, false> _Self;
|
williamr@4
|
450 |
//explicitely defined as private to avoid warnings:
|
williamr@4
|
451 |
moneypunct_byname(_Self const&);
|
williamr@4
|
452 |
_Self& operator = (_Self const&);
|
williamr@2
|
453 |
};
|
williamr@4
|
454 |
#endif
|
williamr@2
|
455 |
|
williamr@2
|
456 |
//===== methods ======
|
williamr@2
|
457 |
|
williamr@2
|
458 |
|
williamr@2
|
459 |
// money_put facets
|
williamr@2
|
460 |
|
williamr@4
|
461 |
#if defined (_STLP_LIMITED_DEFAULT_TEMPLATES)
|
williamr@4
|
462 |
template <class _CharT, class _OutputIter>
|
williamr@4
|
463 |
#else
|
williamr@4
|
464 |
template <class _CharT, class _OutputIter = ostreambuf_iterator<_CharT, char_traits<_CharT> > >
|
williamr@4
|
465 |
#endif
|
williamr@2
|
466 |
class money_put : public locale::facet {
|
williamr@4
|
467 |
friend class _Locale_impl;
|
williamr@2
|
468 |
|
williamr@2
|
469 |
public:
|
williamr@2
|
470 |
typedef _CharT char_type;
|
williamr@2
|
471 |
typedef _OutputIter iter_type;
|
williamr@2
|
472 |
typedef basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > string_type;
|
williamr@2
|
473 |
|
williamr@4
|
474 |
money_put(size_t __refs = 0) : locale::facet(__refs) {}
|
williamr@2
|
475 |
iter_type put(iter_type __s, bool __intl, ios_base& __str,
|
williamr@4
|
476 |
char_type __fill, _STLP_LONGEST_FLOAT_TYPE __units) const
|
williamr@2
|
477 |
{ return do_put(__s, __intl, __str, __fill, __units); }
|
williamr@2
|
478 |
iter_type put(iter_type __s, bool __intl, ios_base& __str,
|
williamr@4
|
479 |
char_type __fill,
|
williamr@2
|
480 |
const string_type& __digits) const
|
williamr@2
|
481 |
{ return do_put(__s, __intl, __str, __fill, __digits); }
|
williamr@2
|
482 |
|
williamr@4
|
483 |
#if defined(__SYMBIAN32__WSD__)
|
williamr@4
|
484 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
485 |
#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
|
williamr@4
|
486 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
|
williamr@4
|
487 |
static locale::id id;
|
williamr@2
|
488 |
#else
|
williamr@4
|
489 |
// NOTE: Symbian doesn't support exporting static data.
|
williamr@4
|
490 |
// Users of this class should use GetFacetLocaleId() to access the data member id
|
williamr@4
|
491 |
static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
|
williamr@2
|
492 |
#endif
|
williamr@2
|
493 |
|
williamr@2
|
494 |
protected:
|
williamr@2
|
495 |
~money_put() {}
|
williamr@2
|
496 |
virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __str,
|
williamr@4
|
497 |
char_type __fill, _STLP_LONGEST_FLOAT_TYPE __units) const;
|
williamr@2
|
498 |
virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __str,
|
williamr@2
|
499 |
char_type __fill,
|
williamr@2
|
500 |
const string_type& __digits) const;
|
williamr@2
|
501 |
};
|
williamr@2
|
502 |
|
williamr@2
|
503 |
# if defined (_STLP_USE_TEMPLATE_EXPORT)
|
williamr@2
|
504 |
_STLP_EXPORT_TEMPLATE_CLASS money_get<char, istreambuf_iterator<char, char_traits<char> > >;
|
williamr@2
|
505 |
_STLP_EXPORT_TEMPLATE_CLASS money_put<char, ostreambuf_iterator<char, char_traits<char> > >;
|
williamr@4
|
506 |
//_STLP_EXPORT_TEMPLATE_CLASS money_get<char, const char* >;
|
williamr@4
|
507 |
//_STLP_EXPORT_TEMPLATE_CLASS money_put<char, char* >;
|
williamr@2
|
508 |
# if ! defined (_STLP_NO_WCHAR_T)
|
williamr@2
|
509 |
_STLP_EXPORT_TEMPLATE_CLASS money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
|
williamr@2
|
510 |
_STLP_EXPORT_TEMPLATE_CLASS money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
|
williamr@2
|
511 |
// _STLP_EXPORT_TEMPLATE_CLASS money_get<wchar_t, const wchar_t* >;
|
williamr@2
|
512 |
// _STLP_EXPORT_TEMPLATE_CLASS money_put<wchar_t, wchar_t* >;
|
williamr@2
|
513 |
# endif
|
williamr@2
|
514 |
# endif /* _STLP_USE_TEMPLATE_EXPORT */
|
williamr@2
|
515 |
|
williamr@2
|
516 |
_STLP_END_NAMESPACE
|
williamr@2
|
517 |
|
williamr@4
|
518 |
#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
|
williamr@2
|
519 |
# include <stl/_monetary.c>
|
williamr@4
|
520 |
#endif
|
williamr@2
|
521 |
|
williamr@2
|
522 |
#endif /* _STLP_INTERNAL_MONETARY_H */
|
williamr@2
|
523 |
|
williamr@2
|
524 |
// Local Variables:
|
williamr@2
|
525 |
// mode:C++
|
williamr@2
|
526 |
// End:
|
williamr@2
|
527 |
|
williamr@2
|
528 |
|