1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/tools/stlport/stl/_num_put.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,193 @@
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_PUT_H
1.27 +#define _STLP_INTERNAL_NUM_PUT_H
1.28 +
1.29 +#ifndef _STLP_INTERNAL_NUMPUNCT_H
1.30 +# include <stl/_numpunct.h>
1.31 +#endif
1.32 +
1.33 +#ifndef _STLP_INTERNAL_CTYPE_H
1.34 +# include <stl/_ctype.h>
1.35 +#endif
1.36 +
1.37 +#ifndef _STLP_INTERNAL_OSTREAMBUF_ITERATOR_H
1.38 +# include <stl/_ostreambuf_iterator.h>
1.39 +#endif
1.40 +
1.41 +#ifndef _STLP_INTERNAL_IOSTREAM_STRING_H
1.42 +# include <stl/_iostream_string.h>
1.43 +#endif
1.44 +
1.45 +_STLP_BEGIN_NAMESPACE
1.46 +
1.47 +//----------------------------------------------------------------------
1.48 +// num_put facet
1.49 +
1.50 +#if defined (_STLP_LIMITED_DEFAULT_TEMPLATES)
1.51 +template <class _CharT, class _OutputIter>
1.52 +#else
1.53 +template <class _CharT, class _OutputIter = ostreambuf_iterator<_CharT, char_traits<_CharT> > >
1.54 +#endif
1.55 +class num_put: public locale::facet {
1.56 + friend class _Locale_impl;
1.57 +public:
1.58 + typedef _CharT char_type;
1.59 + typedef _OutputIter iter_type;
1.60 +
1.61 + explicit num_put(size_t __refs = 0) : locale::facet(__refs) {}
1.62 +
1.63 +#if !defined (_STLP_NO_BOOL)
1.64 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.65 + bool __val) const {
1.66 + return do_put(__s, __f, __fill, __val);
1.67 + }
1.68 +#endif
1.69 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.70 + long __val) const {
1.71 + return do_put(__s, __f, __fill, __val);
1.72 + }
1.73 +
1.74 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.75 + unsigned long __val) const {
1.76 + return do_put(__s, __f, __fill, __val);
1.77 + }
1.78 +
1.79 +#if defined (_STLP_LONG_LONG)
1.80 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.81 + _STLP_LONG_LONG __val) const {
1.82 + return do_put(__s, __f, __fill, __val);
1.83 + }
1.84 +
1.85 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.86 + unsigned _STLP_LONG_LONG __val) const {
1.87 + return do_put(__s, __f, __fill, __val);
1.88 + }
1.89 +#endif
1.90 +
1.91 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.92 + double __val) const {
1.93 + return do_put(__s, __f, __fill, (double)__val);
1.94 + }
1.95 +
1.96 +#if !defined (_STLP_NO_LONG_DOUBLE)
1.97 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.98 + long double __val) const {
1.99 + return do_put(__s, __f, __fill, __val);
1.100 + }
1.101 +#endif
1.102 +
1.103 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.104 + const void * __val) const {
1.105 + return do_put(__s, __f, __fill, __val);
1.106 + }
1.107 +
1.108 + static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
1.109 +
1.110 +protected:
1.111 + ~num_put() {}
1.112 +#if !defined (_STLP_NO_BOOL)
1.113 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, bool __val) const;
1.114 +#endif
1.115 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long __val) const;
1.116 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, unsigned long __val) const;
1.117 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, double __val) const;
1.118 +#if !defined (_STLP_NO_LONG_DOUBLE)
1.119 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long double __val) const;
1.120 +#endif
1.121 +
1.122 +#if defined (_STLP_LONG_LONG)
1.123 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, _STLP_LONG_LONG __val) const;
1.124 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill,
1.125 + unsigned _STLP_LONG_LONG __val) const ;
1.126 +#endif
1.127 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, const void* __val) const;
1.128 +};
1.129 +
1.130 +#if defined (_STLP_USE_TEMPLATE_EXPORT)
1.131 +_STLP_EXPORT_TEMPLATE_CLASS num_put<char, ostreambuf_iterator<char, char_traits<char> > >;
1.132 +// _STLP_EXPORT_TEMPLATE_CLASS num_put<char, char*>;
1.133 +# if !defined (_STLP_NO_WCHAR_T)
1.134 +_STLP_EXPORT_TEMPLATE_CLASS num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
1.135 +// _STLP_EXPORT_TEMPLATE_CLASS num_put<wchar_t, wchar_t*>;
1.136 +# endif
1.137 +#endif
1.138 +
1.139 +#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
1.140 +
1.141 +_STLP_MOVE_TO_PRIV_NAMESPACE
1.142 +
1.143 +template <class _Integer>
1.144 +char* _STLP_CALL
1.145 +__write_integer_backward(char* __buf, ios_base::fmtflags __flags, _Integer __x);
1.146 +
1.147 +void _STLP_CALL __string_to_float(const string&, float&);
1.148 +void _STLP_CALL __string_to_float(const string&, double&);
1.149 +/*
1.150 + * Returns the position on the right of the digits that has to be considered
1.151 + * for the application of the grouping policy.
1.152 + */
1.153 +extern size_t _STLP_CALL __write_float(__iostring&, ios_base::fmtflags, int, double);
1.154 +# if !defined (_STLP_NO_LONG_DOUBLE)
1.155 +void _STLP_CALL __string_to_float(const string&, long double&);
1.156 +extern size_t _STLP_CALL __write_float(__iostring&, ios_base::fmtflags, int, long double);
1.157 +# endif
1.158 +
1.159 +/*
1.160 + * Gets the digits of the integer part.
1.161 + */
1.162 +void _STLP_CALL __get_floor_digits(__iostring&, _STLP_LONGEST_FLOAT_TYPE);
1.163 +
1.164 +template <class _CharT>
1.165 +void _STLP_CALL __get_money_digits(_STLP_BASIC_IOSTRING(_CharT)&, ios_base&, _STLP_LONGEST_FLOAT_TYPE);
1.166 +
1.167 +# if !defined (_STLP_NO_WCHAR_T)
1.168 +extern void _STLP_CALL __convert_float_buffer(__iostring const&, __iowstring&, const ctype<wchar_t>&, wchar_t, bool = true);
1.169 +# endif
1.170 +extern void _STLP_CALL __adjust_float_buffer(__iostring&, char);
1.171 +
1.172 +extern char* _STLP_CALL
1.173 +__write_integer(char* buf, ios_base::fmtflags flags, long x);
1.174 +
1.175 +extern ptrdiff_t _STLP_CALL __insert_grouping(char* first, char* last, const string&, char, char, char, int);
1.176 +extern void _STLP_CALL __insert_grouping(__iostring&, size_t, const string&, char, char, char, int);
1.177 +# if !defined (_STLP_NO_WCHAR_T)
1.178 +extern ptrdiff_t _STLP_CALL __insert_grouping(wchar_t*, wchar_t*, const string&, wchar_t, wchar_t, wchar_t, int);
1.179 +extern void _STLP_CALL __insert_grouping(__iowstring&, size_t, const string&, wchar_t, wchar_t, wchar_t, int);
1.180 +# endif
1.181 +
1.182 +_STLP_MOVE_TO_STD_NAMESPACE
1.183 +
1.184 +#endif /* _STLP_EXPOSE_STREAM_IMPLEMENTATION */
1.185 +
1.186 +_STLP_END_NAMESPACE
1.187 +
1.188 +#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
1.189 +# include <stl/_num_put.c>
1.190 +#endif
1.191 +
1.192 +#endif /* _STLP_INTERNAL_NUMERIC_FACETS_H */
1.193 +
1.194 +// Local Variables:
1.195 +// mode:C++
1.196 +// End: