32#ifndef _RWSTD_LOC_NUMPUNCT_H_INCLUDED
33#define _RWSTD_LOC_NUMPUNCT_H_INCLUDED
37# pragma GCC system_header
55template <
class _CharT>
56struct numpunct: _RW::__rw_facet
58 typedef _CharT char_type;
60 basic_string<char_type, char_traits<char_type>, allocator<char_type> >
63 explicit numpunct (_RWSTD_SIZE_T __ref = 0)
64 : _RW::__rw_facet (__ref), _C_flags (0) { }
69 char_type decimal_point ()
const;
72 char_type thousands_sep ()
const;
75 string grouping ()
const;
78 string_type truename ()
const;
81 string_type falsename ()
const;
83 static _RW::__rw_facet_id id;
88 virtual char_type do_decimal_point ()
const {
89 return *_RW::__rw_get_punct (
this, _RW::__rw_dp, char_type ());
93 virtual char_type do_thousands_sep ()
const {
94 return *_RW::__rw_get_punct (
this, _RW::__rw_ts, char_type ());
98 virtual string do_grouping ()
const {
100 _RW::__rw_get_punct (
this, _RW::__rw_gr, char_type ()));
104 virtual string_type do_truename ()
const {
105 return _RW::__rw_get_punct (
this, _RW::__rw_tn, char_type ());
109 virtual string_type do_falsename ()
const {
110 return _RW::__rw_get_punct (
this, _RW::__rw_fn, char_type ());
117 string_type _C_truename;
118 string_type _C_falsename;
119 char_type _C_decimal_point;
120 char_type _C_thousands_sep;
124#ifndef _RWSTD_NO_SPECIALIZED_FACET_ID
127_RW::__rw_facet_id numpunct<char>::id;
129# ifndef _RWSTD_NO_WCHAR_T
132_RW::__rw_facet_id numpunct<wchar_t>::id;
138template <
class _CharT>
139inline typename numpunct<_CharT>::char_type
140numpunct<_CharT>::decimal_point ()
const
142 if (!(_C_flags & _RW::__rw_dp)) {
148 __self->_C_decimal_point = do_decimal_point ();
149 __self->_C_flags |= _RW::__rw_dp;
152 return _C_decimal_point;
156template <
class _CharT>
157inline typename numpunct<_CharT>::char_type
158numpunct<_CharT>::thousands_sep ()
const
160 if (!(_C_flags & _RW::__rw_ts)) {
166 __self->_C_thousands_sep = do_thousands_sep ();
167 __self->_C_flags |= _RW::__rw_ts;
170 return _C_thousands_sep;
174template <
class _CharT>
175inline string numpunct<_CharT>::grouping ()
const
177 if (!(_C_flags & _RW::__rw_gr)) {
183 __self->_C_grouping = do_grouping ();
184 __self->_C_flags |= _RW::__rw_gr;
191template <
class _CharT>
192inline typename numpunct<_CharT>::string_type
193numpunct<_CharT>::truename ()
const
195 if (!(_C_flags & _RW::__rw_tn)) {
201 __self->_C_truename = do_truename ();
202 __self->_C_flags |= _RW::__rw_tn;
209template <
class _CharT>
210inline typename numpunct<_CharT>::string_type
211numpunct<_CharT>::falsename ()
const
213 if (!(_C_flags & _RW::__rw_fn)) {
219 __self->_C_falsename = do_falsename ();
220 __self->_C_flags |= _RW::__rw_fn;
230template <
class _CharT>
231class numpunct_byname:
public numpunct<_CharT>
233 char _C_namebuf [32];
237 explicit numpunct_byname (
const char *__name, _RWSTD_SIZE_T __refs = 0)
238 : numpunct<_CharT>(__refs) {
239 this->_C_set_name (__name, _C_namebuf,
sizeof _C_namebuf);
248#if _RWSTD_DEFINE_TEMPLATE_FIRST (_NUMPUNCT)
254# pragma warning (push)
255# pragma warning (disable: 4231)
261#if _RWSTD_INSTANTIATE (_NUMPUNCT, _CHAR)
267#if _RWSTD_INSTANTIATE (_NUMPUNCT, _WCHAR_T)
277# pragma warning (pop)
281#if _RWSTD_DEFINE_TEMPLATE_LAST (_NUMPUNCT)
#define _RWSTD_SPECIALIZED_CLASS
#define _RWSTD_INSTANTIATE_1(arg)
#define _RWSTD_REINTERPRET_CAST(T, x)
#define _RWSTD_NAMESPACE(name)
#define _RWSTD_ATTRIBUTE_NOTHROW
#define _RWSTD_CONST_CAST(T, x)