ReactOS  0.4.13-dev-259-g5ca9c9c
_numpunct.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_NUMPUNCT_H
24 #define _STLP_INTERNAL_NUMPUNCT_H
25 
26 #ifndef _STLP_IOS_BASE_H
27 # include <stl/_ios_base.h>
28 #endif
29 
30 # ifndef _STLP_C_LOCALE_H
31 # include <stl/c_locale.h>
32 # endif
33 
34 #ifndef _STLP_INTERNAL_STRING_H
35 # include <stl/_string.h>
36 #endif
37 
39 
40 //----------------------------------------------------------------------
41 // numpunct facets
42 
43 template <class _CharT> class numpunct {};
44 template <class _CharT> class numpunct_byname {};
45 template <class _Ch, class _InIt> class num_get;
46 
49 public:
50  typedef char char_type;
51  typedef string string_type;
52 
53  explicit numpunct(size_t __refs = 0)
54  : locale::facet(__refs) {}
55 
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(); }
61 
63 
64 protected:
65  ~numpunct();
66 
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;
72 };
73 
74 # if ! defined (_STLP_NO_WCHAR_T)
75 
78 public:
79  typedef wchar_t char_type;
80  typedef wstring string_type;
81 
82  explicit numpunct(size_t __refs = 0)
83  : locale::facet(__refs) {}
84 
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(); }
90 
92 
93 protected:
94  ~numpunct();
95 
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;
101 };
102 
103 # endif /* WCHAR_T */
104 
107  friend class _Locale_impl;
108 public:
109  typedef char char_type;
110  typedef string string_type;
111 
112  explicit numpunct_byname(const char* __name, size_t __refs = 0);
113 
114 protected:
115 
116  ~numpunct_byname();
117 
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;
123 
124 private:
126  : _M_numeric(__numeric) {}
127 
128  //explicitely defined as private to avoid warnings:
130  numpunct_byname(_Self const&);
131  _Self& operator = (_Self const&);
132 
134 };
135 
136 # ifndef _STLP_NO_WCHAR_T
139  friend class _Locale_impl;
140 public:
141  typedef wchar_t char_type;
142  typedef wstring string_type;
143 
144  explicit numpunct_byname(const char* __name, size_t __refs = 0);
145 
146 protected:
147  ~numpunct_byname();
148 
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;
154 
155 private:
157  : _M_numeric(__numeric) {}
158 
159  //explicitely defined as private to avoid warnings:
161  numpunct_byname(_Self const&);
162  _Self& operator = (_Self const&);
163 
165 };
166 
167 # endif /* WCHAR_T */
168 
170 
171 #endif /* _STLP_NUMPUNCT_H */
172 
173 // Local Variables:
174 // mode:C++
175 // End:
176 
wchar_t decimal_point() const
Definition: _numpunct.h:85
string grouping() const
Definition: _numpunct.h:87
numpunct_byname(_Locale_numeric *__numeric)
Definition: _numpunct.h:156
_Locale_numeric * _M_numeric
Definition: _numpunct.h:164
wchar_t thousands_sep() const
Definition: _numpunct.h:86
void operator=(const _Locale_impl &)
static _STLP_STATIC_DECLSPEC locale::id id
Definition: _numpunct.h:91
string falsename() const
Definition: _numpunct.h:60
_Locale_numeric * _M_numeric
Definition: _numpunct.h:133
string string_type
Definition: _numpunct.h:51
Definition: _locale.h:75
string truename() const
Definition: _numpunct.h:59
unsigned char
Definition: typeof.h:29
unsigned short wchar_t
Definition: crtdefs.h:324
numpunct_byname< char > _Self
Definition: _numpunct.h:129
static _STLP_STATIC_DECLSPEC locale::id id
Definition: _numpunct.h:62
string grouping() const
Definition: _numpunct.h:58
char thousands_sep() const
Definition: _numpunct.h:57
char decimal_point() const
Definition: _numpunct.h:56
#define _STLP_CLASS_DECLSPEC
Definition: features.h:983
#define _STLP_TEMPLATE_NULL
Definition: features.h:652
wstring truename() const
Definition: _numpunct.h:88
numpunct_byname< wchar_t > _Self
Definition: _numpunct.h:160
#define _STLP_END_NAMESPACE
Definition: features.h:503
wstring falsename() const
Definition: _numpunct.h:89
numpunct(size_t __refs=0)
Definition: _numpunct.h:82
numpunct(size_t __refs=0)
Definition: _numpunct.h:53
wstring string_type
Definition: _numpunct.h:80
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
#define _STLP_STATIC_DECLSPEC
Definition: features.h:992
numpunct_byname(_Locale_numeric *__numeric)
Definition: _numpunct.h:125