32#ifndef _RWSTD_LOC_MONEYPUNCT_H_INCLUDED
33#define _RWSTD_LOC_MONEYPUNCT_H_INCLUDED
37# pragma GCC system_header
53 enum part { none, space, symbol, sign,
value };
54 struct pattern {
char field [4]; };
60template <
class _CharT,
bool _Intl = false>
61struct moneypunct: _RW::__rw_facet,
public money_base
63 typedef _CharT char_type;
65 basic_string<char_type, char_traits<char_type>, allocator<char_type> >
68 explicit moneypunct (_RWSTD_SIZE_T __refs = 0)
69 : _RW::__rw_facet (__refs) { }
73 char_type decimal_point ()
const {
74 return do_decimal_point ();
77 char_type thousands_sep ()
const {
78 return do_thousands_sep ();
81 string grouping ()
const {
82 return do_grouping ();
85 string_type curr_symbol ()
const {
86 return do_curr_symbol ();
89 string_type positive_sign ()
const {
90 return do_positive_sign ();
93 string_type negative_sign ()
const {
94 return do_negative_sign ();
97 int frac_digits ()
const {
98 return do_frac_digits ();
101 pattern pos_format ()
const {
102 return do_pos_format ();
105 pattern neg_format ()
const {
106 return do_neg_format ();
109 static _RW::__rw_facet_id id;
116 virtual char_type do_decimal_point ()
const {
117 return *_C_get (
this, _RW::__rw_dp);
121 virtual char_type do_thousands_sep ()
const {
122 return *_C_get (
this, _RW::__rw_ts);
126 virtual string do_grouping ()
const {
132 virtual string_type do_curr_symbol ()
const {
133 return _C_get (
this, _RW::__rw_cs);
137 virtual string_type do_positive_sign ()
const {
138 return _C_get (
this, _RW::__rw_ps);
142 virtual string_type do_negative_sign ()
const {
143 return _C_get (
this, _RW::__rw_ns);
147 virtual int do_frac_digits ()
const {
149 _C_get (
this, _RW::__rw_fd)));
153 virtual pattern do_pos_format ()
const {
155 _C_get (
this, _RW::__rw_pf));
159 virtual pattern do_neg_format ()
const {
161 _C_get (
this, _RW::__rw_nf));
166 static const char_type* _C_get (
const _RW::__rw_facet*,
int);
170#ifndef _RWSTD_NO_SPECIALIZED_FACET_ID
173_RW::__rw_facet_id moneypunct<char, false>::id;
176_RW::__rw_facet_id moneypunct<char, true>::id;
178# ifndef _RWSTD_NO_WCHAR_T
181_RW::__rw_facet_id moneypunct<wchar_t, false>::id;
184_RW::__rw_facet_id moneypunct<wchar_t, true>::id;
190template <
class _CharT,
bool _Intl >
192moneypunct<_CharT, _Intl>::_C_get (
const _RW::__rw_facet *__pf,
int __fl)
195 __fl |= _RW::__rw_intl;
197 __fl |= _RW::__rw_mon;
200 _RW::__rw_get_punct(__pf, __fl, char_type()));
205template <
class _CharT,
bool _Intl = false>
206class moneypunct_byname:
public moneypunct<_CharT, _Intl>
208 char _C_namebuf [32];
212 explicit moneypunct_byname (
const char *__name, _RWSTD_SIZE_T __ref = 0)
213 : moneypunct<_CharT, _Intl>(__ref) {
214 this->_C_set_name (__name, _C_namebuf,
sizeof _C_namebuf);
224#if _RWSTD_DEFINE_TEMPLATE_FIRST (_MONEYPUNCT)
230# pragma warning (push)
231# pragma warning (disable: 4231)
237#if _RWSTD_INSTANTIATE (_MONEYPUNCT, _CHAR)
244#if _RWSTD_INSTANTIATE (_MONEYPUNCT, _WCHAR_T)
255# pragma warning (pop)
259#if _RWSTD_DEFINE_TEMPLATE_LAST (_MONEYPUNCT)
#define _RWSTD_SPECIALIZED_CLASS
#define _RWSTD_INSTANTIATE_2(a1, a2)
#define _RWSTD_REINTERPRET_CAST(T, x)
#define _RWSTD_STATIC_CAST(T, x)
#define _RWSTD_NAMESPACE(name)
#define _RWSTD_ATTRIBUTE_NOTHROW
#define _RWSTD_STATIC_CONST(type, init)