1.1 --- a/epoc32/include/stdapis/stlportv5/stl/_num_put.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_num_put.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,22 +1,22 @@
1.4 /*
1.5 - * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.6 + * Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 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 + * Copyright (c) 1999
1.13 * Boris Fomitchev
1.14 *
1.15 * This material is provided "as is", with absolutely no warranty expressed
1.16 * or implied. Any use is at your own risk.
1.17 *
1.18 - * Permission to use or copy this software for any purpose is hereby granted
1.19 + * Permission to use or copy this software for any purpose is hereby granted
1.20 * without fee, provided the above notices are retained on all copies.
1.21 * Permission to modify the code and to distribute modified code is granted,
1.22 * provided the above notices are retained, and a notice that the code was
1.23 * modified is included with the above copyright notice.
1.24 *
1.25 - */
1.26 + */
1.27 // WARNING: This is an internal header file, included by other C++
1.28 // standard library headers. You should not attempt to use this header
1.29 // file directly.
1.30 @@ -28,38 +28,43 @@
1.31 #ifndef _STLP_INTERNAL_NUMPUNCT_H
1.32 # include <stl/_numpunct.h>
1.33 #endif
1.34 +
1.35 #ifndef _STLP_INTERNAL_CTYPE_H
1.36 # include <stl/_ctype.h>
1.37 #endif
1.38 +
1.39 #ifndef _STLP_INTERNAL_OSTREAMBUF_ITERATOR_H
1.40 # include <stl/_ostreambuf_iterator.h>
1.41 #endif
1.42
1.43 +#ifndef _STLP_INTERNAL_IOSTREAM_STRING_H
1.44 +# include <stl/_iostream_string.h>
1.45 +#endif
1.46 +
1.47 _STLP_BEGIN_NAMESPACE
1.48
1.49 //----------------------------------------------------------------------
1.50 // num_put facet
1.51
1.52 -# ifdef _STLP_LIMITED_DEFAULT_TEMPLATES
1.53 -template <class _CharT, class _OutputIter>
1.54 -# else
1.55 -template <class _CharT, class _OutputIter = ostreambuf_iterator<_CharT, char_traits<_CharT> > >
1.56 -# endif
1.57 -class num_put: public locale::facet
1.58 -{
1.59 - friend class _Locale;
1.60 +#if defined (_STLP_LIMITED_DEFAULT_TEMPLATES)
1.61 +template <class _CharT, class _OutputIter>
1.62 +#else
1.63 +template <class _CharT, class _OutputIter = ostreambuf_iterator<_CharT, char_traits<_CharT> > >
1.64 +#endif
1.65 +class num_put: public locale::facet {
1.66 + friend class _Locale_impl;
1.67 public:
1.68 typedef _CharT char_type;
1.69 typedef _OutputIter iter_type;
1.70
1.71 - explicit num_put(size_t __refs = 0) : _BaseFacet(__refs) {}
1.72 + explicit num_put(size_t __refs = 0) : locale::facet(__refs) {}
1.73
1.74 -# ifndef _STLP_NO_BOOL
1.75 +#if !defined (_STLP_NO_BOOL)
1.76 iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.77 bool __val) const {
1.78 return do_put(__s, __f, __fill, __val);
1.79 }
1.80 -# endif
1.81 +#endif
1.82 iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.83 long __val) const {
1.84 return do_put(__s, __f, __fill, __val);
1.85 @@ -70,7 +75,7 @@
1.86 return do_put(__s, __f, __fill, __val);
1.87 }
1.88
1.89 -#ifdef _STLP_LONG_LONG
1.90 +#if defined (_STLP_LONG_LONG)
1.91 iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.92 _STLP_LONG_LONG __val) const {
1.93 return do_put(__s, __f, __fill, __val);
1.94 @@ -87,116 +92,110 @@
1.95 return do_put(__s, __f, __fill, (double)__val);
1.96 }
1.97
1.98 -#ifndef _STLP_NO_LONG_DOUBLE
1.99 +#if !defined (_STLP_NO_LONG_DOUBLE)
1.100 iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.101 long double __val) const {
1.102 return do_put(__s, __f, __fill, __val);
1.103 }
1.104 -# endif
1.105 +#endif
1.106
1.107 iter_type put(iter_type __s, ios_base& __f, char_type __fill,
1.108 const void * __val) const {
1.109 return do_put(__s, __f, __fill, __val);
1.110 }
1.111
1.112 -#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.113 - _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
1.114 - _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
1.115 - GetFacetLocaleId(ostreambuf_iterator<char, char_traits<char> > *);
1.116 - _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId(char**);
1.117 - //wchar_t
1.118 - _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
1.119 - GetFacetLocaleId(ostreambuf_iterator<wchar_t, char_traits<wchar_t> > *);
1.120 - _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId(wchar_t**);
1.121 - //adding for new iterator type
1.122 - _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
1.123 - GetFacetLocaleId(back_insert_iterator<string> *);
1.124 +#if defined(__SYMBIAN32__WSD__)
1.125 + static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
1.126 +#elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)
1.127 + static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
1.128 + static locale::id id;
1.129 #else
1.130 - _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
1.131 + // NOTE: Symbian doesn't support exporting static data.
1.132 + // Users of this class should use GetFacetLocaleId() to access the data member id
1.133 + static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
1.134 #endif
1.135
1.136 protected:
1.137 - ~num_put() {}
1.138 -# ifndef _STLP_NO_BOOL
1.139 + ~num_put() {}
1.140 +#if !defined (_STLP_NO_BOOL)
1.141 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, bool __val) const;
1.142 -# endif
1.143 +#endif
1.144 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long __val) const;
1.145 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, unsigned long __val) const;
1.146 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, double __val) const;
1.147 -#ifndef _STLP_NO_LONG_DOUBLE
1.148 +#if !defined (_STLP_NO_LONG_DOUBLE)
1.149 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long double __val) const;
1.150 #endif
1.151
1.152 -#ifdef _STLP_LONG_LONG
1.153 +#if defined (_STLP_LONG_LONG)
1.154 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, _STLP_LONG_LONG __val) const;
1.155 - virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill,
1.156 + virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill,
1.157 unsigned _STLP_LONG_LONG __val) const ;
1.158 -#endif /* _STLP_LONG_LONG */
1.159 +#endif
1.160 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, const void* __val) const;
1.161 };
1.162
1.163 -# ifdef _STLP_USE_TEMPLATE_EXPORT
1.164 +#if defined (_STLP_USE_TEMPLATE_EXPORT)
1.165 _STLP_EXPORT_TEMPLATE_CLASS num_put<char, ostreambuf_iterator<char, char_traits<char> > >;
1.166 // _STLP_EXPORT_TEMPLATE_CLASS num_put<char, char*>;
1.167 -# ifndef _STLP_NO_WCHAR_T
1.168 +# if !defined (_STLP_NO_WCHAR_T)
1.169 _STLP_EXPORT_TEMPLATE_CLASS num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
1.170 // _STLP_EXPORT_TEMPLATE_CLASS num_put<wchar_t, wchar_t*>;
1.171 -# endif /* _STLP_NO_WCHAR_T */
1.172 -# endif
1.173 +# endif
1.174 +#endif
1.175
1.176 -# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
1.177 +#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
1.178 +
1.179 +_STLP_MOVE_TO_PRIV_NAMESPACE
1.180
1.181 template <class _Integer>
1.182 char* _STLP_CALL
1.183 __write_integer_backward(char* __buf, ios_base::fmtflags __flags, _Integer __x);
1.184
1.185 -extern _STLP_DECLSPEC int _STLP_CALL __string_to_float(const string&, float&);
1.186 -extern _STLP_DECLSPEC int _STLP_CALL __string_to_float(const string&, double&);
1.187 -extern _STLP_DECLSPEC void _STLP_CALL __write_float(string&, ios_base::fmtflags, int, double);
1.188 -# ifndef _STLP_NO_LONG_DOUBLE
1.189 -int _STLP_CALL __string_to_float(const string&, long double&);
1.190 -extern _STLP_DECLSPEC void _STLP_CALL __write_float(string&, ios_base::fmtflags, int, long double);
1.191 -# endif
1.192 +/*
1.193 + * Returns the position on the right of the digits that has to be considered
1.194 + * for the application of the grouping policy.
1.195 + */
1.196 +_STLP_DECLSPEC size_t _STLP_CALL __write_float(__iostring&, ios_base::fmtflags, int, double); //RVCT 3.1 export issue: _STLP_DECLSPEC added.
1.197 +# if !defined (_STLP_NO_LONG_DOUBLE)
1.198 +_STLP_DECLSPEC size_t _STLP_CALL __write_float(__iostring&, ios_base::fmtflags, int, long double);
1.199 +# endif
1.200
1.201 -#ifndef _STLP_NO_WCHAR_T
1.202 -extern _STLP_DECLSPEC wchar_t* _STLP_CALL __convert_float_buffer(const char*, const char*, wchar_t*, const ctype<wchar_t>&, wchar_t);
1.203 -#endif
1.204 -extern _STLP_DECLSPEC void _STLP_CALL __adjust_float_buffer(char*, char*, char);
1.205 +/*
1.206 + * Gets the digits of the integer part.
1.207 + */
1.208 +_STLP_DECLSPEC void _STLP_CALL __get_floor_digits(__iostring&, _STLP_LONGEST_FLOAT_TYPE);
1.209
1.210 -extern _STLP_DECLSPEC char* _STLP_CALL
1.211 +template <class _CharT>
1.212 +void _STLP_CALL __get_money_digits(_STLP_BASIC_IOSTRING(_CharT)&, ios_base&, _STLP_LONGEST_FLOAT_TYPE);
1.213 +
1.214 +# if !defined (_STLP_NO_WCHAR_T)
1.215 +_STLP_DECLSPEC void _STLP_CALL __convert_float_buffer(__iostring const&, __iowstring&, const ctype<wchar_t>&, wchar_t, bool = true);
1.216 +# endif
1.217 +extern void _STLP_CALL __adjust_float_buffer(__iostring&, char);
1.218 +
1.219 +extern char* _STLP_CALL
1.220 __write_integer(char* buf, ios_base::fmtflags flags, long x);
1.221
1.222 -extern _STLP_DECLSPEC ptrdiff_t _STLP_CALL __insert_grouping(char* first, char* last, const string&, char, char, char, int);
1.223 -# ifndef _STLP_NO_WCHAR_T
1.224 -extern _STLP_DECLSPEC ptrdiff_t _STLP_CALL __insert_grouping(wchar_t*, wchar_t*, const string&, wchar_t, wchar_t, wchar_t, int);
1.225 +_STLP_DECLSPEC ptrdiff_t _STLP_CALL __insert_grouping(char* first, char* last, const string&, char, char, char, int);
1.226 +_STLP_DECLSPEC void _STLP_CALL __insert_grouping(__iostring&, size_t, const string&, char, char, char, int);
1.227 +# if !defined (_STLP_NO_WCHAR_T)
1.228 +_STLP_DECLSPEC ptrdiff_t _STLP_CALL __insert_grouping(wchar_t*, wchar_t*, const string&, wchar_t, wchar_t, wchar_t, int);
1.229 +_STLP_DECLSPEC void _STLP_CALL __insert_grouping(__iowstring&, size_t, const string&, wchar_t, wchar_t, wchar_t, int);
1.230 # endif
1.231
1.232 -# endif
1.233 +_STLP_MOVE_TO_STD_NAMESPACE
1.234
1.235 -# if defined (__BORLANDC__) && defined (_RTLDLL)
1.236 -inline void _Stl_loc_init_num_put() {
1.237 -
1.238 - num_put<char, ostreambuf_iterator<char, char_traits<char> > >::id._M_index = 14;
1.239 - num_put<char, char*>::id._M_index = 15;
1.240 -
1.241 -# ifndef _STLP_NO_WCHAR_T
1.242 - num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > > ::id._M_index = 33;
1.243 - num_put<wchar_t, wchar_t*>::id._M_index = 34;
1.244 -# endif
1.245 -
1.246 -}
1.247 -
1.248 -# endif
1.249 +#endif /* _STLP_EXPOSE_STREAM_IMPLEMENTATION */
1.250
1.251 _STLP_END_NAMESPACE
1.252
1.253 -# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && ! defined (_STLP_LINK_TIME_INSTANTIATION)
1.254 -# include <stl/_num_put.c>
1.255 -# endif
1.256 +#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
1.257 +# include <stl/_num_put.c>
1.258 +#endif
1.259
1.260 #endif /* _STLP_INTERNAL_NUMERIC_FACETS_H */
1.261
1.262 // Local Variables:
1.263 // mode:C++
1.264 // End:
1.265 -