1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_num_put.h Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,202 @@
1.4 +/*
1.5 + * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.6 + *
1.7 + * Copyright (c) 1999
1.8 + * Silicon Graphics Computer Systems, Inc.
1.9 + *
1.10 + * Copyright (c) 1999
1.11 + * Boris Fomitchev
1.12 + *
1.13 + * This material is provided "as is", with absolutely no warranty expressed
1.14 + * or implied. Any use is at your own risk.
1.15 + *
1.16 + * Permission to use or copy this software for any purpose is hereby granted
1.17 + * without fee, provided the above notices are retained on all copies.
1.18 + * Permission to modify the code and to distribute modified code is granted,
1.19 + * provided the above notices are retained, and a notice that the code was
1.20 + * modified is included with the above copyright notice.
1.21 + *
1.22 + */
1.23 +// WARNING: This is an internal header file, included by other C++
1.24 +// standard library headers. You should not attempt to use this header
1.25 +// file directly.
1.26 +
1.27 +
1.28 +#ifndef _STLP_INTERNAL_NUM_PUT_H
1.29 +#define _STLP_INTERNAL_NUM_PUT_H
1.30 +
1.31 +#ifndef _STLP_INTERNAL_NUMPUNCT_H
1.32 +# include <stl/_numpunct.h>
1.33 +#endif
1.34 +#ifndef _STLP_INTERNAL_CTYPE_H
1.35 +# include <stl/_ctype.h>
1.36 +#endif
1.37 +#ifndef _STLP_INTERNAL_OSTREAMBUF_ITERATOR_H
1.38 +# include <stl/_ostreambuf_iterator.h>
1.39 +#endif
1.40 +
1.41 +_STLP_BEGIN_NAMESPACE
1.42 +
1.43 +//----------------------------------------------------------------------
1.44 +// num_put facet
1.45 +
1.46 +# ifdef _STLP_LIMITED_DEFAULT_TEMPLATES
1.47 +template <class _CharT, class _OutputIter>
1.48 +# else
1.49 +template <class _CharT, class _OutputIter = ostreambuf_iterator<_CharT, char_traits<_CharT> > >
1.50 +# endif
1.51 +class num_put: public locale::facet
1.52 +{
1.53 + friend class _Locale;
1.54 +public:
1.55 + typedef _CharT char_type;
1.56 + typedef _OutputIter iter_type;
1.57 +
1.58 + explicit num_put(size_t __refs = 0) : _BaseFacet(__refs) {}
1.59 +
1.60 +# ifndef _STLP_NO_BOOL
1.61 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.62 + bool __val) const {
1.63 + return do_put(__s, __f, __fill, __val);
1.64 + }
1.65 +# endif
1.66 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.67 + long __val) const {
1.68 + return do_put(__s, __f, __fill, __val);
1.69 + }
1.70 +
1.71 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.72 + unsigned long __val) const {
1.73 + return do_put(__s, __f, __fill, __val);
1.74 + }
1.75 +
1.76 +#ifdef _STLP_LONG_LONG
1.77 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.78 + _STLP_LONG_LONG __val) const {
1.79 + return do_put(__s, __f, __fill, __val);
1.80 + }
1.81 +
1.82 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.83 + unsigned _STLP_LONG_LONG __val) const {
1.84 + return do_put(__s, __f, __fill, __val);
1.85 + }
1.86 +#endif
1.87 +
1.88 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.89 + double __val) const {
1.90 + return do_put(__s, __f, __fill, (double)__val);
1.91 + }
1.92 +
1.93 +#ifndef _STLP_NO_LONG_DOUBLE
1.94 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.95 + long double __val) const {
1.96 + return do_put(__s, __f, __fill, __val);
1.97 + }
1.98 +# endif
1.99 +
1.100 + iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.101 + const void * __val) const {
1.102 + return do_put(__s, __f, __fill, __val);
1.103 + }
1.104 +
1.105 +#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.106 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
1.107 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
1.108 + GetFacetLocaleId(ostreambuf_iterator<char, char_traits<char> > *);
1.109 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId(char**);
1.110 + //wchar_t
1.111 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
1.112 + GetFacetLocaleId(ostreambuf_iterator<wchar_t, char_traits<wchar_t> > *);
1.113 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId(wchar_t**);
1.114 + //adding for new iterator type
1.115 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
1.116 + GetFacetLocaleId(back_insert_iterator<string> *);
1.117 +#else
1.118 + _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
1.119 +#endif
1.120 +
1.121 +protected:
1.122 + ~num_put() {}
1.123 +# ifndef _STLP_NO_BOOL
1.124 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, bool __val) const;
1.125 +# endif
1.126 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long __val) const;
1.127 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, unsigned long __val) const;
1.128 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, double __val) const;
1.129 +#ifndef _STLP_NO_LONG_DOUBLE
1.130 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long double __val) const;
1.131 +#endif
1.132 +
1.133 +#ifdef _STLP_LONG_LONG
1.134 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, _STLP_LONG_LONG __val) const;
1.135 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill,
1.136 + unsigned _STLP_LONG_LONG __val) const ;
1.137 +#endif /* _STLP_LONG_LONG */
1.138 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, const void* __val) const;
1.139 +};
1.140 +
1.141 +# ifdef _STLP_USE_TEMPLATE_EXPORT
1.142 +_STLP_EXPORT_TEMPLATE_CLASS num_put<char, ostreambuf_iterator<char, char_traits<char> > >;
1.143 +// _STLP_EXPORT_TEMPLATE_CLASS num_put<char, char*>;
1.144 +# ifndef _STLP_NO_WCHAR_T
1.145 +_STLP_EXPORT_TEMPLATE_CLASS num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
1.146 +// _STLP_EXPORT_TEMPLATE_CLASS num_put<wchar_t, wchar_t*>;
1.147 +# endif /* _STLP_NO_WCHAR_T */
1.148 +# endif
1.149 +
1.150 +# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
1.151 +
1.152 +template <class _Integer>
1.153 +char* _STLP_CALL
1.154 +__write_integer_backward(char* __buf, ios_base::fmtflags __flags, _Integer __x);
1.155 +
1.156 +extern _STLP_DECLSPEC int _STLP_CALL __string_to_float(const string&, float&);
1.157 +extern _STLP_DECLSPEC int _STLP_CALL __string_to_float(const string&, double&);
1.158 +extern _STLP_DECLSPEC void _STLP_CALL __write_float(string&, ios_base::fmtflags, int, double);
1.159 +# ifndef _STLP_NO_LONG_DOUBLE
1.160 +int _STLP_CALL __string_to_float(const string&, long double&);
1.161 +extern _STLP_DECLSPEC void _STLP_CALL __write_float(string&, ios_base::fmtflags, int, long double);
1.162 +# endif
1.163 +
1.164 +#ifndef _STLP_NO_WCHAR_T
1.165 +extern _STLP_DECLSPEC wchar_t* _STLP_CALL __convert_float_buffer(const char*, const char*, wchar_t*, const ctype<wchar_t>&, wchar_t);
1.166 +#endif
1.167 +extern _STLP_DECLSPEC void _STLP_CALL __adjust_float_buffer(char*, char*, char);
1.168 +
1.169 +extern _STLP_DECLSPEC char* _STLP_CALL
1.170 +__write_integer(char* buf, ios_base::fmtflags flags, long x);
1.171 +
1.172 +extern _STLP_DECLSPEC ptrdiff_t _STLP_CALL __insert_grouping(char* first, char* last, const string&, char, char, char, int);
1.173 +# ifndef _STLP_NO_WCHAR_T
1.174 +extern _STLP_DECLSPEC ptrdiff_t _STLP_CALL __insert_grouping(wchar_t*, wchar_t*, const string&, wchar_t, wchar_t, wchar_t, int);
1.175 +# endif
1.176 +
1.177 +# endif
1.178 +
1.179 +# if defined (__BORLANDC__) && defined (_RTLDLL)
1.180 +inline void _Stl_loc_init_num_put() {
1.181 +
1.182 + num_put<char, ostreambuf_iterator<char, char_traits<char> > >::id._M_index = 14;
1.183 + num_put<char, char*>::id._M_index = 15;
1.184 +
1.185 +# ifndef _STLP_NO_WCHAR_T
1.186 + num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > > ::id._M_index = 33;
1.187 + num_put<wchar_t, wchar_t*>::id._M_index = 34;
1.188 +# endif
1.189 +
1.190 +}
1.191 +
1.192 +# endif
1.193 +
1.194 +_STLP_END_NAMESPACE
1.195 +
1.196 +# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && ! defined (_STLP_LINK_TIME_INSTANTIATION)
1.197 +# include <stl/_num_put.c>
1.198 +# endif
1.199 +
1.200 +#endif /* _STLP_INTERNAL_NUMERIC_FACETS_H */
1.201 +
1.202 +// Local Variables:
1.203 +// mode:C++
1.204 +// End:
1.205 +