1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/tools/stlport/stl/_numpunct.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,184 @@
1.4 +/*
1.5 + * Copyright (c) 1999
1.6 + * Silicon Graphics Computer Systems, Inc.
1.7 + *
1.8 + * Copyright (c) 1999
1.9 + * Boris Fomitchev
1.10 + *
1.11 + * This material is provided "as is", with absolutely no warranty expressed
1.12 + * or implied. Any use is at your own risk.
1.13 + *
1.14 + * Permission to use or copy this software for any purpose is hereby granted
1.15 + * without fee, provided the above notices are retained on all copies.
1.16 + * Permission to modify the code and to distribute modified code is granted,
1.17 + * provided the above notices are retained, and a notice that the code was
1.18 + * modified is included with the above copyright notice.
1.19 + *
1.20 + */
1.21 +// WARNING: This is an internal header file, included by other C++
1.22 +// standard library headers. You should not attempt to use this header
1.23 +// file directly.
1.24 +
1.25 +
1.26 +#ifndef _STLP_INTERNAL_NUMPUNCT_H
1.27 +#define _STLP_INTERNAL_NUMPUNCT_H
1.28 +
1.29 +#ifndef _STLP_IOS_BASE_H
1.30 +# include <stl/_ios_base.h>
1.31 +#endif
1.32 +
1.33 +# ifndef _STLP_C_LOCALE_H
1.34 +# include <stl/c_locale.h>
1.35 +# endif
1.36 +
1.37 +#ifndef _STLP_INTERNAL_STRING_H
1.38 +# include <stl/_string.h>
1.39 +#endif
1.40 +
1.41 +_STLP_BEGIN_NAMESPACE
1.42 +
1.43 +//----------------------------------------------------------------------
1.44 +// numpunct facets
1.45 +
1.46 +template <class _CharT> class numpunct {};
1.47 +template <class _CharT> class numpunct_byname {};
1.48 +template <class _Ch, class _InIt> class num_get;
1.49 +
1.50 +_STLP_TEMPLATE_NULL
1.51 +class _STLP_CLASS_DECLSPEC numpunct<char> : public locale::facet
1.52 +{
1.53 + friend class _Locale_impl;
1.54 +
1.55 +#ifndef _STLP_NO_FRIEND_TEMPLATES
1.56 + template <class _Ch, class _InIt> friend class num_get;
1.57 +#endif
1.58 +public:
1.59 + typedef char char_type;
1.60 + typedef string string_type;
1.61 +
1.62 + explicit numpunct(size_t __refs = 0)
1.63 + : locale::facet(__refs), _M_truename("true"), _M_falsename("false") {}
1.64 +
1.65 + char decimal_point() const { return do_decimal_point(); }
1.66 + char thousands_sep() const { return do_thousands_sep(); }
1.67 + string grouping() const { return do_grouping(); }
1.68 + string truename() const { return do_truename(); }
1.69 + string falsename() const { return do_falsename(); }
1.70 +
1.71 + static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
1.72 +
1.73 +#ifndef _STLP_NO_FRIEND_TEMPLATES
1.74 +protected:
1.75 +#endif
1.76 + ~numpunct();
1.77 +
1.78 + string _M_truename;
1.79 + string _M_falsename;
1.80 + string _M_grouping;
1.81 +
1.82 + virtual char do_decimal_point() const;
1.83 + virtual char do_thousands_sep() const;
1.84 + virtual string do_grouping() const;
1.85 + virtual string do_truename() const;
1.86 + virtual string do_falsename() const;
1.87 +};
1.88 +
1.89 +# if ! defined (_STLP_NO_WCHAR_T)
1.90 +
1.91 +_STLP_TEMPLATE_NULL
1.92 +class _STLP_CLASS_DECLSPEC numpunct<wchar_t> : public locale::facet
1.93 +{
1.94 + friend class _Locale_impl;
1.95 +public:
1.96 + typedef wchar_t char_type;
1.97 + typedef wstring string_type;
1.98 +
1.99 + explicit numpunct(size_t __refs = 0)
1.100 + : locale::facet(__refs), _M_truename(L"true"), _M_falsename(L"false") {}
1.101 +
1.102 + wchar_t decimal_point() const { return do_decimal_point(); }
1.103 + wchar_t thousands_sep() const { return do_thousands_sep(); }
1.104 + string grouping() const { return do_grouping(); }
1.105 + wstring truename() const { return do_truename(); }
1.106 + wstring falsename() const { return do_falsename(); }
1.107 +
1.108 + static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
1.109 +
1.110 +protected:
1.111 + wstring _M_truename;
1.112 + wstring _M_falsename;
1.113 + string _M_grouping;
1.114 +
1.115 + ~numpunct();
1.116 +
1.117 + virtual wchar_t do_decimal_point() const;
1.118 + virtual wchar_t do_thousands_sep() const;
1.119 + virtual string do_grouping() const;
1.120 + virtual wstring do_truename() const;
1.121 + virtual wstring do_falsename() const;
1.122 +};
1.123 +
1.124 +# endif /* WCHAR_T */
1.125 +
1.126 +_STLP_TEMPLATE_NULL
1.127 +class _STLP_CLASS_DECLSPEC numpunct_byname<char> : public numpunct<char> {
1.128 +public:
1.129 + typedef char char_type;
1.130 + typedef string string_type;
1.131 +
1.132 + explicit numpunct_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
1.133 +
1.134 +protected:
1.135 +
1.136 + ~numpunct_byname();
1.137 +
1.138 + virtual char do_decimal_point() const;
1.139 + virtual char do_thousands_sep() const;
1.140 + virtual string do_grouping() const;
1.141 +
1.142 +private:
1.143 + _Locale_numeric* _M_numeric;
1.144 +
1.145 + //explicitely defined as private to avoid warnings:
1.146 + typedef numpunct_byname<char> _Self;
1.147 + numpunct_byname(_Self const&);
1.148 + _Self& operator = (_Self const&);
1.149 + friend _Locale_name_hint* _Locale_extract_hint(numpunct_byname<char>*);
1.150 +};
1.151 +
1.152 +# ifndef _STLP_NO_WCHAR_T
1.153 +_STLP_TEMPLATE_NULL
1.154 +class _STLP_CLASS_DECLSPEC numpunct_byname<wchar_t>: public numpunct<wchar_t> {
1.155 +public:
1.156 + typedef wchar_t char_type;
1.157 + typedef wstring string_type;
1.158 +
1.159 + explicit numpunct_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
1.160 +
1.161 +protected:
1.162 +
1.163 + ~numpunct_byname();
1.164 +
1.165 + virtual wchar_t do_decimal_point() const;
1.166 + virtual wchar_t do_thousands_sep() const;
1.167 + virtual string do_grouping() const;
1.168 +
1.169 +private:
1.170 + _Locale_numeric* _M_numeric;
1.171 +
1.172 + //explicitely defined as private to avoid warnings:
1.173 + typedef numpunct_byname<wchar_t> _Self;
1.174 + numpunct_byname(_Self const&);
1.175 + _Self& operator = (_Self const&);
1.176 +};
1.177 +
1.178 +# endif /* WCHAR_T */
1.179 +
1.180 +_STLP_END_NAMESPACE
1.181 +
1.182 +#endif /* _STLP_NUMPUNCT_H */
1.183 +
1.184 +// Local Variables:
1.185 +// mode:C++
1.186 +// End:
1.187 +