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