1.1 --- a/epoc32/include/stdapis/stlport/stl/_monetary.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/stdapis/stlport/stl/_monetary.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,641 @@
1.4 -_monetary.h
1.5 +/*
1.6 + * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.7 + *
1.8 + * Copyright (c) 1999
1.9 + * Silicon Graphics Computer Systems, Inc.
1.10 + *
1.11 + * Copyright (c) 1999
1.12 + * Boris Fomitchev
1.13 + *
1.14 + * This material is provided "as is", with absolutely no warranty expressed
1.15 + * or implied. Any use is at your own risk.
1.16 + *
1.17 + * Permission to use or copy this software for any purpose is hereby granted
1.18 + * without fee, provided the above notices are retained on all copies.
1.19 + * Permission to modify the code and to distribute modified code is granted,
1.20 + * provided the above notices are retained, and a notice that the code was
1.21 + * modified is included with the above copyright notice.
1.22 + *
1.23 + */
1.24 +// WARNING: This is an internal header file, included by other C++
1.25 +// standard library headers. You should not attempt to use this header
1.26 +// file directly.
1.27 +
1.28 +
1.29 +#ifndef _STLP_INTERNAL_MONETARY_H
1.30 +#define _STLP_INTERNAL_MONETARY_H
1.31 +
1.32 +#ifndef _STLP_INTERNAL_CTYPE_H
1.33 +# include <stl/_ctype.h>
1.34 +#endif
1.35 +
1.36 +#ifndef _STLP_INTERNAL_OSTREAMBUF_ITERATOR_H
1.37 +# include <stl/_ostreambuf_iterator.h>
1.38 +#endif
1.39 +
1.40 +#ifndef _STLP_INTERNAL_ISTREAMBUF_ITERATOR_H
1.41 +# include <stl/_istreambuf_iterator.h>
1.42 +#endif
1.43 +
1.44 +_STLP_BEGIN_NAMESPACE
1.45 +
1.46 +class money_base {
1.47 +public:
1.48 + enum part {none, space, symbol, sign, value};
1.49 + struct pattern {
1.50 + char field[4];
1.51 + };
1.52 +};
1.53 +
1.54 +
1.55 +#ifdef __SYMBIAN32__
1.56 +
1.57 +extern locale::id& Moneypunct_charT_GetFacetLocaleId(const char* type);
1.58 +_STLP_DECLSPEC void _Init_monetary_formatsE(money_base::pattern& pos_format,
1.59 + money_base::pattern& neg_format);
1.60 +
1.61 +template <class _CharT, __DFL_NON_TYPE_PARAM(bool, _International, false) >
1.62 +class moneypunct : public locale::facet , public money_base
1.63 +{
1.64 +public:
1.65 + typedef _CharT char_type;
1.66 + typedef basic_string<_CharT> string_type;
1.67 + explicit moneypunct _STLP_PSPEC2(_CharT, _International) (size_t __refs = 0)
1.68 + {
1.69 + _Init_monetary_formatsE(_M_pos_format, _M_neg_format);
1.70 + }
1.71 + _CharT decimal_point() const { return do_decimal_point(); }
1.72 + _CharT thousands_sep() const { return do_thousands_sep(); }
1.73 + string grouping() const { return do_grouping(); }
1.74 + string_type curr_symbol() const { return do_curr_symbol(); }
1.75 + string_type positive_sign() const { return do_positive_sign(); }
1.76 + string_type negative_sign() const { return do_negative_sign(); }
1.77 + int frac_digits() const { return do_frac_digits(); }
1.78 + pattern pos_format() const { return do_pos_format(); }
1.79 + pattern neg_format() const { return do_neg_format(); }
1.80 + #if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.81 + static locale::id& GetFacetLocaleId(){return Moneypunct_charT_GetFacetLocaleId(typeid(_CharT).name()); };
1.82 +#else
1.83 + static locale::id id;
1.84 +#endif
1.85 +# if defined (_STLP_STATIC_CONST_INIT_BUG)
1.86 + enum _IntlVal { intl = _International } ;
1.87 +# else
1.88 + static const bool intl = _International;
1.89 +# endif
1.90 +
1.91 +protected:
1.92 + pattern _M_pos_format;
1.93 + pattern _M_neg_format;
1.94 +
1.95 + static string_type _M_psign, _M_nsign, _M_currSym;
1.96 + static string _M_group;
1.97 + ~moneypunct _STLP_PSPEC2(char, true) () { };
1.98 +
1.99 + virtual _CharT do_decimal_point() const;
1.100 + virtual _CharT do_thousands_sep() const;
1.101 + virtual string do_grouping() const;
1.102 +
1.103 + virtual basic_string<_CharT> do_curr_symbol() const;
1.104 +
1.105 + virtual basic_string<_CharT> do_positive_sign() const;
1.106 + virtual basic_string<_CharT> do_negative_sign() const;
1.107 + virtual int do_frac_digits() const;
1.108 + virtual pattern do_pos_format() const;
1.109 + virtual pattern do_neg_format() const;
1.110 +
1.111 + friend class _Locale;
1.112 +
1.113 +};
1.114 +template <class _CharT, bool _International>
1.115 +string moneypunct<_CharT, _International>::_M_group;
1.116 +template <class _CharT, bool _International>
1.117 +basic_string<_CharT> moneypunct<_CharT, _International>::_M_psign;
1.118 +template <class _CharT, bool _International>
1.119 +basic_string<_CharT> moneypunct<_CharT, _International>::_M_nsign;
1.120 +template <class _CharT, bool _International>
1.121 +basic_string<_CharT> moneypunct<_CharT, _International>::_M_currSym;
1.122 +
1.123 +
1.124 +#else
1.125 +// moneypunct facets: forward declaration
1.126 +template <class _charT, __DFL_NON_TYPE_PARAM(bool, _International, false) > class moneypunct {};
1.127 +#endif
1.128 +
1.129 +// money_get facets
1.130 +
1.131 +template <class _CharT, __DFL_TMPL_PARAM(_InputIter , istreambuf_iterator<_CharT>) >
1.132 +class money_get : public locale::facet
1.133 +{
1.134 + friend class _Locale;
1.135 +public:
1.136 + typedef _CharT char_type;
1.137 + typedef _InputIter iter_type;
1.138 + typedef basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > string_type;
1.139 +
1.140 + money_get(size_t __refs = 0) : _BaseFacet(__refs) {}
1.141 +# ifndef _STLP_NO_LONG_DOUBLE
1.142 + iter_type get(iter_type __s, iter_type __end, bool __intl,
1.143 + ios_base& __str, ios_base::iostate& __err,
1.144 + long double& __units) const
1.145 + { return do_get(__s, __end, __intl, __str, __err, __units); }
1.146 +# endif
1.147 + iter_type get(iter_type __s, iter_type __end, bool __intl,
1.148 + ios_base& __str, ios_base::iostate& __err,
1.149 + string_type& __digits) const
1.150 + { return do_get(__s, __end, __intl, __str, __err, __digits); }
1.151 +
1.152 +#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.153 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
1.154 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId(istreambuf_iterator<wchar_t, char_traits<wchar_t> >* );
1.155 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId(const wchar_t**);
1.156 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId(istreambuf_iterator<char, char_traits<char> >* );
1.157 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId(const char **);
1.158 +#else
1.159 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
1.160 +#endif
1.161 +
1.162 +protected:
1.163 + ~money_get() {}
1.164 +# ifndef _STLP_NO_LONG_DOUBLE
1.165 + virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl,
1.166 + ios_base& __str, ios_base::iostate& __err,
1.167 + long double& __units) const;
1.168 +# endif
1.169 + virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl,
1.170 + ios_base& __str, ios_base::iostate& __err,
1.171 + string_type& __digits) const;
1.172 +};
1.173 +
1.174 +
1.175 +// moneypunct facets: definition of specializations
1.176 +
1.177 +_STLP_TEMPLATE_NULL
1.178 +#ifdef __SYMBIAN32__
1.179 +class moneypunct<char, true> : public locale::facet, public money_base
1.180 +#else
1.181 +class _STLP_CLASS_DECLSPEC moneypunct<char, true> : public locale::facet, public money_base
1.182 +#endif
1.183 +{
1.184 +
1.185 +public:
1.186 + typedef char char_type;
1.187 + typedef string string_type;
1.188 +_STLP_DECLSPEC explicit moneypunct _STLP_PSPEC2(char, true) (size_t __refs = 0);
1.189 +
1.190 + char decimal_point() const { return do_decimal_point(); }
1.191 + char thousands_sep() const { return do_thousands_sep(); }
1.192 + string grouping() const { return do_grouping(); }
1.193 + string_type curr_symbol() const { return do_curr_symbol(); }
1.194 + string_type positive_sign() const { return do_positive_sign(); }
1.195 + string_type negative_sign() const { return do_negative_sign(); }
1.196 + int frac_digits() const { return do_frac_digits(); }
1.197 + pattern pos_format() const { return do_pos_format(); }
1.198 + pattern neg_format() const { return do_neg_format(); }
1.199 +
1.200 +#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.201 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
1.202 +#else
1.203 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
1.204 +#endif
1.205 +# if defined (_STLP_STATIC_CONST_INIT_BUG)
1.206 + enum _IntlVal { intl = 1 } ;
1.207 +# else
1.208 + static const bool intl = true;
1.209 +# endif
1.210 +
1.211 +protected:
1.212 + pattern _M_pos_format;
1.213 + pattern _M_neg_format;
1.214 +
1.215 +_STLP_DECLSPEC ~moneypunct _STLP_PSPEC2(char, true) ();
1.216 +
1.217 +_STLP_DECLSPEC virtual char do_decimal_point() const;
1.218 + _STLP_DECLSPEC virtual char do_thousands_sep() const;
1.219 +_STLP_DECLSPEC virtual string do_grouping() const;
1.220 +
1.221 +_STLP_DECLSPEC virtual string do_curr_symbol() const;
1.222 +
1.223 +_STLP_DECLSPEC virtual string do_positive_sign() const;
1.224 +_STLP_DECLSPEC virtual string do_negative_sign() const;
1.225 +_STLP_DECLSPEC virtual int do_frac_digits() const;
1.226 +_STLP_DECLSPEC virtual pattern do_pos_format() const;
1.227 +_STLP_DECLSPEC virtual pattern do_neg_format() const;
1.228 +
1.229 + friend class _Locale;
1.230 +
1.231 +};
1.232 +
1.233 +_STLP_TEMPLATE_NULL
1.234 +#ifdef __SYMBIAN32__
1.235 +class moneypunct<char, false> : public locale::facet, public money_base
1.236 +#else
1.237 +class _STLP_CLASS_DECLSPEC moneypunct<char, false> : public locale::facet, public money_base
1.238 +#endif
1.239 +{
1.240 +public:
1.241 + typedef char char_type;
1.242 + typedef string string_type;
1.243 +
1.244 +_STLP_DECLSPEC explicit moneypunct _STLP_PSPEC2(char, false) (size_t __refs = 0);
1.245 +
1.246 + char decimal_point() const { return do_decimal_point(); }
1.247 + char thousands_sep() const { return do_thousands_sep(); }
1.248 + string grouping() const { return do_grouping(); }
1.249 + string_type curr_symbol() const { return do_curr_symbol(); }
1.250 + string_type positive_sign() const { return do_positive_sign(); }
1.251 + string_type negative_sign() const { return do_negative_sign(); }
1.252 + int frac_digits() const { return do_frac_digits(); }
1.253 + pattern pos_format() const { return do_pos_format(); }
1.254 + pattern neg_format() const { return do_neg_format(); }
1.255 +
1.256 +#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.257 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
1.258 +#else
1.259 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
1.260 +#endif
1.261 +# if defined (_STLP_STATIC_CONST_INIT_BUG)
1.262 + enum _IntlVal { intl = 0 } ;
1.263 +# else
1.264 + static const bool intl = false;
1.265 +# endif
1.266 +
1.267 +protected:
1.268 + pattern _M_pos_format;
1.269 + pattern _M_neg_format;
1.270 +
1.271 +_STLP_DECLSPEC ~moneypunct _STLP_PSPEC2(char, false) ();
1.272 +
1.273 +_STLP_DECLSPEC virtual char do_decimal_point() const;
1.274 + _STLP_DECLSPEC virtual char do_thousands_sep() const;
1.275 +_STLP_DECLSPEC virtual string do_grouping() const;
1.276 +
1.277 +_STLP_DECLSPEC virtual string do_curr_symbol() const;
1.278 +
1.279 +_STLP_DECLSPEC virtual string do_positive_sign() const;
1.280 +_STLP_DECLSPEC virtual string do_negative_sign() const;
1.281 +_STLP_DECLSPEC virtual int do_frac_digits() const;
1.282 +_STLP_DECLSPEC virtual pattern do_pos_format() const;
1.283 +_STLP_DECLSPEC virtual pattern do_neg_format() const;
1.284 +
1.285 + friend class _Locale;
1.286 +};
1.287 +
1.288 +
1.289 +# ifndef _STLP_NO_WCHAR_T
1.290 +
1.291 +_STLP_TEMPLATE_NULL
1.292 +#ifdef __SYMBIAN32__
1.293 +class moneypunct<wchar_t, true> : public locale::facet, public money_base
1.294 +#else
1.295 +class _STLP_CLASS_DECLSPEC moneypunct<wchar_t, true> : public locale::facet, public money_base
1.296 +#endif
1.297 +{
1.298 + friend class _Locale;
1.299 +public:
1.300 + typedef wchar_t char_type;
1.301 + typedef wstring string_type;
1.302 +_STLP_DECLSPEC explicit moneypunct _STLP_PSPEC2(wchar_t, true) (size_t __refs = 0);
1.303 + wchar_t decimal_point() const { return do_decimal_point(); }
1.304 + wchar_t thousands_sep() const { return do_thousands_sep(); }
1.305 + string grouping() const { return do_grouping(); }
1.306 + string_type curr_symbol() const { return do_curr_symbol(); }
1.307 + string_type positive_sign() const { return do_positive_sign(); }
1.308 + string_type negative_sign() const { return do_negative_sign(); }
1.309 + int frac_digits() const { return do_frac_digits(); }
1.310 + pattern pos_format() const { return do_pos_format(); }
1.311 + pattern neg_format() const { return do_neg_format(); }
1.312 +
1.313 +#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.314 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
1.315 +#else
1.316 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
1.317 +#endif
1.318 +# if defined (_STLP_STATIC_CONST_INIT_BUG)
1.319 + enum _IntlVal { intl = 1 } ;
1.320 +# else
1.321 + static const bool intl = true;
1.322 +# endif
1.323 +
1.324 +protected:
1.325 + pattern _M_pos_format;
1.326 + pattern _M_neg_format;
1.327 +
1.328 +_STLP_DECLSPEC ~moneypunct _STLP_PSPEC2(wchar_t, true) ();
1.329 +
1.330 +_STLP_DECLSPEC virtual wchar_t do_decimal_point() const;
1.331 + _STLP_DECLSPEC virtual wchar_t do_thousands_sep() const;
1.332 +_STLP_DECLSPEC virtual string do_grouping() const;
1.333 +
1.334 +_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
1.335 +
1.336 +_STLP_DECLSPEC virtual string_type do_positive_sign() const;
1.337 +_STLP_DECLSPEC virtual string_type do_negative_sign() const;
1.338 +_STLP_DECLSPEC virtual int do_frac_digits() const;
1.339 +_STLP_DECLSPEC virtual pattern do_pos_format() const;
1.340 +_STLP_DECLSPEC virtual pattern do_neg_format() const;
1.341 +};
1.342 +
1.343 +
1.344 +_STLP_TEMPLATE_NULL
1.345 +#ifdef __SYMBIAN32__
1.346 +class moneypunct<wchar_t, false> : public locale::facet, public money_base
1.347 +#else
1.348 +class _STLP_CLASS_DECLSPEC moneypunct<wchar_t, false> : public locale::facet, public money_base
1.349 +#endif
1.350 +{
1.351 + friend class _Locale;
1.352 +public:
1.353 + typedef wchar_t char_type;
1.354 + typedef wstring string_type;
1.355 +_STLP_DECLSPEC explicit moneypunct _STLP_PSPEC2(wchar_t, false) (size_t __refs = 0);
1.356 + wchar_t decimal_point() const { return do_decimal_point(); }
1.357 + wchar_t thousands_sep() const { return do_thousands_sep(); }
1.358 + string grouping() const { return do_grouping(); }
1.359 + string_type curr_symbol() const { return do_curr_symbol(); }
1.360 + string_type positive_sign() const { return do_positive_sign(); }
1.361 + string_type negative_sign() const { return do_negative_sign(); }
1.362 + int frac_digits() const { return do_frac_digits(); }
1.363 + pattern pos_format() const { return do_pos_format(); }
1.364 + pattern neg_format() const { return do_neg_format(); }
1.365 +
1.366 +#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.367 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
1.368 +#else
1.369 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
1.370 +#endif
1.371 +# if defined (_STLP_STATIC_CONST_INIT_BUG)
1.372 + enum _IntlVal { intl = 0 } ;
1.373 +# else
1.374 + static const bool intl = false;
1.375 +# endif
1.376 +
1.377 +protected:
1.378 + pattern _M_pos_format;
1.379 + pattern _M_neg_format;
1.380 +
1.381 +_STLP_DECLSPEC ~moneypunct _STLP_PSPEC2(wchar_t, false) ();
1.382 +
1.383 +_STLP_DECLSPEC virtual wchar_t do_decimal_point() const;
1.384 + _STLP_DECLSPEC virtual wchar_t do_thousands_sep() const;
1.385 +_STLP_DECLSPEC virtual string do_grouping() const;
1.386 +
1.387 +_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
1.388 +
1.389 +_STLP_DECLSPEC virtual string_type do_positive_sign() const;
1.390 +_STLP_DECLSPEC virtual string_type do_negative_sign() const;
1.391 +_STLP_DECLSPEC virtual int do_frac_digits() const;
1.392 +_STLP_DECLSPEC virtual pattern do_pos_format() const;
1.393 +_STLP_DECLSPEC virtual pattern do_neg_format() const;
1.394 +};
1.395 +
1.396 +# endif
1.397 +
1.398 +
1.399 +#ifdef __SYMBIAN32__
1.400 +_STLP_DECLSPEC _Locale_monetary* __acquire_monetaryE(const char* );
1.401 +_STLP_DECLSPEC void __release_monetaryE (_Locale_monetary* );
1.402 +
1.403 +
1.404 +_STLP_DECLSPEC char _Locale_mon_decimal_pointE(_Locale_monetary* _M_monetary);
1.405 +
1.406 +_STLP_DECLSPEC char _Locale_mon_thousands_sepE(_Locale_monetary* _M_monetary);
1.407 +
1.408 +_STLP_DECLSPEC string _Locale_mon_groupingE(_Locale_monetary* _M_monetary);
1.409 +
1.410 +_STLP_DECLSPEC string _Locale_int_curr_symbolE(_Locale_monetary* _M_monetary);
1.411 +
1.412 +
1.413 +_STLP_DECLSPEC string _Locale_positive_signE(_Locale_monetary* _M_monetary);
1.414 +
1.415 +_STLP_DECLSPEC string _Locale_negative_signE(_Locale_monetary* _M_monetary);
1.416 +
1.417 +_STLP_DECLSPEC int _Locale_int_frac_digitsE(_Locale_monetary* _M_monetary);
1.418 +
1.419 +
1.420 +template <class _CharT, __DFL_NON_TYPE_PARAM(bool , _International , false) >
1.421 +class moneypunct_byname: public moneypunct<_CharT, _International>
1.422 +{
1.423 +public:
1.424 + typedef money_base::pattern pattern;
1.425 + typedef char char_type;
1.426 + typedef basic_string<_CharT> string_type;
1.427 +
1.428 + explicit moneypunct_byname _STLP_PSPEC2(char, _International) (const char * __name, size_t __refs = 0);
1.429 +
1.430 +protected:
1.431 + _Locale_monetary* _M_monetary;
1.432 + ~moneypunct_byname _STLP_PSPEC2(_CharT, _International) ();
1.433 + virtual _CharT do_decimal_point() const;
1.434 + virtual _CharT do_thousands_sep() const;
1.435 + virtual string do_grouping() const;
1.436 +
1.437 + virtual string_type do_curr_symbol() const;
1.438 +
1.439 + virtual string_type do_positive_sign() const;
1.440 + virtual string_type do_negative_sign() const;
1.441 + virtual int do_frac_digits() const;
1.442 + private:
1.443 + void Convert_string2_string_chart(basic_string<_CharT> &dst, string src);
1.444 +
1.445 +};
1.446 +
1.447 +#else
1.448 +
1.449 +template <class _charT, __DFL_NON_TYPE_PARAM(bool , _International , false) > class moneypunct_byname {};
1.450 +
1.451 +#endif
1.452 +
1.453 +_STLP_TEMPLATE_NULL
1.454 +class _STLP_CLASS_DECLSPEC moneypunct_byname<char, true> : public moneypunct<char, true>
1.455 +{
1.456 +public:
1.457 + typedef money_base::pattern pattern;
1.458 + typedef char char_type;
1.459 + typedef string string_type;
1.460 +
1.461 + explicit _STLP_DECLSPEC moneypunct_byname _STLP_PSPEC2(char, true) (const char * __name, size_t __refs = 0);
1.462 +
1.463 +protected:
1.464 + _Locale_monetary* _M_monetary;
1.465 +_STLP_DECLSPEC ~moneypunct_byname _STLP_PSPEC2(char, true) ();
1.466 +_STLP_DECLSPEC virtual char do_decimal_point() const;
1.467 + _STLP_DECLSPEC virtual char do_thousands_sep() const;
1.468 +_STLP_DECLSPEC virtual string do_grouping() const;
1.469 +
1.470 +_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
1.471 +
1.472 +_STLP_DECLSPEC virtual string_type do_positive_sign() const;
1.473 +_STLP_DECLSPEC virtual string_type do_negative_sign() const;
1.474 +_STLP_DECLSPEC virtual int do_frac_digits() const;
1.475 +};
1.476 +
1.477 +_STLP_TEMPLATE_NULL
1.478 +class _STLP_CLASS_DECLSPEC moneypunct_byname<char, false> : public moneypunct<char, false>
1.479 +{
1.480 +public:
1.481 + typedef money_base::pattern pattern;
1.482 + typedef char char_type;
1.483 + typedef string string_type;
1.484 +
1.485 + explicit _STLP_DECLSPEC moneypunct_byname _STLP_PSPEC2(char, false) (const char * __name, size_t __refs = 0);
1.486 +
1.487 +protected:
1.488 + _Locale_monetary* _M_monetary;
1.489 +_STLP_DECLSPEC ~moneypunct_byname _STLP_PSPEC2(char, false) ();
1.490 +_STLP_DECLSPEC virtual char do_decimal_point() const;
1.491 + _STLP_DECLSPEC virtual char do_thousands_sep() const;
1.492 +_STLP_DECLSPEC virtual string do_grouping() const;
1.493 +
1.494 +_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
1.495 +
1.496 +_STLP_DECLSPEC virtual string_type do_positive_sign() const;
1.497 +_STLP_DECLSPEC virtual string_type do_negative_sign() const;
1.498 +_STLP_DECLSPEC virtual int do_frac_digits() const;
1.499 +};
1.500 +
1.501 +# ifndef _STLP_NO_WCHAR_T
1.502 +_STLP_TEMPLATE_NULL
1.503 +class _STLP_CLASS_DECLSPEC moneypunct_byname<wchar_t, true> : public moneypunct<wchar_t, true>
1.504 +{
1.505 +public:
1.506 + typedef money_base::pattern pattern;
1.507 + typedef wchar_t char_type;
1.508 + typedef wstring string_type;
1.509 +
1.510 + explicit _STLP_DECLSPEC moneypunct_byname _STLP_PSPEC2(wchar_t, true) (const char * __name, size_t __refs = 0);
1.511 +
1.512 +protected:
1.513 + _Locale_monetary* _M_monetary;
1.514 +_STLP_DECLSPEC ~moneypunct_byname _STLP_PSPEC2(wchar_t, true) ();
1.515 +_STLP_DECLSPEC virtual wchar_t do_decimal_point() const;
1.516 + _STLP_DECLSPEC virtual wchar_t do_thousands_sep() const;
1.517 +_STLP_DECLSPEC virtual string do_grouping() const;
1.518 +
1.519 +_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
1.520 +
1.521 +_STLP_DECLSPEC virtual string_type do_positive_sign() const;
1.522 +_STLP_DECLSPEC virtual string_type do_negative_sign() const;
1.523 +_STLP_DECLSPEC virtual int do_frac_digits() const;
1.524 +};
1.525 +
1.526 +_STLP_TEMPLATE_NULL
1.527 +class _STLP_CLASS_DECLSPEC moneypunct_byname<wchar_t, false> : public moneypunct<wchar_t, false>
1.528 +{
1.529 +public:
1.530 + typedef money_base::pattern pattern;
1.531 + typedef wchar_t char_type;
1.532 + typedef wstring string_type;
1.533 +
1.534 + explicit _STLP_DECLSPEC moneypunct_byname _STLP_PSPEC2(wchar_t, false) (const char * __name, size_t __refs = 0);
1.535 +
1.536 +protected:
1.537 + _Locale_monetary* _M_monetary;
1.538 +_STLP_DECLSPEC ~moneypunct_byname _STLP_PSPEC2(wchar_t, false) ();
1.539 +_STLP_DECLSPEC virtual wchar_t do_decimal_point() const;
1.540 + _STLP_DECLSPEC virtual wchar_t do_thousands_sep() const;
1.541 +_STLP_DECLSPEC virtual string do_grouping() const;
1.542 +
1.543 +_STLP_DECLSPEC virtual string_type do_curr_symbol() const;
1.544 +
1.545 +_STLP_DECLSPEC virtual string_type do_positive_sign() const;
1.546 +_STLP_DECLSPEC virtual string_type do_negative_sign() const;
1.547 +_STLP_DECLSPEC virtual int do_frac_digits() const;
1.548 +};
1.549 +# endif
1.550 +
1.551 +//===== methods ======
1.552 +
1.553 +
1.554 +// money_put facets
1.555 +
1.556 +template <class _CharT, __DFL_TMPL_PARAM( _OutputIter , ostreambuf_iterator<_CharT>) >
1.557 +class money_put : public locale::facet {
1.558 + friend class _Locale;
1.559 +
1.560 +public:
1.561 + typedef _CharT char_type;
1.562 + typedef _OutputIter iter_type;
1.563 + typedef basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > string_type;
1.564 +
1.565 + money_put(size_t __refs = 0) : _BaseFacet(__refs) {}
1.566 +# ifndef _STLP_NO_LONG_DOUBLE
1.567 + iter_type put(iter_type __s, bool __intl, ios_base& __str,
1.568 + char_type __fill, long double __units) const
1.569 + { return do_put(__s, __intl, __str, __fill, __units); }
1.570 +# endif
1.571 + iter_type put(iter_type __s, bool __intl, ios_base& __str,
1.572 + char_type __fill,
1.573 + const string_type& __digits) const
1.574 + { return do_put(__s, __intl, __str, __fill, __digits); }
1.575 +
1.576 +#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.577 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
1.578 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
1.579 + GetFacetLocaleId(ostreambuf_iterator<wchar_t, char_traits<wchar_t> > *);
1.580 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
1.581 + GetFacetLocaleId(wchar_t**);
1.582 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
1.583 + GetFacetLocaleId(ostreambuf_iterator<char, char_traits<char> > *);
1.584 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId(char**);
1.585 +#else
1.586 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
1.587 +#endif
1.588 +
1.589 +protected:
1.590 + ~money_put() {}
1.591 +# ifndef _STLP_NO_LONG_DOUBLE
1.592 + virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __str,
1.593 + char_type __fill, long double /* __units */ ) const {
1.594 +
1.595 + locale __loc = __str.getloc();
1.596 + _CharT __buf[64];
1.597 + return do_put(__s, __intl, __str, __fill, __buf + 0);
1.598 + }
1.599 +# endif
1.600 + virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __str,
1.601 + char_type __fill,
1.602 + const string_type& __digits) const;
1.603 +};
1.604 +
1.605 +# if defined (_STLP_USE_TEMPLATE_EXPORT)
1.606 +_STLP_EXPORT_TEMPLATE_CLASS money_get<char, istreambuf_iterator<char, char_traits<char> > >;
1.607 +_STLP_EXPORT_TEMPLATE_CLASS money_put<char, ostreambuf_iterator<char, char_traits<char> > >;
1.608 +// _STLP_EXPORT_TEMPLATE_CLASS money_get<char, const char* >;
1.609 +// _STLP_EXPORT_TEMPLATE_CLASS money_put<char, char* >;
1.610 +# if ! defined (_STLP_NO_WCHAR_T)
1.611 +_STLP_EXPORT_TEMPLATE_CLASS money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
1.612 +_STLP_EXPORT_TEMPLATE_CLASS money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
1.613 +// _STLP_EXPORT_TEMPLATE_CLASS money_get<wchar_t, const wchar_t* >;
1.614 +// _STLP_EXPORT_TEMPLATE_CLASS money_put<wchar_t, wchar_t* >;
1.615 +# endif
1.616 +# endif /* _STLP_USE_TEMPLATE_EXPORT */
1.617 +
1.618 +# if defined (__BORLANDC__) && defined (_RTLDLL)
1.619 +inline void _Stl_loc_init_monetary() {
1.620 + money_get<char, istreambuf_iterator<char, char_traits<char> > >::id._M_index = 8;
1.621 + money_get<char, const char*>::id._M_index = 9;
1.622 + money_put<char, ostreambuf_iterator<char, char_traits<char> > >::id._M_index = 10;
1.623 + money_put<char, char*>::id._M_index = 11;
1.624 +# ifndef _STLP_NO_WCHAR_T
1.625 + money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id._M_index = 27;
1.626 + money_get<wchar_t, const wchar_t*>::id._M_index = 28;
1.627 + money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id._M_index = 29;
1.628 + money_put<wchar_t, wchar_t*>::id._M_index = 30;
1.629 +# endif
1.630 +}
1.631 +#endif
1.632 +
1.633 +_STLP_END_NAMESPACE
1.634 +
1.635 +# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
1.636 +# include <stl/_monetary.c>
1.637 +# endif
1.638 +
1.639 +#endif /* _STLP_INTERNAL_MONETARY_H */
1.640 +
1.641 +// Local Variables:
1.642 +// mode:C++
1.643 +// End:
1.644 +
1.645 +