epoc32/include/stdapis/stlport/stl/_num_put.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
/*
williamr@4
     2
 * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
williamr@4
     3
 *
williamr@4
     4
 * Copyright (c) 1999
williamr@4
     5
 * Silicon Graphics Computer Systems, Inc.
williamr@4
     6
 *
williamr@4
     7
 * Copyright (c) 1999 
williamr@4
     8
 * Boris Fomitchev
williamr@4
     9
 *
williamr@4
    10
 * This material is provided "as is", with absolutely no warranty expressed
williamr@4
    11
 * or implied. Any use is at your own risk.
williamr@4
    12
 *
williamr@4
    13
 * Permission to use or copy this software for any purpose is hereby granted 
williamr@4
    14
 * without fee, provided the above notices are retained on all copies.
williamr@4
    15
 * Permission to modify the code and to distribute modified code is granted,
williamr@4
    16
 * provided the above notices are retained, and a notice that the code was
williamr@4
    17
 * modified is included with the above copyright notice.
williamr@4
    18
 *
williamr@4
    19
 */ 
williamr@4
    20
// WARNING: This is an internal header file, included by other C++
williamr@4
    21
// standard library headers.  You should not attempt to use this header
williamr@4
    22
// file directly.
williamr@4
    23
williamr@4
    24
williamr@4
    25
#ifndef _STLP_INTERNAL_NUM_PUT_H
williamr@4
    26
#define _STLP_INTERNAL_NUM_PUT_H
williamr@4
    27
williamr@4
    28
#ifndef _STLP_INTERNAL_NUMPUNCT_H
williamr@4
    29
# include <stl/_numpunct.h>
williamr@4
    30
#endif
williamr@4
    31
#ifndef _STLP_INTERNAL_CTYPE_H
williamr@4
    32
# include <stl/_ctype.h>
williamr@4
    33
#endif
williamr@4
    34
#ifndef _STLP_INTERNAL_OSTREAMBUF_ITERATOR_H
williamr@4
    35
# include <stl/_ostreambuf_iterator.h>
williamr@4
    36
#endif
williamr@4
    37
williamr@4
    38
_STLP_BEGIN_NAMESPACE
williamr@4
    39
williamr@4
    40
//----------------------------------------------------------------------
williamr@4
    41
// num_put facet
williamr@4
    42
williamr@4
    43
# ifdef _STLP_LIMITED_DEFAULT_TEMPLATES
williamr@4
    44
template <class _CharT, class _OutputIter>  
williamr@4
    45
# else
williamr@4
    46
template <class _CharT, class _OutputIter = ostreambuf_iterator<_CharT, char_traits<_CharT> > >  
williamr@4
    47
# endif
williamr@4
    48
class num_put: public locale::facet
williamr@4
    49
{
williamr@4
    50
  friend class _Locale;
williamr@4
    51
public:
williamr@4
    52
  typedef _CharT      char_type;
williamr@4
    53
  typedef _OutputIter iter_type;
williamr@4
    54
williamr@4
    55
  explicit  num_put(size_t __refs = 0) : _BaseFacet(__refs) {}
williamr@4
    56
williamr@4
    57
# ifndef _STLP_NO_BOOL
williamr@4
    58
  iter_type put(iter_type __s, ios_base& __f, char_type __fill,
williamr@4
    59
                bool __val) const {
williamr@4
    60
    return do_put(__s, __f, __fill, __val);
williamr@4
    61
  }
williamr@4
    62
# endif
williamr@4
    63
  iter_type put(iter_type __s, ios_base& __f, char_type __fill,
williamr@4
    64
               long __val) const {
williamr@4
    65
    return do_put(__s, __f, __fill, __val);
williamr@4
    66
  }
williamr@4
    67
williamr@4
    68
  iter_type put(iter_type __s, ios_base& __f, char_type __fill,
williamr@4
    69
                unsigned long __val) const {
williamr@4
    70
    return do_put(__s, __f, __fill, __val);
williamr@4
    71
  }
williamr@4
    72
williamr@4
    73
#ifdef _STLP_LONG_LONG
williamr@4
    74
  iter_type put(iter_type __s, ios_base& __f, char_type __fill,
williamr@4
    75
                _STLP_LONG_LONG __val) const {
williamr@4
    76
    return do_put(__s, __f, __fill, __val);
williamr@4
    77
  }
williamr@4
    78
williamr@4
    79
  iter_type put(iter_type __s, ios_base& __f, char_type __fill,
williamr@4
    80
                unsigned _STLP_LONG_LONG __val) const {
williamr@4
    81
    return do_put(__s, __f, __fill, __val);
williamr@4
    82
  }
williamr@4
    83
#endif
williamr@4
    84
williamr@4
    85
  iter_type put(iter_type __s, ios_base& __f, char_type __fill,
williamr@4
    86
                double __val) const {
williamr@4
    87
    return do_put(__s, __f, __fill, (double)__val);
williamr@4
    88
  }
williamr@4
    89
williamr@4
    90
#ifndef _STLP_NO_LONG_DOUBLE
williamr@4
    91
  iter_type put(iter_type __s, ios_base& __f, char_type __fill,
williamr@4
    92
                long double __val) const {
williamr@4
    93
    return do_put(__s, __f, __fill, __val);
williamr@4
    94
  }
williamr@4
    95
# endif
williamr@4
    96
williamr@4
    97
  iter_type put(iter_type __s, ios_base& __f, char_type __fill,
williamr@4
    98
                const void * __val) const {
williamr@4
    99
    return do_put(__s, __f, __fill, __val);
williamr@4
   100
  }
williamr@4
   101
williamr@4
   102
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
williamr@4
   103
    _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId();
williamr@4
   104
    _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
williamr@4
   105
                GetFacetLocaleId(ostreambuf_iterator<char, char_traits<char> > *);
williamr@4
   106
    _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId(char**);
williamr@4
   107
	//wchar_t
williamr@4
   108
    _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
williamr@4
   109
	                GetFacetLocaleId(ostreambuf_iterator<wchar_t, char_traits<wchar_t> > *);
williamr@4
   110
    _STLP_STATIC_MEMBER_DECLSPEC static locale::id& GetFacetLocaleId(wchar_t**);
williamr@4
   111
    //adding for new iterator type
williamr@4
   112
    _STLP_STATIC_MEMBER_DECLSPEC static locale::id&
williamr@4
   113
	                GetFacetLocaleId(back_insert_iterator<string> *);
williamr@4
   114
#else
williamr@4
   115
  _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
williamr@4
   116
#endif
williamr@4
   117
williamr@4
   118
protected:
williamr@4
   119
  ~num_put() {}   
williamr@4
   120
# ifndef _STLP_NO_BOOL
williamr@4
   121
  virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, bool __val) const;
williamr@4
   122
# endif
williamr@4
   123
  virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long __val) const;
williamr@4
   124
  virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, unsigned long __val) const;
williamr@4
   125
  virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, double __val) const;
williamr@4
   126
#ifndef _STLP_NO_LONG_DOUBLE
williamr@4
   127
  virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long double __val) const;
williamr@4
   128
#endif
williamr@4
   129
williamr@4
   130
#ifdef _STLP_LONG_LONG
williamr@4
   131
  virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, _STLP_LONG_LONG __val) const;
williamr@4
   132
  virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, 
williamr@4
   133
                           unsigned _STLP_LONG_LONG __val) const ;
williamr@4
   134
#endif /* _STLP_LONG_LONG  */
williamr@4
   135
  virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, const void* __val) const;
williamr@4
   136
};
williamr@4
   137
williamr@4
   138
# ifdef _STLP_USE_TEMPLATE_EXPORT
williamr@4
   139
_STLP_EXPORT_TEMPLATE_CLASS num_put<char, ostreambuf_iterator<char, char_traits<char> > >;
williamr@4
   140
// _STLP_EXPORT_TEMPLATE_CLASS num_put<char, char*>;
williamr@4
   141
#  ifndef _STLP_NO_WCHAR_T
williamr@4
   142
_STLP_EXPORT_TEMPLATE_CLASS num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
williamr@4
   143
// _STLP_EXPORT_TEMPLATE_CLASS num_put<wchar_t, wchar_t*>;
williamr@4
   144
#  endif /* _STLP_NO_WCHAR_T */
williamr@4
   145
# endif
williamr@4
   146
williamr@4
   147
# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
williamr@4
   148
williamr@4
   149
template <class _Integer>
williamr@4
   150
char* _STLP_CALL
williamr@4
   151
__write_integer_backward(char* __buf, ios_base::fmtflags __flags, _Integer __x);
williamr@4
   152
williamr@4
   153
extern _STLP_DECLSPEC int  _STLP_CALL __string_to_float(const string&, float&);
williamr@4
   154
extern _STLP_DECLSPEC int  _STLP_CALL __string_to_float(const string&, double&);
williamr@4
   155
extern _STLP_DECLSPEC void _STLP_CALL __write_float(string&, ios_base::fmtflags, int, double);
williamr@4
   156
# ifndef _STLP_NO_LONG_DOUBLE
williamr@4
   157
int  _STLP_CALL __string_to_float(const string&, long double&);
williamr@4
   158
extern _STLP_DECLSPEC void _STLP_CALL __write_float(string&, ios_base::fmtflags, int, long double);
williamr@4
   159
# endif
williamr@4
   160
williamr@4
   161
#ifndef _STLP_NO_WCHAR_T
williamr@4
   162
extern _STLP_DECLSPEC wchar_t* _STLP_CALL __convert_float_buffer(const char*, const char*, wchar_t*, const ctype<wchar_t>&, wchar_t);
williamr@4
   163
#endif
williamr@4
   164
extern _STLP_DECLSPEC void _STLP_CALL __adjust_float_buffer(char*, char*, char);
williamr@4
   165
williamr@4
   166
extern _STLP_DECLSPEC char* _STLP_CALL
williamr@4
   167
__write_integer(char* buf, ios_base::fmtflags flags, long x);
williamr@4
   168
williamr@4
   169
extern _STLP_DECLSPEC ptrdiff_t _STLP_CALL __insert_grouping(char* first, char* last, const string&, char, char, char, int);
williamr@4
   170
#  ifndef _STLP_NO_WCHAR_T
williamr@4
   171
extern _STLP_DECLSPEC ptrdiff_t _STLP_CALL __insert_grouping(wchar_t*, wchar_t*, const string&, wchar_t, wchar_t, wchar_t, int);
williamr@4
   172
#  endif
williamr@4
   173
williamr@4
   174
# endif
williamr@4
   175
williamr@4
   176
# if defined (__BORLANDC__) && defined (_RTLDLL)
williamr@4
   177
inline void _Stl_loc_init_num_put() {
williamr@4
   178
  
williamr@4
   179
  num_put<char, ostreambuf_iterator<char, char_traits<char> > >::id._M_index = 14;
williamr@4
   180
  num_put<char, char*>::id._M_index = 15;
williamr@4
   181
  
williamr@4
   182
# ifndef _STLP_NO_WCHAR_T
williamr@4
   183
  num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > > ::id._M_index = 33;
williamr@4
   184
  num_put<wchar_t, wchar_t*>::id._M_index = 34;
williamr@4
   185
# endif
williamr@4
   186
  
williamr@4
   187
}
williamr@4
   188
 
williamr@4
   189
# endif
williamr@4
   190
williamr@4
   191
_STLP_END_NAMESPACE
williamr@4
   192
williamr@4
   193
#  if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && ! defined (_STLP_LINK_TIME_INSTANTIATION)
williamr@4
   194
#   include <stl/_num_put.c>
williamr@4
   195
#  endif
williamr@4
   196
williamr@4
   197
#endif /* _STLP_INTERNAL_NUMERIC_FACETS_H */
williamr@4
   198
williamr@4
   199
// Local Variables:
williamr@4
   200
// mode:C++
williamr@4
   201
// End:
williamr@4
   202