1.1 --- a/epoc32/include/stdapis/stlportv5/stl/_num_get.c Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_num_get.c Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,5 +1,6 @@
1.4 /*
1.5 - * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.6 + * Portions Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.7 + *
1.8 * Copyright (c) 1999
1.9 * Silicon Graphics Computer Systems, Inc.
1.10 *
1.11 @@ -20,124 +21,59 @@
1.12 #define _STLP_NUM_GET_C
1.13
1.14 #ifndef _STLP_INTERNAL_NUM_GET_H
1.15 -# include <stl/_num_get.h>
1.16 +# include <stl/_num_get.h>
1.17 #endif
1.18
1.19 -# if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
1.20 -
1.21 -#ifndef _STLP_LIMITS_H
1.22 -# include <stl/_limits.h>
1.23 +#ifndef _STLP_INTERNAL_LIMITS
1.24 +# include <stl/_limits.h>
1.25 #endif
1.26
1.27 -_STLP_DECLSPEC unsigned char* __get_digit_val_table(void);
1.28 -_STLP_DECLSPEC char* __get_narrow_atoms(void);
1.29 _STLP_BEGIN_NAMESPACE
1.30
1.31 -extern const unsigned char __digit_val_table[];
1.32 +_STLP_MOVE_TO_PRIV_NAMESPACE
1.33 +
1.34 +_STLP_DECLSPEC unsigned char _STLP_CALL __digit_val_table(unsigned);
1.35 +_STLP_DECLSPEC const char* _STLP_CALL __narrow_atoms();
1.36
1.37 template < class _InputIter, class _Integer, class _CharT>
1.38 _InputIter _STLP_CALL
1.39 -_M_do_get_integer(_InputIter&, _InputIter&, ios_base&, ios_base::iostate&, _Integer&, _CharT*);
1.40 +__do_get_integer(_InputIter&, _InputIter&, ios_base&, ios_base::iostate&, _Integer&, _CharT*);
1.41
1.42 -// _M_do_get_integer and its helper functions.
1.43 +// __do_get_integer and its helper functions.
1.44
1.45 -#ifdef __SYMBIAN32__
1.46 -template<class _CharT>
1.47 -inline bool _STLP_CALL __get_fdigit(_CharT& c, const _CharT* digits)
1.48 - {
1.49 +inline bool _STLP_CALL __get_fdigit(char __c, const char*)
1.50 +{ return __c >= '0' && __c <= '9'; }
1.51
1.52 - const _CharT* p = find(digits, digits + 10, c);
1.53 - if (p != digits + 10) {
1.54 - c = (_CharT)( (_CharT)'0' + (p - digits));
1.55 - return true;
1.56 - }
1.57 - else
1.58 - return false;
1.59 -}
1.60 -
1.61 -#endif
1.62 -inline bool _STLP_CALL __get_fdigit(char& __c, const char*)
1.63 - { return __c >= '0' && __c <= '9'; }
1.64 -
1.65 -inline bool _STLP_CALL __get_fdigit_or_sep(char& __c, char __sep, const char *)
1.66 -{
1.67 +inline bool _STLP_CALL __get_fdigit_or_sep(char& __c, char __sep, const char *__digits) {
1.68 if (__c == __sep) {
1.69 __c = ',' ;
1.70 return true ;
1.71 - } else
1.72 - return ( __c >= '0' && __c <= '9');
1.73 + }
1.74 + else
1.75 + return __get_fdigit(__c, __digits);
1.76 }
1.77
1.78 -# ifndef _STLP_NO_WCHAR_T
1.79 -
1.80 -// Similar, except return the character itself instead of the numeric
1.81 -// value. Used for floating-point input.
1.82 -inline bool _STLP_CALL __get_fdigit(wchar_t& c, const wchar_t* digits)
1.83 -{
1.84 - const wchar_t* p = find(digits, digits + 10, c);
1.85 - if (p != digits + 10) {
1.86 - c = (char)('0' + (p - digits));
1.87 - return true;
1.88 - }
1.89 - else
1.90 - return false;
1.91 -}
1.92 -
1.93 -inline bool _STLP_CALL __get_fdigit_or_sep(wchar_t& c, wchar_t sep,
1.94 - const wchar_t * digits)
1.95 -{
1.96 - if (c == sep) {
1.97 - c = (char)',';
1.98 - return true;
1.99 - }
1.100 - else
1.101 - return __get_fdigit(c, digits);
1.102 -}
1.103 -#ifdef __SYMBIAN32__
1.104 -template <class _CharT>
1.105 -inline bool _STLP_CALL __get_fdigit_or_sep(_CharT& c, _CharT sep,
1.106 - const _CharT * digits)
1.107 -{
1.108 - if (c == sep) {
1.109 - c = (_CharT)',';
1.110 - return true;
1.111 - }
1.112 - else
1.113 - return __get_fdigit(c, digits);
1.114 -}
1.115 -
1.116 -
1.117 -
1.118 -#endif
1.119 -#endif
1.120 inline int _STLP_CALL
1.121 __get_digit_from_table(unsigned __index)
1.122 -{
1.123 - return (__index > 127 ? 0xFF : __get_digit_val_table()[__index]);
1.124 -}
1.125 -
1.126 -extern const char __narrow_atoms[];
1.127 +{ return (__index > 127 ? 0xFF : __digit_val_table(__index)); }
1.128
1.129 template <class _InputIter, class _CharT>
1.130 int
1.131 -_M_get_base_or_zero(_InputIter& __stl_in, _InputIter& __end, ios_base& __str, _CharT*)
1.132 -{
1.133 +__get_base_or_zero(_InputIter& __in_ite, _InputIter& __end, ios_base& __str, _CharT*) {
1.134 _CharT __atoms[5];
1.135 - const ctype<_CharT>& __c_type = use_facet< ctype<_CharT> >(__str.getloc());
1.136 - // const ctype<_CharT>& __c_type = *(const ctype<_CharT>*)__str._M_ctype_facet();
1.137 + const ctype<_CharT>& __c_type = *__STATIC_CAST(const ctype<_CharT>*, __str._M_ctype_facet());
1.138
1.139 - __c_type.widen(__get_narrow_atoms(), __get_narrow_atoms() + 5, __atoms);
1.140 + __c_type.widen(__narrow_atoms(), __narrow_atoms() + 5, __atoms);
1.141
1.142 bool __negative = false;
1.143 - _CharT __c = *__stl_in;
1.144 + _CharT __c = *__in_ite;
1.145
1.146 if (__c == __atoms[1] /* __xminus_char */ ) {
1.147 __negative = true;
1.148 - ++__stl_in;
1.149 + ++__in_ite;
1.150 }
1.151 else if (__c == __atoms[0] /* __xplus_char */ )
1.152 - ++__stl_in;
1.153 -
1.154 + ++__in_ite;
1.155
1.156 int __base;
1.157 int __valid_zero = 0;
1.158 @@ -153,21 +89,21 @@
1.159 break;
1.160 case ios_base::hex:
1.161 __base = 16;
1.162 - if (__stl_in != __end && *__stl_in == __atoms[2] /* __zero_char */ ) {
1.163 - ++__stl_in;
1.164 - if (__stl_in != __end &&
1.165 - (*__stl_in == __atoms[3] /* __x_char */ || *__stl_in == __atoms[4] /* __X_char */ ))
1.166 - ++__stl_in;
1.167 + if (__in_ite != __end && *__in_ite == __atoms[2] /* __zero_char */ ) {
1.168 + ++__in_ite;
1.169 + if (__in_ite != __end &&
1.170 + (*__in_ite == __atoms[3] /* __x_char */ || *__in_ite == __atoms[4] /* __X_char */ ))
1.171 + ++__in_ite;
1.172 else
1.173 __valid_zero = 1; // That zero is valid by itself.
1.174 }
1.175 break;
1.176 default:
1.177 - if (__stl_in != __end && *__stl_in == __atoms[2] /* __zero_char */ ) {
1.178 - ++__stl_in;
1.179 - if (__stl_in != __end &&
1.180 - (*__stl_in == __atoms[3] /* __x_char */ || *__stl_in == __atoms[4] /* __X_char */ )) {
1.181 - ++__stl_in;
1.182 + if (__in_ite != __end && *__in_ite == __atoms[2] /* __zero_char */ ) {
1.183 + ++__in_ite;
1.184 + if (__in_ite != __end &&
1.185 + (*__in_ite == __atoms[3] /* __x_char */ || *__in_ite == __atoms[4] /* __X_char */ )) {
1.186 + ++__in_ite;
1.187 __base = 16;
1.188 }
1.189 else
1.190 @@ -184,39 +120,26 @@
1.191 }
1.192
1.193
1.194 -template <class _InputIter, class _Integer>
1.195 +template <class _InputIter, class _Integer, class _CharT>
1.196 bool _STLP_CALL
1.197 __get_integer(_InputIter& __first, _InputIter& __last,
1.198 - int __base, _Integer& __val,
1.199 - int __got, bool __is_negative, char __separator, const string& __grouping, const __true_type&)
1.200 -{
1.201 + int __base, _Integer& __val,
1.202 + int __got, bool __is_negative, _CharT __separator, const string& __grouping, const __true_type& /*_IsSigned*/) {
1.203 bool __ovflow = false;
1.204 - bool __valid_group = true;
1.205 -
1.206 _Integer __result = 0;
1.207 bool __is_group = !__grouping.empty();
1.208 -// char __group_sizes[64];
1.209 - char __group_sizes[256] = {0}; //group sizes can be more
1.210 -#ifdef __SYMBIAN32__
1.211 -int __current_group_size = __got;
1.212 -#else
1.213 - int __current_group_size = 0;
1.214 -#endif
1.215 + char __group_sizes[64];
1.216 + char __current_group_size = 0;
1.217 char* __group_sizes_end = __group_sizes;
1.218 - int prv_got = 0;
1.219 -
1.220 -
1.221 +
1.222 _Integer __over_base = (numeric_limits<_Integer>::min)() / __STATIC_CAST(_Integer, __base);
1.223
1.224 for ( ; __first != __last ; ++__first) {
1.225
1.226 - const char __c = *__first;
1.227 + const _CharT __c = *__first;
1.228
1.229 if (__is_group && __c == __separator) {
1.230 - if (prv_got == __got) //no successive seperators
1.231 - return false;
1.232 - prv_got = __got;
1.233 - *__group_sizes_end++ = __current_group_size;
1.234 + *__group_sizes_end++ = __current_group_size;
1.235 __current_group_size = 0;
1.236 continue;
1.237 }
1.238 @@ -224,7 +147,7 @@
1.239 int __n = __get_digit_from_table(__c);
1.240
1.241 if (__n >= __base)
1.242 - break;
1.243 + break;
1.244
1.245 ++__got;
1.246 ++__current_group_size;
1.247 @@ -234,85 +157,57 @@
1.248 else {
1.249 _Integer __next = __STATIC_CAST(_Integer, __base * __result - __n);
1.250 if (__result != 0)
1.251 -#ifdef __SYMBIAN32__
1.252 - if (__is_negative)
1.253 - __ovflow = __ovflow || __next >= __result;
1.254 - else
1.255 - __ovflow = __ovflow || (__next-1) >= __result; //For signed char, the ranges are -128 to 127,
1.256 -#else
1.257 - __ovflow = __ovflow || __next >= __result;
1.258 -#endif
1.259 + __ovflow = __ovflow || __next >= __result;
1.260 __result = __next;
1.261 }
1.262 }
1.263
1.264 if (__is_group && __group_sizes_end != __group_sizes) {
1.265 *__group_sizes_end++ = __current_group_size;
1.266 -
1.267 }
1.268
1.269 // fbp : added to not modify value if nothing was read
1.270 if (__got > 0) {
1.271 - __val = __ovflow
1.272 - ? __is_negative ? (numeric_limits<_Integer>::min)()
1.273 - : (numeric_limits<_Integer>::max)()
1.274 - : (__is_negative ? __result : __STATIC_CAST(_Integer, -__result));
1.275 + __val = __ovflow ? __is_negative ? (numeric_limits<_Integer>::min)()
1.276 + : (numeric_limits<_Integer>::max)()
1.277 + : __is_negative ? __result
1.278 + : __STATIC_CAST(_Integer, -__result);
1.279 }
1.280 - __valid_group = __valid_grouping(__group_sizes, __group_sizes_end,
1.281 - __grouping.data(), __grouping.data()+ __grouping.size());
1.282 -
1.283 - if (__valid_group == false)
1.284 - __val = 0;
1.285 -
1.286 // overflow is being treated as failure
1.287 - return ((__got > 0) && !__ovflow) && (__is_group == 0 || __valid_group) ;
1.288 + return ((__got > 0) && !__ovflow) &&
1.289 + (__is_group == 0 ||
1.290 + __valid_grouping(__group_sizes, __group_sizes_end,
1.291 + __grouping.data(), __grouping.data()+ __grouping.size()));
1.292 }
1.293
1.294 -template <class _InputIter, class _Integer>
1.295 +template <class _InputIter, class _Integer, class _CharT>
1.296 bool _STLP_CALL
1.297 __get_integer(_InputIter& __first, _InputIter& __last,
1.298 - int __base, _Integer& __val,
1.299 - int __got, bool __is_negative, char __separator, const string& __grouping, const __false_type&)
1.300 -{
1.301 + int __base, _Integer& __val,
1.302 + int __got, bool __is_negative, _CharT __separator, const string& __grouping, const __false_type& /*_IsSigned*/) {
1.303 bool __ovflow = false;
1.304 - bool __valid_group = true;
1.305 _Integer __result = 0;
1.306 bool __is_group = !__grouping.empty();
1.307 -// char __group_sizes[64];
1.308 - char __group_sizes[256] = {0};//group sizes can be more
1.309 - int __current_group_size = 0;
1.310 + char __group_sizes[64];
1.311 + char __current_group_size = 0;
1.312 char* __group_sizes_end = __group_sizes;
1.313 - int prv_got = 0;
1.314
1.315 -
1.316 _Integer __over_base = (numeric_limits<_Integer>::max)() / __STATIC_CAST(_Integer, __base);
1.317
1.318 for ( ; __first != __last ; ++__first) {
1.319
1.320 - const char __c = *__first;
1.321 -/*
1.322 - //if (__is_group && __c == __separator) { //no seperator at the start of number.
1.323 - if (__is_group && __c == __separator && __got) {
1.324 - // seperator should come after extracting some digits
1.325 - if (!__current_group_size)
1.326 - break;
1.327 - *__group_sizes_end++ = __current_group_size;
1.328 + const _CharT __c = *__first;
1.329 +
1.330 + if (__is_group && __c == __separator) {
1.331 + *__group_sizes_end++ = __current_group_size;
1.332 __current_group_size = 0;
1.333 continue;
1.334 }
1.335 -*/
1.336 - if (__is_group && __c == __separator) {
1.337 - if (prv_got == __got) //no successive seperators
1.338 - return false;
1.339 - prv_got = __got;
1.340 - *__group_sizes_end++ = __current_group_size;
1.341 - __current_group_size = 0;
1.342 - continue;
1.343 - }
1.344 +
1.345 int __n = __get_digit_from_table(__c);
1.346
1.347 if (__n >= __base)
1.348 - break;
1.349 + break;
1.350
1.351 ++__got;
1.352 ++__current_group_size;
1.353 @@ -321,66 +216,58 @@
1.354 __ovflow = true; //don't need to keep accumulating
1.355 else {
1.356 _Integer __next = __STATIC_CAST(_Integer, __base * __result + __n);
1.357 - if (__result != 0)
1.358 - __ovflow = __ovflow || __next <= __result;
1.359 - __result = __next;
1.360 + if (__result != 0)
1.361 + __ovflow = __ovflow || __next <= __result;
1.362 + __result = __next;
1.363 }
1.364 }
1.365
1.366 if (__is_group && __group_sizes_end != __group_sizes) {
1.367 - *__group_sizes_end++ = __current_group_size;
1.368 + *__group_sizes_end++ = __current_group_size;
1.369 }
1.370
1.371 // fbp : added to not modify value if nothing was read
1.372 if (__got > 0) {
1.373 - __val = __ovflow
1.374 - ? (numeric_limits<_Integer>::max)()
1.375 - : (__is_negative ? __STATIC_CAST(_Integer, -__result) : __result);
1.376 + __val = __ovflow ? (numeric_limits<_Integer>::max)()
1.377 + : (__is_negative ? __STATIC_CAST(_Integer, -__result)
1.378 + : __result);
1.379 }
1.380 - __valid_group = __valid_grouping(__group_sizes, __group_sizes_end,
1.381 - __grouping.data(), __grouping.data()+ __grouping.size());
1.382 -
1.383 - if (__valid_group == false)
1.384 - __val = 0;
1.385
1.386 // overflow is being treated as failure
1.387 return ((__got > 0) && !__ovflow) &&
1.388 - (__is_group == 0 ||__valid_group) ;
1.389 + (__is_group == 0 ||
1.390 + __valid_grouping(__group_sizes, __group_sizes_end,
1.391 + __grouping.data(), __grouping.data()+ __grouping.size()));
1.392 }
1.393
1.394
1.395 -template <class _InputIter, class _Integer>
1.396 +template <class _InputIter, class _Integer, class _CharT>
1.397 bool _STLP_CALL
1.398 -__get_decimal_integer(_InputIter& __first, _InputIter& __last, _Integer& __val)
1.399 -{
1.400 +__get_decimal_integer(_InputIter& __first, _InputIter& __last, _Integer& __val, _CharT* /*dummy*/) {
1.401 string __grp;
1.402 - return __get_integer(__first, __last, 10, __val, 0, false, ' ', __grp, __false_type());
1.403 + //Here there is no grouping so separator is not important, we just pass the default charater.
1.404 + return __get_integer(__first, __last, 10, __val, 0, false, _CharT() /*separator*/, __grp, __false_type());
1.405 }
1.406
1.407 template <class _InputIter, class _Integer, class _CharT>
1.408 _InputIter _STLP_CALL
1.409 -_M_do_get_integer(_InputIter& __stl_in, _InputIter& __end, ios_base& __str,
1.410 - ios_base::iostate& __err, _Integer& __val, _CharT* __pc)
1.411 -{
1.412 -
1.413 -#if defined(__HP_aCC) && (__HP_aCC == 1)
1.414 +__do_get_integer(_InputIter& __in_ite, _InputIter& __end, ios_base& __str,
1.415 + ios_base::iostate& __err, _Integer& __val, _CharT* __pc) {
1.416 +#if defined (__HP_aCC) && (__HP_aCC == 1)
1.417 bool _IsSigned = !((_Integer)(-1) > 0);
1.418 #else
1.419 typedef typename __bool2type<numeric_limits<_Integer>::is_signed>::_Ret _IsSigned;
1.420 #endif
1.421
1.422 - //const numpunct<_CharT>& __numpunct = *(const numpunct<_CharT>*)__str._M_numpunct_facet();
1.423 - const numpunct<_CharT>& __numpunct = use_facet< numpunct<_CharT> >(__str.getloc());
1.424 -// const string& __grouping = __str._M_grouping(); // cached copy //stdcxx fix - 11/1/06
1.425 - const string& __grouping = __numpunct.grouping();
1.426 + const numpunct<_CharT>& __numpunct = *__STATIC_CAST(const numpunct<_CharT>*, __str._M_numpunct_facet());
1.427 + const string& __grouping = __str._M_grouping(); // cached copy
1.428
1.429 -
1.430 - const int __base_or_zero = _M_get_base_or_zero(__stl_in, __end, __str, __pc);
1.431 + const int __base_or_zero = __get_base_or_zero(__in_ite, __end, __str, __pc);
1.432 int __got = __base_or_zero & 1;
1.433
1.434 bool __result;
1.435
1.436 - if (__stl_in == __end) { // We may have already read a 0. If so,
1.437 + if (__in_ite == __end) { // We may have already read a 0. If so,
1.438
1.439 if (__got > 0) { // the result is 0 even if we're at eof.
1.440 __val = 0;
1.441 @@ -388,41 +275,34 @@
1.442 }
1.443 else
1.444 __result = false;
1.445 - } else {
1.446 -
1.447 - const bool __negative = __base_or_zero & 2;
1.448 + }
1.449 + else {
1.450 + const bool __negative = (__base_or_zero & 2) != 0;
1.451 const int __base = __base_or_zero >> 2;
1.452
1.453 -#if defined(__HP_aCC) && (__HP_aCC == 1)
1.454 - if (_IsSigned)
1.455 - __result = __get_integer(__stl_in, __end, __base, __val, __got, __negative, __numpunct.thousands_sep(), __grouping, __true_type() );
1.456 - else
1.457 - __result = __get_integer(__stl_in, __end, __base, __val, __got, __negative, __numpunct.thousands_sep(), __grouping, __false_type() );
1.458 +#if defined (__HP_aCC) && (__HP_aCC == 1)
1.459 + if (_IsSigned)
1.460 + __result = __get_integer(__in_ite, __end, __base, __val, __got, __negative, __numpunct.thousands_sep(), __grouping, __true_type() );
1.461 + else
1.462 + __result = __get_integer(__in_ite, __end, __base, __val, __got, __negative, __numpunct.thousands_sep(), __grouping, __false_type() );
1.463 #else
1.464 -#ifdef __SYMBIAN32__
1.465 - _Integer __tval;
1.466 - __result = __get_integer(__stl_in, __end, __base, __tval, __got, __negative, __numpunct.thousands_sep(), __grouping, _IsSigned());
1.467 - if(__result)
1.468 - __val = __tval;
1.469 -#else
1.470 - __result = __get_integer(__stl_in, __end, __base, __val, __got, __negative, __numpunct.thousands_sep(), __grouping, _IsSigned());
1.471 -#endif
1.472 + __result = __get_integer(__in_ite, __end, __base, __val, __got, __negative, __numpunct.thousands_sep(), __grouping, _IsSigned());
1.473 # endif
1.474 }
1.475
1.476 __err = __STATIC_CAST(ios_base::iostate, __result ? ios_base::goodbit : ios_base::failbit);
1.477
1.478 - if (__stl_in == __end)
1.479 + if (__in_ite == __end)
1.480 __err |= ios_base::eofbit;
1.481 - return __stl_in;
1.482 + return __in_ite;
1.483 }
1.484
1.485 -// _M_read_float and its helper functions.
1.486 +// __read_float and its helper functions.
1.487 template <class _InputIter, class _CharT>
1.488 _InputIter _STLP_CALL
1.489 -__copy_sign(_InputIter __first, _InputIter __last, string& __v,
1.490 +__copy_sign(_InputIter __first, _InputIter __last, __iostring& __v,
1.491 _CharT __xplus, _CharT __xminus) {
1.492 - if (__first != __last) {
1.493 + if (__first != __last) {
1.494 _CharT __c = *__first;
1.495 if (__c == __xplus)
1.496 ++__first;
1.497 @@ -437,9 +317,8 @@
1.498
1.499 template <class _InputIter, class _CharT>
1.500 bool _STLP_CALL
1.501 -__copy_digits(_InputIter& __first, _InputIter& __last,
1.502 - string& __v, const _CharT* __digits)
1.503 -{
1.504 +__copy_digits(_InputIter& __first, _InputIter __last,
1.505 + __iostring& __v, const _CharT* __digits) {
1.506 bool __ok = false;
1.507
1.508 for ( ; __first != __last; ++__first) {
1.509 @@ -456,14 +335,12 @@
1.510
1.511 template <class _InputIter, class _CharT>
1.512 bool _STLP_CALL
1.513 -__copy_grouped_digits(_InputIter& __first, _InputIter& __last,
1.514 - string& __v, const _CharT * __digits,
1.515 - _CharT __sep, const string& __grouping,
1.516 - bool& __grouping_ok)
1.517 -{
1.518 +__copy_grouped_digits(_InputIter& __first, _InputIter __last,
1.519 + __iostring& __v, const _CharT * __digits,
1.520 + _CharT __sep, const string& __grouping,
1.521 + bool& __grouping_ok) {
1.522 bool __ok = false;
1.523 -// char __group_sizes[64];
1.524 - char __group_sizes[256] = {0};//group sizes can be more
1.525 + char __group_sizes[64];
1.526 char*__group_sizes_end = __group_sizes;
1.527 char __current_group_size = 0;
1.528
1.529 @@ -471,12 +348,8 @@
1.530 _CharT __c = *__first;
1.531 bool __tmp = __get_fdigit_or_sep(__c, __sep, __digits);
1.532 if (__tmp) {
1.533 - if (__c == ',') {
1.534 - // seperator should come after extracting some digits
1.535 - if (!__current_group_size)
1.536 - break;
1.537 -
1.538 - *__group_sizes_end++ = __current_group_size;
1.539 + if (__c == ',') {
1.540 + *__group_sizes_end++ = __current_group_size;
1.541 __current_group_size = 0;
1.542 }
1.543 else {
1.544 @@ -490,17 +363,15 @@
1.545 }
1.546
1.547 if (__group_sizes_end != __group_sizes)
1.548 - *__group_sizes_end++ = __current_group_size;
1.549 + *__group_sizes_end++ = __current_group_size;
1.550 __grouping_ok = __valid_grouping(__group_sizes, __group_sizes_end, __grouping.data(), __grouping.data() + __grouping.size());
1.551 - __ok = __ok & __grouping_ok; //Added, to check for valid grouping. If not valid grouping should return false.
1.552 return __ok;
1.553 }
1.554
1.555
1.556 template <class _InputIter, class _CharT>
1.557 bool _STLP_CALL
1.558 -_M_read_float(string& __buf, _InputIter& __stl_in, _InputIter& __end, ios_base& __s, _CharT*)
1.559 -{
1.560 +__read_float(__iostring& __buf, _InputIter& __in_ite, _InputIter& __end, ios_base& __s, _CharT*) {
1.561 // Create a string, copying characters of the form
1.562 // [+-]? [0-9]* .? [0-9]* ([eE] [+-]? [0-9]+)?
1.563
1.564 @@ -510,12 +381,9 @@
1.565
1.566 bool __grouping_ok = true;
1.567
1.568 - const ctype<_CharT>& __ct = use_facet< ctype<_CharT> >(__s.getloc());
1.569 - // const ctype<_CharT>& __ct = *(const ctype<_CharT>*)__s._M_ctype_facet();
1.570 - //const numpunct<_CharT>& __numpunct = *(const numpunct<_CharT>*)__s._M_numpunct_facet();
1.571 - const numpunct<_CharT>& __numpunct = use_facet< numpunct<_CharT> >(__s.getloc());
1.572 -// const string& __grouping = __s._M_grouping(); // cached copy //stdcxx fix - 11/1/06
1.573 - const string& __grouping = __numpunct.grouping();
1.574 + const ctype<_CharT>& __ct = *__STATIC_CAST(const ctype<_CharT>*, __s._M_ctype_facet());
1.575 + const numpunct<_CharT>& __numpunct = *__STATIC_CAST(const numpunct<_CharT>*, __s._M_numpunct_facet());
1.576 + const string& __grouping = __s._M_grouping(); // cached copy
1.577
1.578 _CharT __dot = __numpunct.decimal_point();
1.579 _CharT __sep = __numpunct.thousands_sep();
1.580 @@ -530,31 +398,31 @@
1.581 _Initialize_get_float(__ct, __xplus, __xminus, __pow_e, __pow_E, __digits);
1.582
1.583 // Get an optional sign
1.584 - __stl_in = __copy_sign(__stl_in, __end, __buf, __xplus, __xminus);
1.585 + __in_ite = __copy_sign(__in_ite, __end, __buf, __xplus, __xminus);
1.586
1.587 // Get an optional string of digits.
1.588 - if (__grouping.size() != 0)
1.589 - __digits_before_dot = __copy_grouped_digits(__stl_in, __end, __buf, __digits,
1.590 - __sep, __grouping, __grouping_ok);
1.591 + if (!__grouping.empty())
1.592 + __digits_before_dot = __copy_grouped_digits(__in_ite, __end, __buf, __digits,
1.593 + __sep, __grouping, __grouping_ok);
1.594 else
1.595 - __digits_before_dot = __copy_digits(__stl_in, __end, __buf, __digits);
1.596 + __digits_before_dot = __copy_digits(__in_ite, __end, __buf, __digits);
1.597
1.598 // Get an optional decimal point, and an optional string of digits.
1.599 - if (__stl_in != __end && *__stl_in == __dot) {
1.600 + if (__in_ite != __end && *__in_ite == __dot) {
1.601 __buf.push_back('.');
1.602 - ++__stl_in;
1.603 - __digits_after_dot = __copy_digits(__stl_in, __end, __buf, __digits);
1.604 + ++__in_ite;
1.605 + __digits_after_dot = __copy_digits(__in_ite, __end, __buf, __digits);
1.606 }
1.607
1.608 // There have to be some digits, somewhere.
1.609 __ok = __digits_before_dot || __digits_after_dot;
1.610
1.611 // Get an optional exponent.
1.612 - if (__ok && __stl_in != __end && (*__stl_in == __pow_e || *__stl_in == __pow_E)) {
1.613 + if (__ok && __in_ite != __end && (*__in_ite == __pow_e || *__in_ite == __pow_E)) {
1.614 __buf.push_back('e');
1.615 - ++__stl_in;
1.616 - __stl_in = __copy_sign(__stl_in, __end, __buf, __xplus, __xminus);
1.617 - __ok = __copy_digits(__stl_in, __end, __buf, __digits);
1.618 + ++__in_ite;
1.619 + __in_ite = __copy_sign(__in_ite, __end, __buf, __xplus, __xminus);
1.620 + __ok = __copy_digits(__in_ite, __end, __buf, __digits);
1.621 // If we have an exponent then the sign
1.622 // is optional but the digits aren't.
1.623 }
1.624 @@ -562,50 +430,93 @@
1.625 return __ok;
1.626 }
1.627
1.628 +_STLP_MOVE_TO_STD_NAMESPACE
1.629 +
1.630 //
1.631 // num_get<>, num_put<>
1.632 //
1.633
1.634 -# if ( _STLP_STATIC_TEMPLATE_DATA > 0 )
1.635 -# if !defined(__LIBSTD_CPP_SYMBIAN32_WSD__) && !defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
1.636 +#if ( _STLP_STATIC_TEMPLATE_DATA > 0 )
1.637 +# if !defined(__SYMBIAN32__WSD__)
1.638 +# if !defined (__BORLANDC__) && (defined (__SYMBIAN32__) && defined(_STLP_DESIGNATED_DLL))
1.639 template <class _CharT, class _InputIterator>
1.640 locale::id num_get<_CharT, _InputIterator>::id;
1.641 -#endif
1.642 -# else
1.643 +# endif
1.644
1.645 -typedef num_get<char, const char*> num_get_char;
1.646 +# if ((defined (__CYGWIN__) || defined (__MINGW32__)) && \
1.647 + defined (_STLP_USE_DYNAMIC_LIB) && !defined (__BUILDING_STLPORT)) || (defined (__SYMBIAN32__) && defined(_STLP_DESIGNATED_DLL))
1.648 +/*
1.649 + * Under cygwin, when STLport is used as a shared library, the id needs
1.650 + * to be specified as imported otherwise they will be duplicated in the
1.651 + * calling executable.
1.652 + */
1.653 +# if defined(__SYMBIAN32__)
1.654 +template <>
1.655 +locale::id num_get<char, istreambuf_iterator<char, char_traits<char> > >::id; //data should not exported in symbian
1.656 +/*
1.657 +template <>
1.658 +_STLP_DECLSPEC locale::id num_get<char, const char*>::id;
1.659 +*/
1.660 +
1.661 +# if !defined (STLP_NO_WCHAR_T)
1.662 +template <>
1.663 +locale::id num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id;
1.664 +/*
1.665 +template <>
1.666 +_STLP_DECLSPEC locale::id num_get<wchar_t, const wchar_t*>::id;
1.667 +*/
1.668 +# endif//STLP_NO_WCHAR_T
1.669 +# else
1.670 +template <>
1.671 +_STLP_DECLSPEC locale::id num_get<char, istreambuf_iterator<char, char_traits<char> > >::id;
1.672 +/*
1.673 +template <>
1.674 +_STLP_DECLSPEC locale::id num_get<char, const char*>::id;
1.675 +*/
1.676 +
1.677 +# if !defined (STLP_NO_WCHAR_T)
1.678 +template <>
1.679 +_STLP_DECLSPEC locale::id num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id;
1.680 +/*
1.681 +template <>
1.682 +_STLP_DECLSPEC locale::id num_get<wchar_t, const wchar_t*>::id;
1.683 +*/
1.684 +# endif
1.685 +# endif//__SYMBIAN32__
1.686 +
1.687 +# endif /* __CYGWIN__ && _STLP_USE_DYNAMIC_LIB */
1.688 +#endif //__SYMBIAN32__WSD__
1.689 +
1.690 +#else /* ( _STLP_STATIC_TEMPLATE_DATA > 0 ) */
1.691 +
1.692 +//typedef num_get<char, const char*> num_get_char;
1.693 typedef num_get<char, istreambuf_iterator<char, char_traits<char> > > num_get_char_2;
1.694
1.695 -#ifndef __SYMBIAN32__
1.696 -__DECLARE_INSTANCE(locale::id, num_get_char::id, );
1.697 +//__DECLARE_INSTANCE(locale::id, num_get_char::id, );
1.698 __DECLARE_INSTANCE(locale::id, num_get_char_2::id, );
1.699 -#endif
1.700
1.701 -# ifndef _STLP_NO_WCHAR_T
1.702 +# if !defined (_STLP_NO_WCHAR_T)
1.703
1.704 -typedef num_get<wchar_t, const wchar_t*> num_get_wchar_t;
1.705 +//typedef num_get<wchar_t, const wchar_t*> num_get_wchar_t;
1.706 typedef num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > > num_get_wchar_t_2;
1.707
1.708 -#ifndef __SYMBIAN32__
1.709 -__DECLARE_INSTANCE(locale::id, num_get_wchar_t::id, );
1.710 +//__DECLARE_INSTANCE(locale::id, num_get_wchar_t::id, );
1.711 __DECLARE_INSTANCE(locale::id, num_get_wchar_t_2::id, );
1.712 -#endif
1.713
1.714 -# endif
1.715 +# endif
1.716
1.717 -# endif /* ( _STLP_STATIC_TEMPLATE_DATA > 0 ) */
1.718 +#endif /* ( _STLP_STATIC_TEMPLATE_DATA > 0 ) */
1.719
1.720 -# ifndef _STLP_NO_BOOL
1.721 +#if !defined (_STLP_NO_BOOL)
1.722 template <class _CharT, class _InputIter>
1.723 _InputIter
1.724 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end,
1.725 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end,
1.726 ios_base& __s,
1.727 - ios_base::iostate& __err, bool& __x) const
1.728 -{
1.729 + ios_base::iostate& __err, bool& __x) const {
1.730 if (__s.flags() & ios_base::boolalpha) {
1.731 locale __loc = __s.getloc();
1.732 - //const _Numpunct& __np = *(const _Numpunct*)__s._M_numpunct_facet();
1.733 - const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc) ;
1.734 + const _Numpunct& __np = *__STATIC_CAST(const _Numpunct*, __s._M_numpunct_facet());
1.735 + // const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc) ;
1.736 // const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc) ;
1.737
1.738 const basic_string<_CharT> __truename = __np.truename();
1.739 @@ -614,8 +525,8 @@
1.740 bool __false_ok = true;
1.741
1.742 size_t __n = 0;
1.743 - for ( ; __stl_in != __end; ++__stl_in) {
1.744 - _CharT __c = *__stl_in;
1.745 + for ( ; __in_ite != __end; ++__in_ite) {
1.746 + _CharT __c = *__in_ite;
1.747 __true_ok = __true_ok && (__c == __truename[__n]);
1.748 __false_ok = __false_ok && (__c == __falsename[__n]);
1.749 ++__n;
1.750 @@ -623,48 +534,12 @@
1.751 if ((!__true_ok && !__false_ok) ||
1.752 (__true_ok && __n >= __truename.size()) ||
1.753 (__false_ok && __n >= __falsename.size())) {
1.754 -
1.755 - if (__true_ok || __false_ok) //if anything OK then increment, else, break
1.756 - ++__stl_in;
1.757 + ++__in_ite;
1.758 break;
1.759 }
1.760 }
1.761 - // stdcxx fix, Changed to check for complete true,false string
1.762 - if (__true_ok && __n < __truename.size())
1.763 - {
1.764 - for ( ; __stl_in != __end; ++__stl_in) {
1.765 - _CharT __c = *__stl_in;
1.766 - __true_ok = __true_ok && (__c == __truename[__n]);
1.767 - ++__n;
1.768 - if ((!__true_ok) ||(__true_ok && __n >= __truename.size()) )
1.769 - {
1.770 - if(__true_ok)
1.771 - ++__stl_in;
1.772 - break;
1.773 - }
1.774 -
1.775 - }
1.776 - if (__true_ok && __n < __truename.size())
1.777 - __true_ok = false;
1.778 - }
1.779 - if (__false_ok && __n < __falsename.size())
1.780 - {
1.781 -
1.782 - for ( ; __stl_in != __end; ++__stl_in) {
1.783 - _CharT __c = *__stl_in;
1.784 - __false_ok = __false_ok && (__c == __falsename[__n]);
1.785 - ++__n;
1.786 - if ((!__false_ok) ||(__false_ok && __n >= __falsename.size()) )
1.787 - {
1.788 - if(__false_ok)
1.789 - ++__stl_in;
1.790 - break;
1.791 - }
1.792 -
1.793 - }
1.794 - if (__false_ok && __n < __falsename.size())
1.795 - __false_ok = false;
1.796 - }
1.797 + if (__true_ok && __n < __truename.size()) __true_ok = false;
1.798 + if (__false_ok && __n < __falsename.size()) __false_ok = false;
1.799
1.800 if (__true_ok || __false_ok) {
1.801 __err = ios_base::goodbit;
1.802 @@ -673,15 +548,15 @@
1.803 else
1.804 __err = ios_base::failbit;
1.805
1.806 - if (__stl_in == __end)
1.807 + if (__in_ite == __end)
1.808 __err |= ios_base::eofbit;
1.809
1.810 - return __stl_in;
1.811 + return __in_ite;
1.812 }
1.813
1.814 else {
1.815 long __lx;
1.816 - _InputIter __tmp = this->do_get(__stl_in, __end, __s, __err, __lx);
1.817 + _InputIter __tmp = this->do_get(__in_ite, __end, __s, __err, __lx);
1.818 if (!(__err & ios_base::failbit)) {
1.819 if (__lx == 0)
1.820 __x = false;
1.821 @@ -694,187 +569,138 @@
1.822 }
1.823 }
1.824
1.825 -# endif /* _STLP_NO_BOOL */
1.826 +#endif /* _STLP_NO_BOOL */
1.827
1.828 -//# ifdef _STLP_FIX_LIBRARY_ISSUES
1.829 +#if defined (_STLP_FIX_LIBRARY_ISSUES)
1.830 template <class _CharT, class _InputIter>
1.831 _InputIter
1.832 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.833 - ios_base::iostate& __err, short& __val) const {
1.834 - return _M_do_get_integer(__stl_in, __end, __str, __err, __val, (_CharT*)0 );
1.835 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.836 + ios_base::iostate& __err, short& __val) const
1.837 +{ return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
1.838 +
1.839 +template <class _CharT, class _InputIter>
1.840 +_InputIter
1.841 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.842 + ios_base::iostate& __err, int& __val) const
1.843 +{ return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
1.844 +
1.845 +#endif
1.846 +
1.847 +template <class _CharT, class _InputIter>
1.848 +_InputIter
1.849 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.850 + ios_base::iostate& __err, long& __val) const
1.851 +{ return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
1.852 +
1.853 +template <class _CharT, class _InputIter>
1.854 +_InputIter
1.855 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.856 + ios_base::iostate& __err,
1.857 + unsigned short& __val) const
1.858 +{ return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
1.859 +
1.860 +template <class _CharT, class _InputIter>
1.861 +_InputIter
1.862 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.863 + ios_base::iostate& __err,
1.864 + unsigned int& __val) const
1.865 +{ return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
1.866 +
1.867 +template <class _CharT, class _InputIter>
1.868 +_InputIter
1.869 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.870 + ios_base::iostate& __err,
1.871 + unsigned long& __val) const
1.872 +{ return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); }
1.873 +
1.874 +
1.875 +template <class _CharT, class _InputIter>
1.876 +_InputIter
1.877 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.878 + ios_base::iostate& __err,
1.879 + float& __val) const {
1.880 + _STLP_PRIV __iostring __buf ;
1.881 + bool __ok = _STLP_PRIV __read_float(__buf, __in_ite, __end, __str, (_CharT*)0 );
1.882 + _STLP_PRIV __string_to_float(__buf, __val);
1.883 + __err = __STATIC_CAST(ios_base::iostate, __ok ? ios_base::goodbit : ios_base::failbit);
1.884 + if (__in_ite == __end)
1.885 + __err |= ios_base::eofbit;
1.886 + return __in_ite;
1.887 }
1.888
1.889 template <class _CharT, class _InputIter>
1.890 _InputIter
1.891 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.892 - ios_base::iostate& __err, int& __val) const {
1.893 - return _M_do_get_integer(__stl_in, __end, __str, __err, __val, (_CharT*)0 );
1.894 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.895 + ios_base::iostate& __err,
1.896 + double& __val) const {
1.897 + _STLP_PRIV __iostring __buf ;
1.898 + bool __ok = _STLP_PRIV __read_float(__buf, __in_ite, __end, __str, (_CharT*)0 );
1.899 +#ifdef SYMBIAN_OE_ENHANCED_LOCALE_SUPPORT
1.900 + if(__ok)
1.901 + {
1.902 +#endif
1.903 + _STLP_PRIV __string_to_float(__buf, __val);
1.904 +#ifdef SYMBIAN_OE_ENHANCED_LOCALE_SUPPORT
1.905 + }
1.906 +#endif
1.907 + __err = __STATIC_CAST(ios_base::iostate, __ok ? ios_base::goodbit : ios_base::failbit);
1.908 + if (__in_ite == __end)
1.909 + __err |= ios_base::eofbit;
1.910 + return __in_ite;
1.911 }
1.912
1.913 -//# endif
1.914 -
1.915 +#if !defined (_STLP_NO_LONG_DOUBLE)
1.916 template <class _CharT, class _InputIter>
1.917 _InputIter
1.918 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.919 - ios_base::iostate& __err, long& __val) const {
1.920 - return _M_do_get_integer(__stl_in, __end, __str, __err, __val, (_CharT*)0 );
1.921 -}
1.922 -
1.923 -template <class _CharT, class _InputIter>
1.924 -_InputIter
1.925 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.926 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.927 ios_base::iostate& __err,
1.928 - unsigned short& __val) const {
1.929 - return _M_do_get_integer(__stl_in, __end, __str, __err, __val, (_CharT*)0 );
1.930 -}
1.931 -
1.932 -template <class _CharT, class _InputIter>
1.933 -_InputIter
1.934 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.935 - ios_base::iostate& __err,
1.936 - unsigned int& __val) const {
1.937 - return _M_do_get_integer(__stl_in, __end, __str, __err, __val, (_CharT*)0 );
1.938 -}
1.939 -
1.940 -template <class _CharT, class _InputIter>
1.941 -_InputIter
1.942 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.943 - ios_base::iostate& __err,
1.944 - unsigned long& __val) const {
1.945 - return _M_do_get_integer(__stl_in, __end, __str, __err, __val, (_CharT*)0 );
1.946 -}
1.947 -
1.948 -
1.949 -template <class _CharT, class _InputIter>
1.950 -_InputIter
1.951 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.952 - ios_base::iostate& __err,
1.953 - float& __val) const {
1.954 - string __buf ;
1.955 - bool __ok = _M_read_float(__buf, __stl_in, __end, __str, (_CharT*)0 );
1.956 - if(__ok) //If success reading float then convert it.
1.957 - {
1.958 -#ifdef __SYMBIAN32__
1.959 - float __tval;
1.960 - __ok = __string_to_float(__buf, __tval);
1.961 - if(__ok)
1.962 - __val = __tval;
1.963 -#else
1.964 - __string_to_float(__buf, __val);
1.965 -#endif
1.966 - }
1.967 + long double& __val) const {
1.968 + _STLP_PRIV __iostring __buf ;
1.969 + bool __ok = _STLP_PRIV __read_float(__buf, __in_ite, __end, __str, (_CharT*)0 );
1.970 + _STLP_PRIV __string_to_float(__buf, __val);
1.971 __err = __STATIC_CAST(ios_base::iostate, __ok ? ios_base::goodbit : ios_base::failbit);
1.972 - if (__stl_in == __end)
1.973 + if (__in_ite == __end)
1.974 __err |= ios_base::eofbit;
1.975 - return __stl_in;
1.976 -}
1.977 -
1.978 -template <class _CharT, class _InputIter>
1.979 -_InputIter
1.980 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.981 - ios_base::iostate& __err,
1.982 - double& __val) const {
1.983 - string __buf ;
1.984 - bool __ok = _M_read_float(__buf, __stl_in, __end, __str, (_CharT*)0 );
1.985 - if(__ok) //If success reading float then convert it.
1.986 - {
1.987 -#ifdef __SYMBIAN32__
1.988 - double __tval;
1.989 - __ok = __string_to_float(__buf, __tval);
1.990 - if(__ok)
1.991 - __val = __tval;
1.992 -#else
1.993 - __string_to_float(__buf, __val);
1.994 -#endif
1.995 - }
1.996 - __err = __STATIC_CAST(ios_base::iostate, __ok ? ios_base::goodbit : ios_base::failbit);
1.997 - if (__stl_in == __end)
1.998 - __err |= ios_base::eofbit;
1.999 - return __stl_in;
1.1000 -}
1.1001 -
1.1002 -#ifndef _STLP_NO_LONG_DOUBLE
1.1003 -template <class _CharT, class _InputIter>
1.1004 -_InputIter
1.1005 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.1006 - ios_base::iostate& __err,
1.1007 - long double& __val) const {
1.1008 - string __buf ;
1.1009 - bool __ok = _M_read_float(__buf, __stl_in, __end, __str, (_CharT*)0 );
1.1010 - if(__ok) //If success reading float then convert it.
1.1011 - {
1.1012 -#ifdef __SYMBIAN32__
1.1013 - long double __tval;
1.1014 - __ok = __string_to_float(__buf, __tval);
1.1015 - if(__ok)
1.1016 - __val = __tval;
1.1017 -#else
1.1018 - __string_to_float(__buf, __val);
1.1019 -#endif
1.1020 - }
1.1021 - __err = __STATIC_CAST(ios_base::iostate, __ok ? ios_base::goodbit : ios_base::failbit);
1.1022 - if (__stl_in == __end)
1.1023 - __err |= ios_base::eofbit;
1.1024 - return __stl_in;
1.1025 + return __in_ite;
1.1026 }
1.1027 #endif /* _STLP_NO_LONG_DOUBLE */
1.1028
1.1029 template <class _CharT, class _InputIter>
1.1030 _InputIter
1.1031 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.1032 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.1033 ios_base::iostate& __err,
1.1034 void*& __p) const {
1.1035 -#ifdef __SYMBIAN32__
1.1036 - unsigned long __val; //using only long
1.1037 +#if defined (_STLP_LONG_LONG) && !defined (__MRC__) //*ty 12/07/2001 - MrCpp can not cast from long long to void*
1.1038 + unsigned _STLP_LONG_LONG __val;
1.1039 #else
1.1040 -# if defined(_STLP_LONG_LONG)&&!defined(__MRC__) //*ty 12/07/2001 - MrCpp can not cast from long long to void*
1.1041 - unsigned _STLP_LONG_LONG __val;
1.1042 -# else
1.1043 unsigned long __val;
1.1044 -# endif
1.1045 -#endif //__SYMBIAN32__
1.1046 -#ifdef __SYMBIAN32__
1.1047 - ios_base::fmtflags __save_flags = __str.flags();
1.1048 -
1.1049 - __str.setf(ios_base::hex, ios_base::basefield);
1.1050 - __str.setf(ios_base::showbase);
1.1051 - __str.setf(ios_base::internal, ios_base::adjustfield);
1.1052 - __str.width((sizeof(void*) * 2) + 2);
1.1053 -#endif // __SYMBIAN32__
1.1054 - iter_type __tmp = _M_do_get_integer(__stl_in, __end, __str, __err, __val, (_CharT*)0 );
1.1055 +#endif
1.1056 + iter_type __tmp = _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 );
1.1057 if (!(__err & ios_base::failbit))
1.1058 - __p = __REINTERPRET_CAST(void*,(long)__val);
1.1059 -#ifdef __SYMBIAN32__
1.1060 - __str.flags(__save_flags);
1.1061 -#endif //__SYMBIAN32__
1.1062 + __p = __REINTERPRET_CAST(void*,__val);
1.1063 return __tmp;
1.1064 }
1.1065
1.1066 -
1.1067 -#ifdef _STLP_LONG_LONG
1.1068 -
1.1069 +#if defined (_STLP_LONG_LONG)
1.1070 template <class _CharT, class _InputIter>
1.1071 _InputIter
1.1072 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.1073 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.1074 ios_base::iostate& __err,
1.1075 _STLP_LONG_LONG& __val) const {
1.1076 - return _M_do_get_integer(__stl_in, __end, __str, __err, __val, (_CharT*)0 );
1.1077 + return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 );
1.1078 }
1.1079
1.1080 template <class _CharT, class _InputIter>
1.1081 _InputIter
1.1082 -num_get<_CharT, _InputIter>::do_get(_InputIter __stl_in, _InputIter __end, ios_base& __str,
1.1083 +num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str,
1.1084 ios_base::iostate& __err,
1.1085 unsigned _STLP_LONG_LONG& __val) const {
1.1086 - return _M_do_get_integer(__stl_in, __end, __str, __err, __val, (_CharT*)0 );
1.1087 + return _STLP_PRIV __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 );
1.1088 }
1.1089 -
1.1090 #endif /* _STLP_LONG_LONG */
1.1091
1.1092 _STLP_END_NAMESPACE
1.1093
1.1094 -# endif /* _STLP_EXPOSE_STREAM_IMPLEMENTATION */
1.1095 -
1.1096 #endif /* _STLP_NUMERIC_FACETS_C */
1.1097
1.1098 // Local Variables: