472 bool _Bad =
false, _Neg =
false;
477 static const char _Src[] = {
"0123456789-"};
480 _Ctype_fac.
widen(&_Src[0], &_Src[
sizeof (_Src) - 1], _Atoms);
482 for (
size_t _Off = 0; !_Bad && _Off < 4; ++_Off)
483 switch (_Pattern.
field[_Off])
491 && _First !=
_Last && *_First != *_Symbol.c_str())
493 else if (_Off == 3 && _Sign.size() <= 1
494 && (_First ==
_Last || *_First != *_Symbol.c_str()))
497 for (_Source = _Symbol.begin();
498 _First !=
_Last && _Source != _Symbol.end()
502 if (_Source != _Symbol.end())
510 else if (0 < (_Ppunct_fac->positive_sign()).size()
511 && _Ppunct_fac->positive_sign()[0] == *_First)
514 _Sign = _Ppunct_fac->positive_sign();
516 else if (0 < (_Ppunct_fac->negative_sign()).size()
517 && _Ppunct_fac->negative_sign()[0] == *_First)
520 _Sign = _Ppunct_fac->negative_sign();
523 else if (0 == (_Ppunct_fac->positive_sign()).size())
525 else if (0 == (_Ppunct_fac->negative_sign()).size())
531 int _Fracdigseen = 0;
532 int _Fracdigits = _Ppunct_fac->frac_digits();
533 const string _Grouping = _Ppunct_fac->grouping();
534 const _Elem _Kseparator = _Grouping.
size() == 0
535 ? (_Elem)0 : _Ppunct_fac->thousands_sep();
537 if (_Kseparator == (_Elem)0
539 for (; _First !=
_Last
545 string _Groups((
size_t)1,
'\0');
548 for (; _First !=
_Last; ++_First)
549 if ((_Idx =
_Find_elem(_Atoms, *_First)) < 10)
555 else if (_Groups[_Group] ==
'\0'
556 || *_First != _Kseparator)
560 _Groups.
append((
size_t)1,
'\0');
566 else if (
'\0' < _Groups[_Group])
571 for (
const char *_Pg = _Grouping.
c_str();
572 !_Bad && 0 < _Group; )
575 else if ((0 < --_Group && *_Pg != _Groups[_Group])
576 || (0 == _Group && *_Pg < _Groups[_Group]))
578 else if (
'\0' < _Pg[1])
584 const _Elem _Point = _Ppunct_fac->decimal_point();
586 && _Point != (_Elem)0
587 && *_First == _Point)
589 while (++_First !=
_Last
590 && _Fracdigseen < _Fracdigits
592 _Val += _Src[_Idx], ++_Fracdigseen;
594 if (_Fracdigseen < _Fracdigits)
598 if (_Val.
size() == 0)
601 for (; _Fracdigseen < _Fracdigits; ++_Fracdigseen)
614 for (; _First !=
_Last
622 if (!_Bad && 1 < _Sign.size())
626 for (_Source = _Sign.begin(); ++_Source != _Sign.end()
629 if (_Source != _Sign.end())
636 _Val.
insert((
size_t)0, (
size_t)1,
'-');
_Mybase::const_iterator const_iterator
Definition: xstring:714
moneypunct< _Elem, true > _Mypunct1
Definition: xlocmon:352
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
bool __CLR_OR_THIS_CALL is(mask _Maskval, _Elem _Ch) const
Definition: xlocale:2119
#define _USE(loc, fac)
Definition: xlocale:555
moneypunct< _Elem, false > _Mypunct0
Definition: xlocmon:351
_END_C_LIB_DECL _STD_BEGIN size_t _Find_elem(_Elem *_Base, _Elem _Ch)
Definition: xlocnum:54
_In_ size_t _In_z_ const char * _Source
Definition: tchar.h:2379
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
_In_ size_t _In_z_ const unsigned char * _Src
Definition: mbstring.h:95
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:365
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > string_type
Definition: xlocmon:358
iterator insert(const_iterator _Where, _XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:977
static const _Fmtflags showbase
Definition: xiosbase:59
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: xlocale:2162
char field[4]
Definition: xlocmon:27
_Myt & erase(size_type _Off=0)
Definition: xstring:1333
#define CHAR_MAX
Definition: limits.h:29
size_type size() const _NOEXCEPT
Definition: xstring:1752
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
_FwdIt const _Ty _Val
Definition: algorithm:1938
_FwdIt _Last
Definition: algorithm:1936