ReactOS  0.4.15-dev-1150-g593bcce
monetary.cpp
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 #include "stlport_prefix.h"
19 
20 #include <locale>
21 #include <istream>
22 
24 
26  money_base::pattern& neg_format) {
27  pos_format.field[0] = (char) money_base::symbol;
28  pos_format.field[1] = (char) money_base::sign;
29  pos_format.field[2] = (char) money_base::none;
30  pos_format.field[3] = (char) money_base::value;
31 
32  neg_format.field[0] = (char) money_base::symbol;
33  neg_format.field[1] = (char) money_base::sign;
34  neg_format.field[2] = (char) money_base::none;
35  neg_format.field[3] = (char) money_base::value;
36 }
37 
38 // This is being used throughout the library
39 static const string _S_empty_string;
40 #ifndef _STLP_NO_WCHAR_T
41 static const wstring _S_empty_wstring;
42 #endif
43 
44 //
45 // moneypunct<>
46 //
47 
48 moneypunct<char, true>::moneypunct(size_t __refs) : locale::facet(__refs)
49 { _Init_monetary_formats(_M_pos_format, _M_neg_format); }
51 
52 char moneypunct<char, true>::do_decimal_point() const {return ' ';}
53 char moneypunct<char, true>::do_thousands_sep() const {return ' ';}
61 
62 moneypunct<char, false>::moneypunct(size_t __refs) : locale::facet(__refs)
63 { _Init_monetary_formats(_M_pos_format, _M_neg_format); }
65 
68 
76 
77 #ifndef _STLP_NO_WCHAR_T
78 moneypunct<wchar_t, true>::moneypunct(size_t __refs) : locale::facet(__refs)
79 { _Init_monetary_formats(_M_pos_format, _M_neg_format); }
81 
82 wchar_t moneypunct<wchar_t, true>::do_decimal_point() const {return L' ';}
83 wchar_t moneypunct<wchar_t, true>::do_thousands_sep() const {return L' ';}
85 
87 {return _S_empty_wstring;}
89 {return _S_empty_wstring;}
91 {return _S_empty_wstring;}
94 {return _M_pos_format;}
96 {return _M_neg_format;}
97 
98 moneypunct<wchar_t, false>::moneypunct(size_t __refs) : locale::facet(__refs)
99 { _Init_monetary_formats(_M_pos_format, _M_neg_format); }
101 
106 {return _S_empty_wstring;}
108 {return _S_empty_wstring;}
110 {return _S_empty_wstring;}
112 
114 {return _M_pos_format;}
116 {return _M_neg_format;}
117 
118 #endif /* WCHAR_T */
119 
120 //
121 // Instantiations
122 //
123 
124 #if !defined (_STLP_NO_FORCE_INSTANTIATE)
125 
128 // template class money_put<char, char*>;
129 
130 # ifndef _STLP_NO_WCHAR_T
133 // template class money_put<wchar_t, wchar_t*>;
134 // template class money_get<wchar_t, const wchar_t*>;
135 # endif
136 
137 #endif
138 
139 #if !defined (_STLP_STATIC_CONST_INIT_BUG) && !defined (_STLP_NO_STATIC_CONST_DEFINITION)
142 # ifndef _STLP_NO_WCHAR_T
145 # endif
146 #endif
147 
149 
150 // Local Variables:
151 // mode:C++
152 // End:
Definition: _locale.h:75
unsigned char
Definition: typeof.h:29
static const string _S_empty_string
Definition: monetary.cpp:39
static const wstring _S_empty_wstring
Definition: monetary.cpp:41
static _STLP_BEGIN_NAMESPACE void _Init_monetary_formats(money_base::pattern &pos_format, money_base::pattern &neg_format)
Definition: monetary.cpp:25
static const WCHAR L[]
Definition: oid.c:1250
#define _STLP_CLASS_DECLSPEC
Definition: features.h:983
#define _STLP_END_NAMESPACE
Definition: features.h:503
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501