1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/tools/stlport/stl/_num_get.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,237 @@
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_NUM_GET_H
1.27 +#define _STLP_INTERNAL_NUM_GET_H
1.28 +
1.29 +#ifndef _STLP_INTERNAL_ISTREAMBUF_ITERATOR_H
1.30 +# include <stl/_istreambuf_iterator.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_NUMPUNCT_H
1.38 +# include <stl/_numpunct.h>
1.39 +#endif
1.40 +
1.41 +#ifndef _STLP_INTERNAL_CTYPE_H
1.42 +# include <stl/_ctype.h>
1.43 +#endif
1.44 +
1.45 +#ifndef _STLP_INTERNAL_IOSTREAM_STRING_H
1.46 +# include <stl/_iostream_string.h>
1.47 +#endif
1.48 +
1.49 +_STLP_BEGIN_NAMESPACE
1.50 +
1.51 +//----------------------------------------------------------------------
1.52 +// num_get facets
1.53 +
1.54 +#if defined (_STLP_LIMITED_DEFAULT_TEMPLATES)
1.55 +template <class _CharT, class _InputIter>
1.56 +#else
1.57 +template <class _CharT, class _InputIter = istreambuf_iterator<_CharT, char_traits<_CharT> > >
1.58 +#endif
1.59 +class num_get: public locale::facet {
1.60 + friend class _Locale_impl;
1.61 +public:
1.62 + typedef _CharT char_type;
1.63 + typedef _InputIter iter_type;
1.64 +
1.65 + explicit num_get(size_t __refs = 0): locale::facet(__refs) {}
1.66 +
1.67 +#if !defined (_STLP_NO_BOOL)
1.68 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.69 + ios_base::iostate& __err, bool& __val) const
1.70 + { return do_get(__ii, __end, __str, __err, __val); }
1.71 +#endif
1.72 +
1.73 +#if defined (_STLP_FIX_LIBRARY_ISSUES)
1.74 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.75 + ios_base::iostate& __err, short& __val) const
1.76 + { return do_get(__ii, __end, __str, __err, __val); }
1.77 +
1.78 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.79 + ios_base::iostate& __err, int& __val) const
1.80 + { return do_get(__ii, __end, __str, __err, __val); }
1.81 +#endif
1.82 +
1.83 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.84 + ios_base::iostate& __err, long& __val) const
1.85 + { return do_get(__ii, __end, __str, __err, __val); }
1.86 +
1.87 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.88 + ios_base::iostate& __err, unsigned short& __val) const
1.89 + { return do_get(__ii, __end, __str, __err, __val); }
1.90 +
1.91 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.92 + ios_base::iostate& __err, unsigned int& __val) const
1.93 + { return do_get(__ii, __end, __str, __err, __val); }
1.94 +
1.95 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.96 + ios_base::iostate& __err, unsigned long& __val) const
1.97 + { return do_get(__ii, __end, __str, __err, __val); }
1.98 +
1.99 +#if defined (_STLP_LONG_LONG)
1.100 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.101 + ios_base::iostate& __err, _STLP_LONG_LONG& __val) const
1.102 + { return do_get(__ii, __end, __str, __err, __val); }
1.103 +
1.104 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.105 + ios_base::iostate& __err, unsigned _STLP_LONG_LONG& __val) const
1.106 + { return do_get(__ii, __end, __str, __err, __val); }
1.107 +#endif /* _STLP_LONG_LONG */
1.108 +
1.109 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.110 + ios_base::iostate& __err, float& __val) const
1.111 + { return do_get(__ii, __end, __str, __err, __val); }
1.112 +
1.113 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.114 + ios_base::iostate& __err, double& __val) const
1.115 + { return do_get(__ii, __end, __str, __err, __val); }
1.116 +
1.117 +#if !defined (_STLP_NO_LONG_DOUBLE)
1.118 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.119 + ios_base::iostate& __err, long double& __val) const
1.120 + { return do_get(__ii, __end, __str, __err, __val); }
1.121 +# endif
1.122 +
1.123 + _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.124 + ios_base::iostate& __err, void*& __val) const
1.125 + { return do_get(__ii, __end, __str, __err, __val); }
1.126 +
1.127 + static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
1.128 +
1.129 +protected:
1.130 + ~num_get() {}
1.131 +
1.132 + typedef string string_type;
1.133 + typedef ctype<_CharT> _Ctype;
1.134 + typedef numpunct<_CharT> _Numpunct;
1.135 +
1.136 +#if !defined (_STLP_NO_BOOL)
1.137 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.138 + ios_base::iostate& __err, bool& __val) const;
1.139 +#endif
1.140 +
1.141 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.142 + ios_base::iostate& __err, long& __val) const;
1.143 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.144 + ios_base::iostate& __err, unsigned short& __val) const;
1.145 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.146 + ios_base::iostate& __err, unsigned int& __val) const;
1.147 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.148 + ios_base::iostate& __err, unsigned long& __val) const;
1.149 +
1.150 +#if defined (_STLP_FIX_LIBRARY_ISSUES)
1.151 + // issue 118 : those are actually not supposed to be here
1.152 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.153 + ios_base::iostate& __err, short& __val) const;
1.154 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.155 + ios_base::iostate& __err, int& __val) const;
1.156 +#endif
1.157 +
1.158 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.159 + ios_base::iostate& __err, float& __val) const;
1.160 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.161 + ios_base::iostate& __err, double& __val) const;
1.162 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.163 + ios_base::iostate& __err, void*& __p) const;
1.164 +
1.165 +#if !defined (_STLP_NO_LONG_DOUBLE)
1.166 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.167 + ios_base::iostate& __err, long double& __val) const;
1.168 +#endif
1.169 +
1.170 +#if defined (_STLP_LONG_LONG)
1.171 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.172 + ios_base::iostate& __err, _STLP_LONG_LONG& __val) const;
1.173 + virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
1.174 + ios_base::iostate& __err, unsigned _STLP_LONG_LONG& __val) const;
1.175 +#endif
1.176 +
1.177 +};
1.178 +
1.179 +
1.180 +#if defined (_STLP_USE_TEMPLATE_EXPORT)
1.181 +_STLP_EXPORT_TEMPLATE_CLASS num_get<char, istreambuf_iterator<char, char_traits<char> > >;
1.182 +// _STLP_EXPORT_TEMPLATE_CLASS num_get<char, const char*>;
1.183 +# if !defined (_STLP_NO_WCHAR_T)
1.184 +_STLP_EXPORT_TEMPLATE_CLASS num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
1.185 +// _STLP_EXPORT_TEMPLATE_CLASS num_get<wchar_t, const wchar_t*>;
1.186 +# endif
1.187 +#endif
1.188 +
1.189 +#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
1.190 +
1.191 +_STLP_MOVE_TO_PRIV_NAMESPACE
1.192 +
1.193 +extern bool _STLP_CALL __valid_grouping(const char*, const char*, const char*, const char*);
1.194 +
1.195 +template <class _InputIter, class _Integer, class _CharT>
1.196 +bool _STLP_CALL
1.197 +__get_decimal_integer(_InputIter& __first, _InputIter& __last, _Integer& __val, _CharT*);
1.198 +
1.199 +# if !defined (_STLP_NO_WCHAR_T)
1.200 +bool _STLP_CALL __get_fdigit(wchar_t&, const wchar_t*);
1.201 +bool _STLP_CALL __get_fdigit_or_sep(wchar_t&, wchar_t, const wchar_t*);
1.202 +# endif
1.203 +
1.204 +inline void _STLP_CALL
1.205 +_Initialize_get_float(const ctype<char>&,
1.206 + char& Plus, char& Minus,
1.207 + char& pow_e, char& pow_E,
1.208 + char*) {
1.209 + Plus = '+';
1.210 + Minus = '-';
1.211 + pow_e = 'e';
1.212 + pow_E = 'E';
1.213 +}
1.214 +
1.215 +# if !defined (_STLP_NO_WCHAR_T)
1.216 +void _STLP_CALL _Initialize_get_float(const ctype<wchar_t>&,
1.217 + wchar_t&, wchar_t&, wchar_t&, wchar_t&, wchar_t*);
1.218 +# endif
1.219 +void _STLP_CALL __string_to_float(const __iostring&, float&);
1.220 +void _STLP_CALL __string_to_float(const __iostring&, double&);
1.221 +# if !defined (_STLP_NO_LONG_DOUBLE)
1.222 +void _STLP_CALL __string_to_float(const __iostring&, long double&);
1.223 +# endif
1.224 +
1.225 +_STLP_MOVE_TO_STD_NAMESPACE
1.226 +
1.227 +#endif /* _STLP_EXPOSE_STREAM_IMPLEMENTATION */
1.228 +
1.229 +_STLP_END_NAMESPACE
1.230 +
1.231 +#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
1.232 +# include <stl/_num_get.c>
1.233 +#endif
1.234 +
1.235 +#endif /* _STLP_INTERNAL_NUM_GET_H */
1.236 +
1.237 +// Local Variables:
1.238 +// mode:C++
1.239 +// End:
1.240 +