epoc32/include/stdapis/stlportv5/stl/_num_get.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_GET_H
    26 #define _STLP_INTERNAL_NUM_GET_H
    27 
    28 #ifndef _STLP_INTERNAL_ISTREAMBUF_ITERATOR_H
    29 #  include <stl/_istreambuf_iterator.h>
    30 #endif
    31 
    32 #ifndef _STLP_C_LOCALE_H
    33 #  include <stl/c_locale.h>
    34 #endif
    35 
    36 #ifndef _STLP_INTERNAL_NUMPUNCT_H
    37 #  include <stl/_numpunct.h>
    38 #endif
    39 
    40 #ifndef _STLP_INTERNAL_CTYPE_H
    41 #  include <stl/_ctype.h>
    42 #endif
    43 
    44 #ifndef _STLP_INTERNAL_IOSTREAM_STRING_H
    45 #  include <stl/_iostream_string.h>
    46 #endif
    47 
    48 _STLP_BEGIN_NAMESPACE
    49 
    50 //----------------------------------------------------------------------
    51 // num_get facets
    52 
    53 #if defined (_STLP_LIMITED_DEFAULT_TEMPLATES)
    54 template <class _CharT, class _InputIter>
    55 #else
    56 template <class _CharT, class _InputIter = istreambuf_iterator<_CharT, char_traits<_CharT> > >
    57 #endif
    58 class num_get: public locale::facet {
    59   friend class _Locale_impl;
    60 public:
    61   typedef _CharT     char_type;
    62   typedef _InputIter iter_type;
    63 
    64   explicit num_get(size_t __refs = 0): locale::facet(__refs) {}
    65 
    66 #if !defined (_STLP_NO_BOOL)
    67   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
    68                  ios_base::iostate& __err, bool& __val) const
    69   { return do_get(__ii, __end, __str, __err, __val); }
    70 #endif
    71 
    72 #if defined (_STLP_FIX_LIBRARY_ISSUES)
    73   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
    74                  ios_base::iostate& __err, short& __val) const
    75   { return do_get(__ii, __end, __str, __err, __val); }
    76 
    77   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
    78                  ios_base::iostate& __err, int& __val) const
    79   { return do_get(__ii, __end, __str, __err, __val); }
    80 #endif
    81 
    82   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
    83                  ios_base::iostate& __err, long& __val) const
    84   { return do_get(__ii, __end, __str, __err, __val); }
    85 
    86   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
    87                  ios_base::iostate& __err, unsigned short& __val) const
    88   { return do_get(__ii, __end, __str, __err, __val); }
    89 
    90   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
    91                  ios_base::iostate& __err, unsigned int& __val) const
    92   { return do_get(__ii, __end, __str, __err, __val); }
    93 
    94   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
    95                  ios_base::iostate& __err, unsigned long& __val) const
    96   { return do_get(__ii, __end, __str, __err, __val); }
    97 
    98 #if defined (_STLP_LONG_LONG)
    99   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
   100                  ios_base::iostate& __err, _STLP_LONG_LONG& __val) const
   101   { return do_get(__ii, __end, __str, __err, __val); }
   102 
   103   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
   104                  ios_base::iostate& __err, unsigned _STLP_LONG_LONG& __val) const
   105   { return do_get(__ii, __end, __str, __err, __val); }
   106 #endif /* _STLP_LONG_LONG */
   107 
   108   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
   109                  ios_base::iostate& __err, float& __val) const
   110   { return do_get(__ii, __end, __str, __err, __val); }
   111 
   112   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
   113                  ios_base::iostate& __err, double& __val) const
   114   { return do_get(__ii, __end, __str, __err, __val); }
   115 
   116 #if !defined (_STLP_NO_LONG_DOUBLE)
   117   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
   118                  ios_base::iostate& __err, long double& __val) const
   119   { return do_get(__ii, __end, __str, __err, __val); }
   120 # endif
   121 
   122   _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str,
   123                  ios_base::iostate& __err, void*& __val) const
   124   { return do_get(__ii, __end, __str, __err, __val); }
   125 
   126 #if defined(__SYMBIAN32__WSD__) 
   127   static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
   128 #elif defined (__SYMBIAN32__NO_STATIC_IMPORTS__)    
   129   static _STLP_STATIC_MEMBER_DECLSPEC locale::id& GetFacetLocaleId();
   130   static locale::id id;       
   131 #else
   132   // NOTE: Symbian doesn't support exporting static data.  
   133   // Users of this class should use GetFacetLocaleId() to access the data member id  
   134   static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
   135 #endif
   136 
   137 protected:
   138   ~num_get() {}
   139 
   140   typedef string               string_type;
   141   typedef ctype<_CharT>        _Ctype;
   142   typedef numpunct<_CharT>     _Numpunct;
   143 
   144 #if !defined (_STLP_NO_BOOL)
   145   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   146                             ios_base::iostate& __err, bool& __val) const;
   147 #endif
   148 
   149   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   150                             ios_base::iostate& __err, long& __val) const;
   151   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   152                             ios_base::iostate& __err, unsigned short& __val) const;
   153   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   154                             ios_base::iostate& __err, unsigned int& __val) const;
   155   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   156                             ios_base::iostate& __err, unsigned long& __val) const;
   157 
   158 #if defined (_STLP_FIX_LIBRARY_ISSUES)
   159   // issue 118 : those are actually not supposed to be here
   160   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   161                             ios_base::iostate& __err, short& __val) const;
   162   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   163                             ios_base::iostate& __err, int& __val) const;
   164 #endif
   165 
   166   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   167                             ios_base::iostate& __err, float& __val) const;
   168   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   169                             ios_base::iostate& __err, double& __val) const;
   170   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   171                             ios_base::iostate& __err, void*& __p) const;
   172 
   173 #if !defined (_STLP_NO_LONG_DOUBLE)
   174   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   175                             ios_base::iostate& __err, long double& __val) const;
   176 #endif
   177 
   178 #if defined (_STLP_LONG_LONG)
   179   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   180                             ios_base::iostate& __err, _STLP_LONG_LONG& __val) const;
   181   virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str,
   182                             ios_base::iostate& __err, unsigned _STLP_LONG_LONG& __val) const;
   183 #endif
   184 
   185 };
   186 
   187 
   188 #if defined (_STLP_USE_TEMPLATE_EXPORT)
   189 _STLP_EXPORT_TEMPLATE_CLASS num_get<char, istreambuf_iterator<char, char_traits<char> > >;
   190 // _STLP_EXPORT_TEMPLATE_CLASS num_get<char, const char*>;
   191 #  if !defined (_STLP_NO_WCHAR_T)
   192 _STLP_EXPORT_TEMPLATE_CLASS num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
   193 // _STLP_EXPORT_TEMPLATE_CLASS num_get<wchar_t, const wchar_t*>;
   194 #  endif
   195 #endif
   196 
   197 #if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
   198 
   199 _STLP_MOVE_TO_PRIV_NAMESPACE
   200 
   201 _STLP_DECLSPEC bool _STLP_CALL __valid_grouping(const char*, const char*, const char*, const char*);
   202 
   203 template <class _InputIter, class _Integer, class _CharT>
   204 bool _STLP_CALL
   205 __get_decimal_integer(_InputIter& __first, _InputIter& __last, _Integer& __val, _CharT*);
   206 
   207 #  if !defined (_STLP_NO_WCHAR_T)
   208 bool _STLP_DECLSPEC _STLP_CALL __get_fdigit(wchar_t&, const wchar_t*);
   209 bool _STLP_DECLSPEC _STLP_CALL __get_fdigit_or_sep(wchar_t&, wchar_t, const wchar_t*);
   210 #  endif
   211 
   212 inline void  _STLP_CALL
   213 _Initialize_get_float(const ctype<char>&,
   214                        char& Plus, char& Minus,
   215                        char& pow_e, char& pow_E,
   216                        char*) {
   217   Plus = '+';
   218   Minus = '-';
   219   pow_e = 'e';
   220   pow_E = 'E';
   221 }
   222 
   223 #  if !defined (_STLP_NO_WCHAR_T)
   224 void _STLP_DECLSPEC _STLP_CALL _Initialize_get_float(const ctype<wchar_t>&,
   225                                                      wchar_t&, wchar_t&, wchar_t&, wchar_t&, wchar_t*);
   226 #  endif
   227 void _STLP_DECLSPEC _STLP_CALL __string_to_float(const __iostring&, float&);
   228 void _STLP_DECLSPEC _STLP_CALL __string_to_float(const __iostring&, double&);
   229 #  if !defined (_STLP_NO_LONG_DOUBLE)
   230 void _STLP_DECLSPEC _STLP_CALL __string_to_float(const __iostring&, long double&);
   231 #  endif
   232 
   233 _STLP_MOVE_TO_STD_NAMESPACE
   234 
   235 #endif /* _STLP_EXPOSE_STREAM_IMPLEMENTATION */
   236 
   237 _STLP_END_NAMESPACE
   238 
   239 #if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
   240 #  include <stl/_num_get.c>
   241 #endif
   242 
   243 #endif /* _STLP_INTERNAL_NUM_GET_H */
   244 
   245 // Local Variables:
   246 // mode:C++
   247 // End:
   248