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