First public contribution.
2 * Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
5 * Silicon Graphics Computer Systems, Inc.
10 * This material is provided "as is", with absolutely no warranty expressed
11 * or implied. Any use is at your own risk.
13 * Permission to use or copy this software for any purpose is hereby granted
14 * without fee, provided the above notices are retained on all copies.
15 * Permission to modify the code and to distribute modified code is granted,
16 * provided the above notices are retained, and a notice that the code was
17 * modified is included with the above copyright notice.
20 #include "stlport_prefix.h"
25 #if defined(__SYMBIAN32__WSD__)
26 #include "libstdcppwsd.h"
28 void monetary_empty_string_init()
30 get_monetary_S_empty_string().copy("", 1);
31 # ifndef _STLP_NO_WCHAR_T
32 get_monetary_S_empty_wstring().copy(L"", 1);
33 # endif //_STLP_NO_WCHAR_T
35 #define _S_empty_string get_monetary_S_empty_string()
36 #define _S_empty_wstring get_monetary_S_empty_wstring()
42 static void _Init_monetary_formats(money_base::pattern& pos_format,
43 money_base::pattern& neg_format) {
44 pos_format.field[0] = (char) money_base::symbol;
45 pos_format.field[1] = (char) money_base::sign;
46 pos_format.field[2] = (char) money_base::none;
47 pos_format.field[3] = (char) money_base::value;
49 neg_format.field[0] = (char) money_base::symbol;
50 neg_format.field[1] = (char) money_base::sign;
51 neg_format.field[2] = (char) money_base::none;
52 neg_format.field[3] = (char) money_base::value;
55 // This is being used throughout the library
56 #if !defined(__SYMBIAN32__WSD__)
57 static const string _S_empty_string;
58 #ifndef _STLP_NO_WCHAR_T
59 static const wstring _S_empty_wstring;
61 #endif //__SYMBIAN32__WSD__
66 _STLP_DECLSPEC moneypunct<char, true>::moneypunct(size_t __refs) : locale::facet(__refs)
67 { _Init_monetary_formats(_M_pos_format, _M_neg_format); }
68 _STLP_DECLSPEC moneypunct<char, true>::~moneypunct() {}
70 _STLP_DECLSPEC char moneypunct<char, true>::do_decimal_point() const {return ' ';}
71 _STLP_DECLSPEC char moneypunct<char, true>::do_thousands_sep() const {return ' ';}
72 _STLP_DECLSPEC string moneypunct<char, true>::do_grouping() const { return _S_empty_string; }
73 _STLP_DECLSPEC string moneypunct<char, true>::do_curr_symbol() const { return _S_empty_string; }
74 _STLP_DECLSPEC string moneypunct<char, true>::do_positive_sign() const { return _S_empty_string; }
75 _STLP_DECLSPEC string moneypunct<char, true>::do_negative_sign() const { return _S_empty_string; }
76 _STLP_DECLSPEC money_base::pattern moneypunct<char, true>::do_pos_format() const {return _M_pos_format;}
77 _STLP_DECLSPEC money_base::pattern moneypunct<char, true>::do_neg_format() const {return _M_neg_format;}
78 _STLP_DECLSPEC int moneypunct<char, true>::do_frac_digits() const {return 0;}
80 _STLP_DECLSPEC moneypunct<char, false>::moneypunct(size_t __refs) : locale::facet(__refs)
81 { _Init_monetary_formats(_M_pos_format, _M_neg_format); }
82 _STLP_DECLSPEC moneypunct<char, false>::~moneypunct() {}
84 _STLP_DECLSPEC char moneypunct<char, false>::do_decimal_point() const {return ' ';}
85 _STLP_DECLSPEC char moneypunct<char, false>::do_thousands_sep() const {return ' ';}
87 _STLP_DECLSPEC string moneypunct<char, false>::do_grouping() const { return _S_empty_string; }
88 _STLP_DECLSPEC string moneypunct<char, false>::do_curr_symbol() const { return _S_empty_string; }
89 _STLP_DECLSPEC string moneypunct<char, false>::do_positive_sign() const { return _S_empty_string; }
90 _STLP_DECLSPEC string moneypunct<char, false>::do_negative_sign() const { return _S_empty_string; }
91 _STLP_DECLSPEC money_base::pattern moneypunct<char, false>::do_pos_format() const {return _M_pos_format;}
92 _STLP_DECLSPEC money_base::pattern moneypunct<char, false>::do_neg_format() const {return _M_neg_format;}
93 _STLP_DECLSPEC int moneypunct<char, false>::do_frac_digits() const {return 0;}
95 #ifndef _STLP_NO_WCHAR_T
96 _STLP_DECLSPEC moneypunct<wchar_t, true>::moneypunct(size_t __refs) : locale::facet(__refs)
97 { _Init_monetary_formats(_M_pos_format, _M_neg_format); }
98 _STLP_DECLSPEC moneypunct<wchar_t, true>::~moneypunct() {}
100 _STLP_DECLSPEC wchar_t moneypunct<wchar_t, true>::do_decimal_point() const {return L' ';}
101 _STLP_DECLSPEC wchar_t moneypunct<wchar_t, true>::do_thousands_sep() const {return L' ';}
102 _STLP_DECLSPEC string moneypunct<wchar_t, true>::do_grouping() const {return _S_empty_string;}
104 _STLP_DECLSPEC wstring moneypunct<wchar_t, true>::do_curr_symbol() const
105 {return _S_empty_wstring;}
106 _STLP_DECLSPEC wstring moneypunct<wchar_t, true>::do_positive_sign() const
107 {return _S_empty_wstring;}
108 _STLP_DECLSPEC wstring moneypunct<wchar_t, true>::do_negative_sign() const
109 {return _S_empty_wstring;}
110 _STLP_DECLSPEC int moneypunct<wchar_t, true>::do_frac_digits() const {return 0;}
111 _STLP_DECLSPEC money_base::pattern moneypunct<wchar_t, true>::do_pos_format() const
112 {return _M_pos_format;}
113 _STLP_DECLSPEC money_base::pattern moneypunct<wchar_t, true>::do_neg_format() const
114 {return _M_neg_format;}
116 _STLP_DECLSPEC moneypunct<wchar_t, false>::moneypunct(size_t __refs) : locale::facet(__refs)
117 { _Init_monetary_formats(_M_pos_format, _M_neg_format); }
118 _STLP_DECLSPEC moneypunct<wchar_t, false>::~moneypunct() {}
120 _STLP_DECLSPEC wchar_t moneypunct<wchar_t, false>::do_decimal_point() const {return L' ';}
121 _STLP_DECLSPEC wchar_t moneypunct<wchar_t, false>::do_thousands_sep() const {return L' ';}
122 _STLP_DECLSPEC string moneypunct<wchar_t, false>::do_grouping() const { return _S_empty_string;}
123 _STLP_DECLSPEC wstring moneypunct<wchar_t, false>::do_curr_symbol() const
124 {return _S_empty_wstring;}
125 _STLP_DECLSPEC wstring moneypunct<wchar_t, false>::do_positive_sign() const
126 {return _S_empty_wstring;}
127 _STLP_DECLSPEC wstring moneypunct<wchar_t, false>::do_negative_sign() const
128 {return _S_empty_wstring;}
129 _STLP_DECLSPEC int moneypunct<wchar_t, false>::do_frac_digits() const {return 0;}
131 _STLP_DECLSPEC money_base::pattern moneypunct<wchar_t, false>::do_pos_format() const
132 {return _M_pos_format;}
133 _STLP_DECLSPEC money_base::pattern moneypunct<wchar_t, false>::do_neg_format() const
134 {return _M_neg_format;}
138 #if defined (__SYMBIAN32__WSD__)
140 _STLP_DECLSPEC locale::id& money_get<char, istreambuf_iterator<char, char_traits<char> > >::GetFacetLocaleId()
142 return get_libcpp_wsd().money_get_char_istreambuf_iterator_id;
145 _STLP_DECLSPEC locale::id& money_put<char, ostreambuf_iterator<char, char_traits<char> > >::GetFacetLocaleId()
147 return get_libcpp_wsd().money_put_char_ostreambuf_iterator_id;
149 # ifndef _STLP_NO_WCHAR_T
151 _STLP_DECLSPEC locale::id& money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::GetFacetLocaleId()
153 return get_libcpp_wsd().money_get_wchar_istreambuf_iterator_id;
156 _STLP_DECLSPEC locale::id& money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::GetFacetLocaleId()
158 return get_libcpp_wsd().money_put_wchar_ostreambuf_iterator_id;
160 # endif /* _STLP_NO_WCHAR_T */
161 #endif /* __SYMBIAN32__WSD__ */
167 #if !defined(_STLP_NO_FORCE_INSTANTIATE)
169 template class _STLP_CLASS_DECLSPEC money_get<char, istreambuf_iterator<char, char_traits<char> > >;
170 template class _STLP_CLASS_DECLSPEC money_put<char, ostreambuf_iterator<char, char_traits<char> > >;
171 // template class money_put<char, char*>;
173 # ifndef _STLP_NO_WCHAR_T
174 template class _STLP_CLASS_DECLSPEC money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
175 template class _STLP_CLASS_DECLSPEC money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
176 // template class money_put<wchar_t, wchar_t*>;
177 // template class money_get<wchar_t, const wchar_t*>;
182 #if defined (__EPOC32__)
184 locale::id money_get<char, istreambuf_iterator<char, char_traits<char> > >::id={8};
187 locale::id money_put<char, ostreambuf_iterator<char, char_traits<char> > >::id={10};
189 locale::id money_put<char, char*>::id;
191 # if !defined (_STLP_NO_WCHAR_T)
193 locale::id money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id={27};
195 locale::id money_get<wchar_t, const wchar_t*>::id;
198 locale::id money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id={29};