epoc32/include/stdapis/stlportv5/stl/_num_get.c
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 #ifndef _STLP_NUM_GET_C
    21 #define _STLP_NUM_GET_C
    22 
    23 #ifndef _STLP_INTERNAL_NUM_GET_H
    24 #  include <stl/_num_get.h>
    25 #endif
    26 
    27 #ifndef _STLP_INTERNAL_LIMITS
    28 #  include <stl/_limits.h>
    29 #endif
    30 
    31 _STLP_BEGIN_NAMESPACE
    32 
    33 _STLP_MOVE_TO_PRIV_NAMESPACE
    34 
    35 _STLP_DECLSPEC unsigned char _STLP_CALL __digit_val_table(unsigned);
    36 _STLP_DECLSPEC const char* _STLP_CALL __narrow_atoms();
    37 
    38 template < class _InputIter, class _Integer, class _CharT>
    39 _InputIter _STLP_CALL
    40 __do_get_integer(_InputIter&, _InputIter&, ios_base&, ios_base::iostate&, _Integer&, _CharT*);
    41 
    42 // __do_get_integer and its helper functions.
    43 
    44 inline bool _STLP_CALL __get_fdigit(char __c, const char*)
    45 { return __c >= '0' && __c <= '9'; }
    46 
    47 inline bool _STLP_CALL __get_fdigit_or_sep(char& __c, char __sep, const char *__digits) {
    48   if (__c == __sep) {
    49     __c = ',' ;
    50     return true ;
    51   }
    52   else
    53     return  __get_fdigit(__c, __digits);
    54 }
    55 
    56 inline int _STLP_CALL
    57 __get_digit_from_table(unsigned __index)
    58 { return (__index > 127 ? 0xFF : __digit_val_table(__index)); }
    59 
    60 template <class _InputIter, class _CharT>
    61 int
    62 __get_base_or_zero(_InputIter& __in_ite, _InputIter& __end, ios_base& __str, _CharT*) {
    63   _CharT __atoms[5];
    64   const ctype<_CharT>& __c_type = *__STATIC_CAST(const ctype<_CharT>*, __str._M_ctype_facet());
    65 
    66   __c_type.widen(__narrow_atoms(), __narrow_atoms() + 5, __atoms);
    67 
    68   bool __negative = false;
    69   _CharT __c = *__in_ite;
    70 
    71   if (__c == __atoms[1] /* __xminus_char */ ) {
    72     __negative = true;
    73     ++__in_ite;
    74   }
    75   else if (__c == __atoms[0] /* __xplus_char */ )
    76     ++__in_ite;
    77 
    78   int __base;
    79   int __valid_zero = 0;
    80 
    81   ios_base::fmtflags __basefield = __str.flags() & ios_base::basefield;
    82 
    83   switch (__basefield) {
    84   case ios_base::oct:
    85     __base = 8;
    86     break;
    87   case ios_base::dec:
    88     __base = 10;
    89     break;
    90   case ios_base::hex:
    91     __base = 16;
    92     if (__in_ite != __end && *__in_ite == __atoms[2] /* __zero_char */ ) {
    93       ++__in_ite;
    94       if (__in_ite != __end &&
    95           (*__in_ite == __atoms[3] /* __x_char */ || *__in_ite == __atoms[4] /* __X_char */ ))
    96         ++__in_ite;
    97       else
    98         __valid_zero = 1; // That zero is valid by itself.
    99     }
   100     break;
   101   default:
   102     if (__in_ite != __end && *__in_ite == __atoms[2] /* __zero_char */ ) {
   103       ++__in_ite;
   104       if (__in_ite != __end &&
   105           (*__in_ite == __atoms[3] /* __x_char */ || *__in_ite == __atoms[4] /* __X_char */ )) {
   106         ++__in_ite;
   107         __base = 16;
   108       }
   109       else
   110         {
   111           __base = 8;
   112           __valid_zero = 1; // That zero is still valid by itself.
   113         }
   114     }
   115     else
   116       __base = 10;
   117     break;
   118   }
   119   return (__base << 2) | ((int)__negative << 1) | __valid_zero;
   120 }
   121 
   122 
   123 template <class _InputIter, class _Integer, class _CharT>
   124 bool _STLP_CALL
   125 __get_integer(_InputIter& __first, _InputIter& __last,
   126               int __base, _Integer& __val,
   127               int __got, bool __is_negative, _CharT __separator, const string& __grouping, const __true_type& /*_IsSigned*/) {
   128   bool __ovflow = false;
   129   _Integer __result = 0;
   130   bool __is_group = !__grouping.empty();
   131   char __group_sizes[64];
   132   char __current_group_size = 0;
   133   char* __group_sizes_end = __group_sizes;
   134 
   135   _Integer __over_base = (numeric_limits<_Integer>::min)() / __STATIC_CAST(_Integer, __base);
   136 
   137    for ( ; __first != __last ; ++__first) {
   138 
   139      const _CharT __c = *__first;
   140 
   141      if (__is_group && __c == __separator) {
   142        *__group_sizes_end++ = __current_group_size;
   143        __current_group_size = 0;
   144        continue;
   145      }
   146 
   147      int __n = __get_digit_from_table(__c);
   148 
   149      if (__n >= __base)
   150        break;
   151 
   152      ++__got;
   153      ++__current_group_size;
   154 
   155      if (__result < __over_base)
   156        __ovflow = true;  // don't need to keep accumulating
   157      else {
   158        _Integer __next = __STATIC_CAST(_Integer, __base * __result - __n);
   159        if (__result != 0)
   160          __ovflow = __ovflow || __next >= __result;
   161        __result = __next;
   162      }
   163    }
   164 
   165    if (__is_group && __group_sizes_end != __group_sizes) {
   166      *__group_sizes_end++ = __current_group_size;
   167    }
   168 
   169    // fbp : added to not modify value if nothing was read
   170    if (__got > 0) {
   171        __val = __ovflow ? __is_negative ? (numeric_limits<_Integer>::min)()
   172                                         : (numeric_limits<_Integer>::max)()
   173                         : __is_negative ? __result
   174                                         : __STATIC_CAST(_Integer, -__result);
   175    }
   176   // overflow is being treated as failure
   177   return ((__got > 0) && !__ovflow) &&
   178           (__is_group == 0 ||
   179            __valid_grouping(__group_sizes, __group_sizes_end,
   180                             __grouping.data(), __grouping.data()+ __grouping.size()));
   181 }
   182 
   183 template <class _InputIter, class _Integer, class _CharT>
   184 bool _STLP_CALL
   185 __get_integer(_InputIter& __first, _InputIter& __last,
   186               int __base, _Integer& __val,
   187               int __got, bool __is_negative, _CharT __separator, const string& __grouping, const __false_type& /*_IsSigned*/) {
   188   bool __ovflow = false;
   189   _Integer __result = 0;
   190   bool __is_group = !__grouping.empty();
   191   char __group_sizes[64];
   192   char __current_group_size = 0;
   193   char* __group_sizes_end = __group_sizes;
   194 
   195   _Integer  __over_base = (numeric_limits<_Integer>::max)() / __STATIC_CAST(_Integer, __base);
   196 
   197   for ( ; __first != __last ; ++__first) {
   198 
   199     const _CharT __c = *__first;
   200 
   201     if (__is_group && __c == __separator) {
   202       *__group_sizes_end++ = __current_group_size;
   203       __current_group_size = 0;
   204       continue;
   205     }
   206 
   207     int __n = __get_digit_from_table(__c);
   208 
   209     if (__n >= __base)
   210       break;
   211 
   212     ++__got;
   213     ++__current_group_size;
   214 
   215     if (__result > __over_base)
   216       __ovflow = true;  //don't need to keep accumulating
   217     else {
   218       _Integer __next = __STATIC_CAST(_Integer, __base * __result + __n);
   219       if (__result != 0)
   220         __ovflow = __ovflow || __next <= __result;
   221         __result = __next;
   222       }
   223   }
   224 
   225   if (__is_group && __group_sizes_end != __group_sizes) {
   226       *__group_sizes_end++ = __current_group_size;
   227   }
   228 
   229   // fbp : added to not modify value if nothing was read
   230   if (__got > 0) {
   231       __val = __ovflow ? (numeric_limits<_Integer>::max)()
   232                        : (__is_negative ? __STATIC_CAST(_Integer, -__result)
   233                                         : __result);
   234   }
   235 
   236   // overflow is being treated as failure
   237   return ((__got > 0) && !__ovflow) &&
   238           (__is_group == 0 ||
   239            __valid_grouping(__group_sizes, __group_sizes_end,
   240                             __grouping.data(), __grouping.data()+ __grouping.size()));
   241 }
   242 
   243 
   244 template <class _InputIter, class _Integer, class _CharT>
   245 bool _STLP_CALL
   246 __get_decimal_integer(_InputIter& __first, _InputIter& __last, _Integer& __val, _CharT* /*dummy*/) {
   247   string __grp;
   248   //Here there is no grouping so separator is not important, we just pass the default charater.
   249   return __get_integer(__first, __last, 10, __val, 0, false, _CharT() /*separator*/, __grp, __false_type());
   250 }
   251 
   252 template <class _InputIter, class _Integer, class _CharT>
   253 _InputIter _STLP_CALL
   254 __do_get_integer(_InputIter& __in_ite, _InputIter& __end, ios_base& __str,
   255                  ios_base::iostate& __err, _Integer& __val, _CharT* __pc) {
   256 #if defined (__HP_aCC) && (__HP_aCC == 1)
   257   bool _IsSigned = !((_Integer)(-1) > 0);
   258 #else
   259   typedef typename __bool2type<numeric_limits<_Integer>::is_signed>::_Ret _IsSigned;
   260 #endif
   261 
   262   const numpunct<_CharT>& __numpunct = *__STATIC_CAST(const numpunct<_CharT>*, __str._M_numpunct_facet());
   263   const string& __grouping = __str._M_grouping(); // cached copy
   264 
   265   const int __base_or_zero = __get_base_or_zero(__in_ite, __end, __str, __pc);
   266   int  __got = __base_or_zero & 1;
   267 
   268   bool __result;
   269 
   270   if (__in_ite == __end) {      // We may have already read a 0.  If so,
   271 
   272     if (__got > 0) {       // the result is 0 even if we're at eof.
   273       __val = 0;
   274       __result = true;
   275     }
   276     else
   277       __result = false;
   278   }
   279   else {
   280     const bool __negative = (__base_or_zero & 2) != 0;
   281     const int __base = __base_or_zero >> 2;
   282 
   283 #if defined (__HP_aCC) && (__HP_aCC == 1)
   284     if (_IsSigned)
   285       __result = __get_integer(__in_ite, __end, __base,  __val, __got, __negative, __numpunct.thousands_sep(), __grouping, __true_type() );
   286     else
   287       __result = __get_integer(__in_ite, __end, __base,  __val, __got, __negative, __numpunct.thousands_sep(), __grouping, __false_type() );
   288 #else
   289     __result = __get_integer(__in_ite, __end, __base,  __val, __got, __negative, __numpunct.thousands_sep(), __grouping, _IsSigned());
   290 # endif
   291   }
   292 
   293   __err = __STATIC_CAST(ios_base::iostate, __result ? ios_base::goodbit : ios_base::failbit);
   294 
   295   if (__in_ite == __end)
   296     __err |= ios_base::eofbit;
   297   return __in_ite;
   298 }
   299 
   300 // __read_float and its helper functions.
   301 template <class _InputIter, class _CharT>
   302 _InputIter  _STLP_CALL
   303 __copy_sign(_InputIter __first, _InputIter __last, __iostring& __v,
   304             _CharT __xplus, _CharT __xminus) {
   305   if (__first != __last) {
   306     _CharT __c = *__first;
   307     if (__c == __xplus)
   308       ++__first;
   309     else if (__c == __xminus) {
   310       __v.push_back('-');
   311       ++__first;
   312     }
   313   }
   314   return __first;
   315 }
   316 
   317 
   318 template <class _InputIter, class _CharT>
   319 bool _STLP_CALL
   320 __copy_digits(_InputIter& __first, _InputIter __last,
   321               __iostring& __v, const _CharT* __digits) {
   322   bool __ok = false;
   323 
   324   for ( ; __first != __last; ++__first) {
   325     _CharT __c = *__first;
   326     if (__get_fdigit(__c, __digits)) {
   327       __v.push_back((char)__c);
   328       __ok = true;
   329     }
   330     else
   331       break;
   332   }
   333   return __ok;
   334 }
   335 
   336 template <class _InputIter, class _CharT>
   337 bool _STLP_CALL
   338 __copy_grouped_digits(_InputIter& __first, _InputIter __last,
   339                       __iostring& __v, const _CharT * __digits,
   340                       _CharT __sep, const string& __grouping,
   341                       bool& __grouping_ok) {
   342   bool __ok = false;
   343   char __group_sizes[64];
   344   char*__group_sizes_end = __group_sizes;
   345   char __current_group_size = 0;
   346 
   347   for ( ; __first != __last; ++__first) {
   348     _CharT __c = *__first;
   349     bool __tmp = __get_fdigit_or_sep(__c, __sep, __digits);
   350     if (__tmp) {
   351       if (__c == ',') {
   352         *__group_sizes_end++ = __current_group_size;
   353         __current_group_size = 0;
   354       }
   355       else {
   356         __ok = true;
   357         __v.push_back((char)__c);
   358         ++__current_group_size;
   359       }
   360     }
   361     else
   362       break;
   363   }
   364 
   365   if (__group_sizes_end != __group_sizes)
   366     *__group_sizes_end++ = __current_group_size;
   367   __grouping_ok = __valid_grouping(__group_sizes, __group_sizes_end, __grouping.data(), __grouping.data() + __grouping.size());
   368   return __ok;
   369 }
   370 
   371 
   372 template <class _InputIter, class _CharT>
   373 bool _STLP_CALL
   374 __read_float(__iostring& __buf, _InputIter& __in_ite, _InputIter& __end, ios_base& __s, _CharT*) {
   375   // Create a string, copying characters of the form
   376   // [+-]? [0-9]* .? [0-9]* ([eE] [+-]? [0-9]+)?
   377 
   378   bool __digits_before_dot /* = false */;
   379   bool __digits_after_dot = false;
   380   bool __ok;
   381 
   382   bool   __grouping_ok = true;
   383 
   384   const ctype<_CharT>& __ct = *__STATIC_CAST(const ctype<_CharT>*, __s._M_ctype_facet());
   385   const numpunct<_CharT>& __numpunct = *__STATIC_CAST(const numpunct<_CharT>*, __s._M_numpunct_facet());
   386   const string& __grouping = __s._M_grouping(); // cached copy
   387 
   388   _CharT __dot = __numpunct.decimal_point();
   389   _CharT __sep = __numpunct.thousands_sep();
   390 
   391   _CharT __digits[10];
   392   _CharT __xplus;
   393   _CharT __xminus;
   394 
   395   _CharT __pow_e;
   396   _CharT __pow_E;
   397 
   398   _Initialize_get_float(__ct, __xplus, __xminus, __pow_e, __pow_E, __digits);
   399 
   400   // Get an optional sign
   401   __in_ite = __copy_sign(__in_ite, __end, __buf, __xplus, __xminus);
   402 
   403   // Get an optional string of digits.
   404   if (!__grouping.empty())
   405     __digits_before_dot = __copy_grouped_digits(__in_ite, __end, __buf, __digits,
   406                                                 __sep, __grouping, __grouping_ok);
   407   else
   408     __digits_before_dot = __copy_digits(__in_ite, __end, __buf, __digits);
   409 
   410   // Get an optional decimal point, and an optional string of digits.
   411   if (__in_ite != __end && *__in_ite == __dot) {
   412     __buf.push_back('.');
   413     ++__in_ite;
   414     __digits_after_dot = __copy_digits(__in_ite, __end, __buf, __digits);
   415   }
   416 
   417   // There have to be some digits, somewhere.
   418   __ok = __digits_before_dot || __digits_after_dot;
   419 
   420   // Get an optional exponent.
   421   if (__ok && __in_ite != __end && (*__in_ite == __pow_e || *__in_ite == __pow_E)) {
   422     __buf.push_back('e');
   423     ++__in_ite;
   424     __in_ite = __copy_sign(__in_ite, __end, __buf, __xplus, __xminus);
   425     __ok = __copy_digits(__in_ite, __end, __buf, __digits);
   426     // If we have an exponent then the sign
   427     // is optional but the digits aren't.
   428   }
   429 
   430   return __ok;
   431 }
   432 
   433 _STLP_MOVE_TO_STD_NAMESPACE
   434 
   435 //
   436 // num_get<>, num_put<>
   437 //
   438 
   439 #if ( _STLP_STATIC_TEMPLATE_DATA > 0 )
   440 # if !defined(__SYMBIAN32__WSD__) 
   441 #  if !defined (__BORLANDC__) &&  (defined (__SYMBIAN32__) && defined(_STLP_DESIGNATED_DLL))
   442 template <class _CharT, class _InputIterator>
   443 locale::id num_get<_CharT, _InputIterator>::id;
   444 #  endif
   445 
   446 #  if ((defined (__CYGWIN__) || defined (__MINGW32__)) && \
   447        defined (_STLP_USE_DYNAMIC_LIB) && !defined (__BUILDING_STLPORT)) || (defined (__SYMBIAN32__) && defined(_STLP_DESIGNATED_DLL))
   448 /*
   449  * Under cygwin, when STLport is used as a shared library, the id needs
   450  * to be specified as imported otherwise they will be duplicated in the
   451  * calling executable.
   452  */
   453 #    if defined(__SYMBIAN32__)
   454 template <>
   455 locale::id num_get<char, istreambuf_iterator<char, char_traits<char> > >::id; //data should not exported in symbian
   456 /*
   457 template <>
   458 _STLP_DECLSPEC locale::id num_get<char, const char*>::id;
   459 */
   460 
   461 #    if !defined (STLP_NO_WCHAR_T)
   462 template <>
   463 locale::id num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id;
   464 /*
   465 template <>
   466 _STLP_DECLSPEC locale::id num_get<wchar_t, const wchar_t*>::id;
   467 */
   468 #      endif//STLP_NO_WCHAR_T
   469 #    else
   470 template <>
   471 _STLP_DECLSPEC locale::id num_get<char, istreambuf_iterator<char, char_traits<char> > >::id;
   472 /*
   473 template <>
   474 _STLP_DECLSPEC locale::id num_get<char, const char*>::id;
   475 */
   476 
   477 #    if !defined (STLP_NO_WCHAR_T)
   478 template <>
   479 _STLP_DECLSPEC locale::id num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id;
   480 /*
   481 template <>
   482 _STLP_DECLSPEC locale::id num_get<wchar_t, const wchar_t*>::id;
   483 */
   484 #      endif
   485 #    endif//__SYMBIAN32__
   486 
   487 #  endif /* __CYGWIN__ && _STLP_USE_DYNAMIC_LIB */
   488 #endif //__SYMBIAN32__WSD__
   489 
   490 #else /* ( _STLP_STATIC_TEMPLATE_DATA > 0 ) */
   491 
   492 //typedef num_get<char, const char*> num_get_char;
   493 typedef num_get<char, istreambuf_iterator<char, char_traits<char> > > num_get_char_2;
   494 
   495 //__DECLARE_INSTANCE(locale::id, num_get_char::id, );
   496 __DECLARE_INSTANCE(locale::id, num_get_char_2::id, );
   497 
   498 #  if !defined (_STLP_NO_WCHAR_T)
   499 
   500 //typedef num_get<wchar_t, const wchar_t*> num_get_wchar_t;
   501 typedef num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > > num_get_wchar_t_2;
   502 
   503 //__DECLARE_INSTANCE(locale::id, num_get_wchar_t::id, );
   504 __DECLARE_INSTANCE(locale::id, num_get_wchar_t_2::id, );
   505 
   506 #  endif
   507 
   508 #endif /* ( _STLP_STATIC_TEMPLATE_DATA > 0 ) */
   509 
   510 #if !defined (_STLP_NO_BOOL)
   511 template <class _CharT, class _InputIter>
   512 _InputIter
   513 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end,
   514                                     ios_base& __s,
   515                                     ios_base::iostate& __err, bool& __x) const {
   516   if (__s.flags() & ios_base::boolalpha) {
   517     locale __loc = __s.getloc();
   518     const _Numpunct& __np = *__STATIC_CAST(const _Numpunct*, __s._M_numpunct_facet());
   519     //    const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc) ;
   520 //    const ctype<_CharT>& __ct =    use_facet<ctype<_CharT> >(__loc) ;
   521 
   522     const basic_string<_CharT> __truename  = __np.truename();
   523     const basic_string<_CharT> __falsename = __np.falsename();
   524     bool __true_ok  = true;
   525     bool __false_ok = true;
   526 
   527     size_t __n = 0;
   528     for ( ; __in_ite != __end; ++__in_ite) {
   529       _CharT __c = *__in_ite;
   530       __true_ok  = __true_ok  && (__c == __truename[__n]);
   531       __false_ok = __false_ok && (__c == __falsename[__n]);
   532       ++__n;
   533 
   534       if ((!__true_ok && !__false_ok) ||
   535           (__true_ok  && __n >= __truename.size()) ||
   536           (__false_ok && __n >= __falsename.size())) {
   537         ++__in_ite;
   538         break;
   539       }
   540     }
   541     if (__true_ok  && __n < __truename.size())  __true_ok  = false;
   542     if (__false_ok && __n < __falsename.size()) __false_ok = false;
   543 
   544     if (__true_ok || __false_ok) {
   545       __err = ios_base::goodbit;
   546       __x = __true_ok;
   547     }
   548     else
   549       __err = ios_base::failbit;
   550 
   551     if (__in_ite == __end)
   552       __err |= ios_base::eofbit;
   553 
   554     return __in_ite;
   555   }
   556 
   557   else {
   558     long __lx;
   559     _InputIter __tmp = this->do_get(__in_ite, __end, __s, __err, __lx);
   560     if (!(__err & ios_base::failbit)) {
   561       if (__lx == 0)
   562         __x = false;
   563       else if (__lx == 1)
   564         __x = true;
   565       else
   566         __err |= ios_base::failbit;
   567     }
   568     return __tmp;
   569   }
   570 }
   571 
   572 #endif /* _STLP_NO_BOOL */
   573 
   574 #if defined (_STLP_FIX_LIBRARY_ISSUES)
   575 template <class _CharT, class _InputIter>
   576 _InputIter
   577 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   578                                     ios_base::iostate& __err, short& __val) const
   579 { return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
   580 
   581 template <class _CharT, class _InputIter>
   582 _InputIter
   583 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   584                                     ios_base::iostate& __err, int& __val) const
   585 { return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
   586 
   587 #endif
   588 
   589 template <class _CharT, class _InputIter>
   590 _InputIter
   591 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   592                                     ios_base::iostate& __err, long& __val) const
   593 { return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
   594 
   595 template <class _CharT, class _InputIter>
   596 _InputIter
   597 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   598                                     ios_base::iostate& __err,
   599                                     unsigned short& __val) const
   600 { return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
   601 
   602 template <class _CharT, class _InputIter>
   603 _InputIter
   604 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   605                                     ios_base::iostate& __err,
   606                                     unsigned int& __val) const
   607 { return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
   608 
   609 template <class _CharT, class _InputIter>
   610 _InputIter
   611 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   612                                     ios_base::iostate& __err,
   613                                     unsigned long& __val) const
   614 { return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
   615 
   616 
   617 template <class _CharT, class _InputIter>
   618 _InputIter
   619 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   620                                     ios_base::iostate& __err,
   621                                     float& __val) const {
   622   _STLP_PRIV __iostring __buf ;
   623   bool __ok = _STLP_PRIV __read_float(__buf, __in_ite, __end, __str, (_CharT*)0 );
   624   _STLP_PRIV __string_to_float(__buf, __val);
   625   __err = __STATIC_CAST(ios_base::iostate, __ok ? ios_base::goodbit : ios_base::failbit);
   626   if (__in_ite == __end)
   627     __err |= ios_base::eofbit;
   628   return __in_ite;
   629 }
   630 
   631 template <class _CharT, class _InputIter>
   632 _InputIter
   633 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   634                                     ios_base::iostate& __err,
   635                                     double& __val) const {
   636   _STLP_PRIV __iostring __buf ;
   637   bool __ok = _STLP_PRIV __read_float(__buf, __in_ite, __end, __str, (_CharT*)0 );
   638 #ifdef SYMBIAN_OE_ENHANCED_LOCALE_SUPPORT
   639   if(__ok)
   640   {
   641 #endif
   642   _STLP_PRIV __string_to_float(__buf, __val);
   643 #ifdef SYMBIAN_OE_ENHANCED_LOCALE_SUPPORT
   644   }
   645 #endif
   646   __err = __STATIC_CAST(ios_base::iostate, __ok ? ios_base::goodbit : ios_base::failbit);
   647   if (__in_ite == __end)
   648     __err |= ios_base::eofbit;
   649   return __in_ite;
   650 }
   651 
   652 #if !defined (_STLP_NO_LONG_DOUBLE)
   653 template <class _CharT, class _InputIter>
   654 _InputIter
   655 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   656                                     ios_base::iostate& __err,
   657                                     long double& __val) const {
   658   _STLP_PRIV __iostring __buf ;
   659   bool __ok = _STLP_PRIV __read_float(__buf, __in_ite, __end, __str, (_CharT*)0 );
   660   _STLP_PRIV __string_to_float(__buf, __val);
   661   __err = __STATIC_CAST(ios_base::iostate, __ok ? ios_base::goodbit : ios_base::failbit);
   662   if (__in_ite == __end)
   663     __err |= ios_base::eofbit;
   664   return __in_ite;
   665 }
   666 #endif /* _STLP_NO_LONG_DOUBLE */
   667 
   668 template <class _CharT, class _InputIter>
   669 _InputIter
   670 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   671                            ios_base::iostate& __err,
   672                            void*& __p) const {
   673 #if defined (_STLP_LONG_LONG) && !defined (__MRC__)    //*ty 12/07/2001 - MrCpp can not cast from long long to void*
   674   unsigned _STLP_LONG_LONG __val;
   675 #else
   676   unsigned long __val;
   677 #endif
   678     iter_type __tmp = _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 );
   679     if (!(__err & ios_base::failbit))
   680       __p = __REINTERPRET_CAST(void*,__val);
   681     return __tmp;
   682   }
   683 
   684 #if defined (_STLP_LONG_LONG)
   685 template <class _CharT, class _InputIter>
   686 _InputIter
   687 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   688                                     ios_base::iostate& __err,
   689                                     _STLP_LONG_LONG& __val) const {
   690   return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 );
   691 }
   692 
   693 template <class _CharT, class _InputIter>
   694 _InputIter
   695 num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
   696                                     ios_base::iostate& __err,
   697                                     unsigned _STLP_LONG_LONG& __val) const {
   698   return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 );
   699 }
   700 #endif /* _STLP_LONG_LONG */
   701 
   702 _STLP_END_NAMESPACE
   703 
   704 #endif /* _STLP_NUMERIC_FACETS_C */
   705 
   706 // Local Variables:
   707 // mode:C++
   708 // End: