3 * Silicon Graphics Computer Systems, Inc.
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
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.
18 // WARNING: This is an internal header file, included by other C++
19 // standard library headers. You should not attempt to use this header
23 #ifndef _STLP_INTERNAL_NUMPUNCT_H
24 #define _STLP_INTERNAL_NUMPUNCT_H
26 #ifndef _STLP_IOS_BASE_H
27 # include <stl/_ios_base.h>
30 # ifndef _STLP_C_LOCALE_H
31 # include <stl/c_locale.h>
34 #ifndef _STLP_INTERNAL_STRING_H
35 # include <stl/_string.h>
40 //----------------------------------------------------------------------
43 template <class _CharT
> class numpunct
{};
44 template <class _CharT
> class numpunct_byname
{};
45 template <class _Ch
, class _InIt
> class num_get
;
48 class _STLP_CLASS_DECLSPEC numpunct
<char> : public locale::facet
{
50 typedef char char_type
;
51 typedef string string_type
;
53 explicit numpunct(size_t __refs
= 0)
54 : locale::facet(__refs
) {}
56 char decimal_point() const { return do_decimal_point(); }
57 char thousands_sep() const { return do_thousands_sep(); }
58 string
grouping() const { return do_grouping(); }
59 string
truename() const { return do_truename(); }
60 string
falsename() const { return do_falsename(); }
62 static _STLP_STATIC_DECLSPEC
locale::id id
;
67 virtual char do_decimal_point() const;
68 virtual char do_thousands_sep() const;
69 virtual string
do_grouping() const;
70 virtual string
do_truename() const;
71 virtual string
do_falsename() const;
74 # if ! defined (_STLP_NO_WCHAR_T)
77 class _STLP_CLASS_DECLSPEC numpunct
<wchar_t> : public locale::facet
{
79 typedef wchar_t char_type
;
80 typedef wstring string_type
;
82 explicit numpunct(size_t __refs
= 0)
83 : locale::facet(__refs
) {}
85 wchar_t decimal_point() const { return do_decimal_point(); }
86 wchar_t thousands_sep() const { return do_thousands_sep(); }
87 string
grouping() const { return do_grouping(); }
88 wstring
truename() const { return do_truename(); }
89 wstring
falsename() const { return do_falsename(); }
91 static _STLP_STATIC_DECLSPEC
locale::id id
;
96 virtual wchar_t do_decimal_point() const;
97 virtual wchar_t do_thousands_sep() const;
98 virtual string
do_grouping() const;
99 virtual wstring
do_truename() const;
100 virtual wstring
do_falsename() const;
103 # endif /* WCHAR_T */
106 class _STLP_CLASS_DECLSPEC numpunct_byname
<char> : public numpunct
<char> {
107 friend class _Locale_impl
;
109 typedef char char_type
;
110 typedef string string_type
;
112 explicit numpunct_byname(const char* __name
, size_t __refs
= 0);
118 virtual char do_decimal_point() const;
119 virtual char do_thousands_sep() const;
120 virtual string
do_grouping() const;
121 virtual string
do_truename() const;
122 virtual string
do_falsename() const;
125 numpunct_byname(_Locale_numeric
*__numeric
)
126 : _M_numeric(__numeric
) {}
128 //explicitely defined as private to avoid warnings:
129 typedef numpunct_byname
<char> _Self
;
130 numpunct_byname(_Self
const&);
131 _Self
& operator = (_Self
const&);
133 _Locale_numeric
* _M_numeric
;
136 # ifndef _STLP_NO_WCHAR_T
138 class _STLP_CLASS_DECLSPEC numpunct_byname
<wchar_t>: public numpunct
<wchar_t> {
139 friend class _Locale_impl
;
141 typedef wchar_t char_type
;
142 typedef wstring string_type
;
144 explicit numpunct_byname(const char* __name
, size_t __refs
= 0);
149 virtual wchar_t do_decimal_point() const;
150 virtual wchar_t do_thousands_sep() const;
151 virtual string
do_grouping() const;
152 virtual wstring
do_truename() const;
153 virtual wstring
do_falsename() const;
156 numpunct_byname(_Locale_numeric
*__numeric
)
157 : _M_numeric(__numeric
) {}
159 //explicitely defined as private to avoid warnings:
160 typedef numpunct_byname
<wchar_t> _Self
;
161 numpunct_byname(_Self
const&);
162 _Self
& operator = (_Self
const&);
164 _Locale_numeric
* _M_numeric
;
167 # endif /* WCHAR_T */
171 #endif /* _STLP_NUMPUNCT_H */