STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | List of all members
num_get< _Elem, _InIt > Class Template Reference
Inheritance diagram for num_get< _Elem, _InIt >:
locale::facet _Facet_base _Crt_new_delete

Public Types

typedef numpunct< _Elem > _Mypunct
 
typedef basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > _Mystr
 
typedef _Elem char_type
 
typedef _InIt iter_type
 

Public Member Functions

__CLR_OR_THIS_CALL num_get (size_t _Refs=0)
 
__CLR_OR_THIS_CALL num_get (const _Locinfo &_Lobj, size_t _Refs=0)
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, unsigned short &_Val) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, unsigned int &_Val) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, long &_Val) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, unsigned long &_Val) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, _LONGLONG &_Val) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, _ULONGLONG &_Val) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, float &_Val) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, double &_Val) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, long double &_Val) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, void *&_Val) const
 
- Public Member Functions inherited from locale::facet
virtual void __CLR_OR_THIS_CALL _Incref ()
 
virtual _Facet_base *__CLR_OR_THIS_CALL _Decref ()
 
__CLR_OR_THIS_CALL facet (const facet &)=delete
 
facet &__CLR_OR_THIS_CALL operator= (const facet &)=delete
 
- Public Member Functions inherited from _Facet_base
virtual __CLR_OR_THIS_CALL ~_Facet_base () _NOEXCEPT
 

Static Public Member Functions

static size_t __CLRCALL_OR_CDECL _Getcat (const locale::facet **_Ppf=0, const locale *_Ploc=0)
 
- Static Public Member Functions inherited from locale::facet
static size_t __CLRCALL_OR_CDECL _Getcat (const facet **=0, const locale *=0)
 

Static Public Attributes

static __PURE_APPDOMAIN_GLOBAL locale::id id
 

Protected Member Functions

virtual __CLR_OR_THIS_CALL ~num_get () _NOEXCEPT
 
void _Init (const _Locinfo &)
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, unsigned short &_Val) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, unsigned int &_Val) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, long &_Val) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, unsigned long &_Val) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, _LONGLONG &_Val) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, _ULONGLONG &_Val) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, float &_Val) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, double &_Val) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, long double &_Val) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, void *&_Val) const
 
- Protected Member Functions inherited from locale::facet
__CLR_OR_THIS_CALL facet (size_t _Initrefs=0)
 
virtual __CLR_OR_THIS_CALL ~facet () _NOEXCEPT
 

Private Member Functions

int __CLRCALL_OR_CDECL _Getifld (char *_Ac, _InIt &_First, _InIt &_Last, ios_base::fmtflags _Basefield, const locale &_Loc) const
 
int __CLRCALL_OR_CDECL _Getffld (char *_Ac, _InIt &_First, _InIt &_Last, ios_base &_Iosbase, int *_Phexexp) const
 
int __CLRCALL_OR_CDECL _Getffldx (char *_Ac, _InIt &_First, _InIt &_Last, ios_base &_Iosbase, int *_Phexexp) const
 

Member Typedef Documentation

template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef numpunct<_Elem> num_get< _Elem, _InIt >::_Mypunct
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef basic_string<_Elem, char_traits<_Elem>, allocator<_Elem> > num_get< _Elem, _InIt >::_Mystr
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef _Elem num_get< _Elem, _InIt >::char_type
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef _InIt num_get< _Elem, _InIt >::iter_type

Constructor & Destructor Documentation

template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::~num_get ( )
inlineprotectedvirtual
320  { // destroy the object
321  }
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
__CLR_OR_THIS_CALL num_get< _Elem, _InIt >::num_get ( size_t  _Refs = 0)
inlineexplicit
329  : locale::facet(_Refs)
330  { // construct from current locale
331  _BEGIN_LOCINFO(_Lobj)
332  _Init(_Lobj);
333  _END_LOCINFO()
334  }
Definition: xlocale:138
void _Init(const _Locinfo &)
Definition: xlocnum:323
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
__CLR_OR_THIS_CALL num_get< _Elem, _InIt >::num_get ( const _Locinfo _Lobj,
size_t  _Refs = 0 
)
inline
337  : locale::facet(_Refs)
338  { // construct from specified locale
339  _Init(_Lobj);
340  }
Definition: xlocale:138
void _Init(const _Locinfo &)
Definition: xlocnum:323

Member Function Documentation

template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
static size_t __CLRCALL_OR_CDECL num_get< _Elem, _InIt >::_Getcat ( const locale::facet **  _Ppf = 0,
const locale _Ploc = 0 
)
inlinestatic
309  { // return locale category mask and construct standard facet
310  if (_Ppf != 0 && *_Ppf == 0)
311  *_Ppf = new num_get<_Elem, _InIt>(
312  _Locinfo(_Ploc->c_str()));
313  return (_X_NUMERIC);
314  }
Definition: xlocinfo:54
const char * c_str() const
Definition: xlocale:452
#define _X_NUMERIC
Definition: xlocinfo.h:41
Definition: xlocnum:299
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
int __CLRCALL_OR_CDECL num_get< _Elem, _InIt >::_Getffld ( char *  _Ac,
_InIt &  _First,
_InIt &  _Last,
ios_base _Iosbase,
int *  _Phexexp 
) const
inlineprivate
792  { // get floating-point field from [_First, _Last) into _Ac
793  if ((_Iosbase.flags() & ios_base::floatfield) == ios_base::hexfloat)
794  return (_Getffldx(_Ac, _First, _Last,
795  _Iosbase, _Phexexp)); // hex format
796 
797  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
798  const string _Grouping = _Punct_fac.grouping();
799  char *_Ptr = _Ac;
800  bool _Bad = false;
801  bool _Sticky = false;
802 
803  enum {
804  _NUMGET_SIGNOFF = 10,
805  _NUMGET_EOFF = 12};
806  static const char _Src[] = {"0123456789-+Ee"}; // TRANSITION, VSO#202551
807  _Elem _Atoms[sizeof (_Src)];
808  const ctype<_Elem>& _Ctype_fac =
809  _USE(_Iosbase.getloc(), ctype<_Elem>);
810  _Ctype_fac.widen(&_Src[0], &_Src[sizeof (_Src)], _Atoms);
811 
812  if (_First == _Last)
813  ; // empty field
814  else if (*_First == _Atoms[_NUMGET_SIGNOFF + 1])
815  *_Ptr++ = '+', ++_First; // gather plus sign
816  else if (*_First == _Atoms[_NUMGET_SIGNOFF])
817  *_Ptr++ = '-', ++_First; // gather minus sign
818 
819  char *_Leading = _Ptr; // remember backstop
820  *_Ptr++ = '0'; // backstop carries from sticky bit
821 
822  bool _Seendigit = false; // seen a digit in input
823  int _Significant = 0; // number of significant digits
824  int _Pten = 0; // power of 10 multiplier
825  size_t _Idx;
826 
827  const int _Max_sig_dig = (*_Phexexp == _ENABLE_V2_BEHAVIOR ? _MAX_SIG_DIG_V2 : _MAX_SIG_DIG_V1);
828 
829  const char *_Pg = &_Grouping[0];
830  if (*_Pg == CHAR_MAX || *_Pg <= '\0')
831  for (; _First != _Last
832  && (_Idx = _Find_elem(_Atoms, *_First)) < 10;
833  _Seendigit = true, ++_First)
834  if (_Max_sig_dig <= _Significant)
835  { // enough digits, scale by 10 and update _Sticky
836  ++_Pten;
837  if (0 < _Idx)
838  _Sticky = true;
839  }
840  else if (_Idx == 0 && _Significant == 0)
841  ; // drop leading zeros
842  else
843  { // save a significant digit
844  *_Ptr++ = _Src[_Idx];
845  ++_Significant;
846  }
847  else
848  { // grouping specified, gather digits and group sizes
849  const _Elem _Kseparator = _Grouping.size() == 0
850  ? (_Elem)0 : _Punct_fac.thousands_sep();
851  string _Groups((size_t)1, '\0');
852  size_t _Group = 0;
853 
854  for (; _First != _Last; ++_First)
855  if ((_Idx = _Find_elem(_Atoms, *_First)) < 10)
856  { // got a digit, add to group size
857  _Seendigit = true;
858  if (_Max_sig_dig <= _Significant)
859  { // enough digits, scale by 10 and update _Sticky
860  ++_Pten;
861  if (0 < _Idx)
862  _Sticky = true;
863  }
864  else if (_Idx == 0 && _Significant == 0)
865  ; // drop leading zeros
866  else
867  { // save a significant digit
868  *_Ptr++ = _Src[_Idx];
869  ++_Significant;
870  }
871  if (_Groups[_Group] != CHAR_MAX)
872  ++_Groups[_Group];
873  }
874  else if (_Groups[_Group] == '\0'
875  || _Kseparator == (_Elem)0
876  || *_First != _Kseparator)
877  break; // not a group separator, done
878  else
879  { // add a new group to _Groups string
880  _Groups.append((size_t)1, '\0');
881  ++_Group;
882  }
883  if (_Group == 0)
884  ; // no thousands separators seen
885  else if ('\0' < _Groups[_Group])
886  ++_Group; // add trailing group to group count
887  else
888  _Bad = true; // trailing separator, fail
889 
890  while (!_Bad && 0 < _Group)
891  if (*_Pg == CHAR_MAX)
892  break; // end of grouping constraints to check
893  else if ((0 < --_Group && *_Pg != _Groups[_Group])
894  || (0 == _Group && *_Pg < _Groups[_Group]))
895  _Bad = true; // bad group size, fail
896  else if ('\0' < _Pg[1])
897  ++_Pg; // group size okay, advance to next test
898  }
899 
900  if (_First != _Last && *_First == _Punct_fac.decimal_point())
901  *_Ptr++ = localeconv()->decimal_point[0], ++_First; // add .
902 
903  if (*_Phexexp != _ENABLE_V2_BEHAVIOR && _Significant == 0)
904  { // 0000. so far
905  for (; _First != _Last && *_First == _Atoms[0];
906  _Seendigit = true, ++_First)
907  --_Pten; // just count leading fraction zeros
908  if (_Pten < 0)
909  *_Ptr++ = '0', ++_Pten; // put one back
910  }
911 
912  for (; _First != _Last
913  && (_Idx = _Find_elem(_Atoms, *_First)) < 10;
914  _Seendigit = true, ++_First)
915  if (_Significant < _Max_sig_dig)
916  { // save a significant fraction digit
917  *_Ptr++ = _Src[_Idx];
918  ++_Significant;
919  }
920  else if (0 < _Idx)
921  _Sticky = true; // just update _Sticky
922 
923  if (_Sticky)
924  { // increment ls digit in memory of those lost
925  char *_Px = _Ptr;
926  for (; --_Px != _Leading; )
927  { // add in carry
928  if (*_Px == localeconv()->decimal_point[0])
929  ; // skip over decimal point
930  else if (*_Px != '9')
931  { // carry stops here
932  ++*_Px;
933  break;
934  }
935  else
936  *_Px = '0'; // propagate carry
937  }
938 
939  if (_Px == _Leading)
940  { // change "999..." to "1000..." and scale _Pten
941  *_Px = '1';
942  ++_Pten;
943  }
944  }
945 
946  if (_Seendigit && _First != _Last
947  && (*_First == _Atoms[_NUMGET_EOFF + 1]
948  || *_First == _Atoms[_NUMGET_EOFF]))
949  { // 'e' or 'E', collect exponent
950  *_Ptr++ = 'e', ++_First;
951  _Seendigit = false, _Significant = 0;
952 
953  if (_First == _Last)
954  ; // 'e' or 'E' is last element
955  else if (*_First == _Atoms[_NUMGET_SIGNOFF + 1])
956  *_Ptr++ = '+', ++_First; // gather plus sign
957  else if (*_First == _Atoms[_NUMGET_SIGNOFF])
958  *_Ptr++ = '-', ++_First; // gather minus sign
959  for (; _First != _Last && *_First == _Atoms[0]; )
960  _Seendigit = true, ++_First; // strip leading zeros
961  if (_Seendigit)
962  *_Ptr++ = '0'; // put one back
963  for (; _First != _Last
964  && (_Idx = _Find_elem(_Atoms, *_First)) < 10;
965  _Seendigit = true, ++_First)
966  if (_Significant < _MAX_EXP_DIG)
967  { // save a significant exponent digit
968  *_Ptr++ = _Src[_Idx];
969  ++_Significant;
970  }
971  }
972 
973  if (_Bad || !_Seendigit)
974  _Ptr = _Ac; // roll back pointer to indicate failure
975  *_Ptr = '\0';
976  return (_Pten);
977  }
#define _MAX_SIG_DIG_V2
Definition: yvals.h:590
#define _USE(loc, fac)
Definition: xlocale:547
#define _MAX_EXP_DIG
Definition: yvals.h:587
numpunct< _Elem > _Mypunct
Definition: xlocnum:303
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
Definition: xlocale:2115
#define _ENABLE_V2_BEHAVIOR
Definition: xlocnum:586
size_t _Find_elem(_Elem *_Base, _Elem _Ch)
Definition: xlocnum:89
#define _MAX_SIG_DIG_V1
Definition: yvals.h:589
static constexpr _Fmtflags floatfield
Definition: xiosbase:80
int __CLRCALL_OR_CDECL _Getffldx(char *_Ac, _InIt &_First, _InIt &_Last, ios_base &_Iosbase, int *_Phexexp) const
Definition: xlocnum:979
static constexpr _Fmtflags hexfloat
Definition: xiosbase:71
#define CHAR_MAX
Definition: limits.h:24
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
int __CLRCALL_OR_CDECL num_get< _Elem, _InIt >::_Getffldx ( char *  _Ac,
_InIt &  _First,
_InIt &  _Last,
ios_base _Iosbase,
int *  _Phexexp 
) const
inlineprivate
982  { // get hex floating-point field from [_First, _Last) into _Ac
983  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
984  const string _Grouping = _Punct_fac.grouping();
985 
986  enum {
987  _NUMGET_SIGNOFF = 22,
988  _NUMGET_XOFF = 24,
989  _NUMGET_POFF = 26};
990  static const char _Src[] = {"0123456789ABCDEFabcdef-+XxPp"}; // TRANSITION, VSO#202551
991  _Elem _Atoms[sizeof (_Src)];
992  const ctype<_Elem>& _Ctype_fac =
993  _USE(_Iosbase.getloc(), ctype<_Elem>);
994  _Ctype_fac.widen(&_Src[0], &_Src[sizeof (_Src)], _Atoms);
995 
996  char *_Ptr = _Ac;
997  bool _Bad = false;
998  size_t _Idx;
999 
1000  if (_First == _Last)
1001  ; // empty field
1002  else if (*_First == _Atoms[_NUMGET_SIGNOFF + 1])
1003  *_Ptr++ = '+', ++_First; // gather plus sign
1004  else if (*_First == _Atoms[_NUMGET_SIGNOFF])
1005  *_Ptr++ = '-', ++_First; // gather minus sign
1006 
1007  *_Ptr++ = '0';
1008  *_Ptr++ = 'x';
1009 
1010  bool _Seendigit = false; // seen a digit in input
1011  int _Significant = 0; // number of significant digits
1012  int _Phex = 0; // power of 10 multiplier
1013 
1014  if (_First == _Last || *_First != _Atoms[0])
1015  ;
1016  else if (++_First != _Last
1017  && (*_First == _Atoms[_NUMGET_XOFF + 1]
1018  || *_First == _Atoms[_NUMGET_XOFF]))
1019  ++_First; // discard any 0x or 0X
1020  else
1021  _Seendigit = true; // '0' not followed by 'x' or 'X'
1022 
1023  const int _Max_sig_dig = (*_Phexexp == _ENABLE_V2_BEHAVIOR ? _MAX_SIG_DIG_V2 : _MAX_SIG_DIG_V1);
1024 
1025  const char *_Pg = &_Grouping[0];
1026  if (*_Pg == CHAR_MAX || *_Pg <= '\0')
1027  for (; _First != _Last
1028  && (_Idx = _Find_elem(_Atoms, *_First)) < _NUMGET_SIGNOFF;
1029  _Seendigit = true, ++_First)
1030  if (_Max_sig_dig <= _Significant)
1031  ++_Phex; // just scale by 10
1032  else if (_Idx == 0 && _Significant == 0)
1033  ; // drop leading zeros
1034  else
1035  { // save a significant digit
1036  *_Ptr++ = _Src[_Idx];
1037  ++_Significant;
1038  }
1039  else
1040  { // grouping specified, gather digits and group sizes
1041  const _Elem _Kseparator = _Grouping.size() == 0
1042  ? (_Elem)0 : _Punct_fac.thousands_sep();
1043  string _Groups((size_t)1, '\0');
1044  size_t _Group = 0;
1045 
1046  for (; _First != _Last; ++_First)
1047  if ((_Idx = _Find_elem(_Atoms, *_First)) < _NUMGET_SIGNOFF)
1048  { // got a digit, add to group size
1049  _Seendigit = true;
1050  if (_Max_sig_dig <= _Significant)
1051  ++_Phex; // just scale by 10
1052  else if (_Idx == 0 && _Significant == 0)
1053  ; // drop leading zeros
1054  else
1055  { // save a significant digit
1056  *_Ptr++ = _Src[_Idx];
1057  ++_Significant;
1058  }
1059  if (_Groups[_Group] != CHAR_MAX)
1060  ++_Groups[_Group];
1061  }
1062  else if (_Groups[_Group] == '\0'
1063  || _Kseparator == (_Elem)0
1064  || *_First != _Kseparator)
1065  break; // not a group separator, done
1066  else
1067  { // add a new group to _Groups string
1068  _Groups.append((size_t)1, '\0');
1069  ++_Group;
1070  }
1071  if (_Group == 0)
1072  ; // no thousands separators seen
1073  else if ('\0' < _Groups[_Group])
1074  ++_Group; // add trailing group to group count
1075  else
1076  _Bad = true; // trailing separator, fail
1077 
1078  while (!_Bad && 0 < _Group)
1079  if (*_Pg == CHAR_MAX)
1080  break; // end of grouping constraints to check
1081  else if ((0 < --_Group && *_Pg != _Groups[_Group])
1082  || (0 == _Group && *_Pg < _Groups[_Group]))
1083  _Bad = true; // bad group size, fail
1084  else if ('\0' < _Pg[1])
1085  ++_Pg; // group size okay, advance to next test
1086  }
1087 
1088  if (_Seendigit && _Significant == 0)
1089  *_Ptr++ = '0'; // save at least one leading digit
1090 
1091  if (_First != _Last && *_First == _Punct_fac.decimal_point())
1092  *_Ptr++ = localeconv()->decimal_point[0], ++_First; // add .
1093 
1094  if (_Significant == 0)
1095  { // 0000. so far
1096  for (; _First != _Last && *_First == _Atoms[0];
1097  _Seendigit = true, ++_First)
1098  --_Phex; // just count leading fraction zeros
1099  if (_Phex < 0)
1100  *_Ptr++ = '0', ++_Phex; // put one back
1101  }
1102 
1103  for (; _First != _Last
1104  && (_Idx = _Find_elem(_Atoms, *_First)) < _NUMGET_SIGNOFF;
1105  _Seendigit = true, ++_First)
1106  if (_Significant < _Max_sig_dig)
1107  { // save a significant fraction digit
1108  *_Ptr++ = _Src[_Idx];
1109  ++_Significant;
1110  }
1111 
1112  if (_Seendigit && _First != _Last
1113  && (*_First == _Atoms[_NUMGET_POFF + 1]
1114  || *_First == _Atoms[_NUMGET_POFF]))
1115  { // 'p' or 'P', collect exponent
1116  *_Ptr++ = 'p', ++_First;
1117  _Seendigit = false, _Significant = 0;
1118 
1119  if (_First == _Last)
1120  ; // 'p' or 'P' is last element
1121  else if (*_First == _Atoms[_NUMGET_SIGNOFF + 1])
1122  *_Ptr++ = '+', ++_First; // gather plus sign
1123  else if (*_First == _Atoms[_NUMGET_SIGNOFF])
1124  *_Ptr++ = '-', ++_First; // gather minus sign
1125  for (; _First != _Last && *_First == _Atoms[0]; )
1126  _Seendigit = true, ++_First; // strip leading zeros
1127  if (_Seendigit)
1128  *_Ptr++ = '0'; // put one back
1129  for (; _First != _Last
1130  && (_Idx = _Find_elem(_Atoms, *_First)) < _NUMGET_SIGNOFF;
1131  _Seendigit = true, ++_First)
1132  if (_Significant < _MAX_EXP_DIG)
1133  { // save a significant exponent digit
1134  *_Ptr++ = _Src[_Idx];
1135  ++_Significant;
1136  }
1137  }
1138 
1139  if (_Bad || !_Seendigit)
1140  _Ptr = _Ac; // roll back pointer to indicate failure
1141  *_Ptr = '\0';
1142  *_Phexexp = _Phex; // power of 16 multiplier
1143  return (0); // power of 10 multiplier
1144  }
#define _MAX_SIG_DIG_V2
Definition: yvals.h:590
#define _USE(loc, fac)
Definition: xlocale:547
#define _MAX_EXP_DIG
Definition: yvals.h:587
numpunct< _Elem > _Mypunct
Definition: xlocnum:303
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
Definition: xlocale:2115
#define _ENABLE_V2_BEHAVIOR
Definition: xlocnum:586
size_t _Find_elem(_Elem *_Base, _Elem _Ch)
Definition: xlocnum:89
#define _MAX_SIG_DIG_V1
Definition: yvals.h:589
#define CHAR_MAX
Definition: limits.h:24
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
int __CLRCALL_OR_CDECL num_get< _Elem, _InIt >::_Getifld ( char *  _Ac,
_InIt &  _First,
_InIt &  _Last,
ios_base::fmtflags  _Basefield,
const locale _Loc 
) const
inlineprivate
693  { // get integer field from [_First, _Last) into _Ac
694  const _Mypunct& _Punct_fac = _USE(_Loc, _Mypunct);
695  const string _Grouping = _Punct_fac.grouping();
696  const _Elem _Kseparator = _Grouping.size() == 0
697  ? (_Elem)0 : _Punct_fac.thousands_sep();
698 
699  enum {
700  _NUMGET_SIGNOFF = 22,
701  _NUMGET_XOFF = 24};
702  static const char _Src[] = {"0123456789ABCDEFabcdef-+Xx"}; // TRANSITION, VSO#202551
703  _Elem _Atoms[sizeof (_Src)];
704  const ctype<_Elem>& _Ctype_fac =
705  _USE(_Loc, ctype<_Elem>);
706  _Ctype_fac.widen(&_Src[0], &_Src[sizeof (_Src)], _Atoms);
707 
708  char *_Ptr = _Ac;
709 
710  if (_First == _Last)
711  ; // empty field
712  else if (*_First == _Atoms[_NUMGET_SIGNOFF + 1])
713  *_Ptr++ = '+', ++_First; // gather plus sign
714  else if (*_First == _Atoms[_NUMGET_SIGNOFF])
715  *_Ptr++ = '-', ++_First; // gather minus sign
716 
717  _Basefield &= ios_base::basefield;
718  int _Base = _Basefield == ios_base::oct ? 8
719  : _Basefield == ios_base::hex ? 16
720  : _Basefield == ios_base::_Fmtzero ? 0 : 10;
721 
722  bool _Seendigit = false; // seen a digit in input
723  bool _Nonzero = false; // seen a nonzero digit in input
724 
725  if (_First != _Last && *_First == _Atoms[0])
726  { // leading zero, look for 0x, 0X
727  _Seendigit = true, ++_First;
728  if (_First != _Last && (*_First == _Atoms[_NUMGET_XOFF + 1]
729  || *_First == _Atoms[_NUMGET_XOFF])
730  && (_Base == 0 || _Base == 16))
731  _Base = 16, _Seendigit = false, ++_First;
732  else if (_Base == 0)
733  _Base = 8;
734  }
735 
736  size_t _Dlen = _Base == 0 || _Base == 10 ? 10
737  : _Base == 8 ? 8 : 16 + 6;
738  string _Groups((size_t)1, (char)_Seendigit);
739  size_t _Group = 0;
740 
741  for (char *const _Pe = &_Ac[_MAX_INT_DIG - 1];
742  _First != _Last; ++_First)
743  { // look for digits and separators
744  size_t _Idx = _Find_elem(_Atoms, *_First);
745  if (_Idx < _Dlen)
746  { // got a digit, characterize it and add to group size
747  *_Ptr = _Src[_Idx];
748  if ((_Nonzero || *_Ptr != '0') && _Ptr < _Pe)
749  ++_Ptr, _Nonzero = true;
750  _Seendigit = true;
751  if (_Groups[_Group] != CHAR_MAX)
752  ++_Groups[_Group];
753  }
754  else if (_Groups[_Group] == '\0'
755  || _Kseparator == (_Elem)0
756  || *_First != _Kseparator)
757  break; // not a group separator, done
758  else
759  { // add a new group to _Groups string
760  _Groups.append((string::size_type)1, '\0');
761  ++_Group;
762  }
763  }
764 
765  if (_Group == 0)
766  ; // no thousands separators seen
767  else if ('\0' < _Groups[_Group])
768  ++_Group; // add trailing group to group count
769  else
770  _Seendigit = false; // trailing separator, fail
771 
772  for (const char *_Pg = &_Grouping[0]; _Seendigit && 0 < _Group; )
773  if (*_Pg == CHAR_MAX)
774  break; // end of grouping constraints to check
775  else if ((0 < --_Group && *_Pg != _Groups[_Group])
776  || (0 == _Group && *_Pg < _Groups[_Group]))
777  _Seendigit = false; // bad group size, fail
778  else if ('\0' < _Pg[1])
779  ++_Pg; // group size okay, advance to next test
780 
781  if (_Seendigit && !_Nonzero)
782  *_Ptr++ = '0'; // zero field, replace stripped zero(s)
783  else if (!_Seendigit)
784  _Ptr = _Ac; // roll back pointer to indicate failure
785  *_Ptr = '\0';
786  return (_Base);
787  }
static constexpr _Fmtflags hex
Definition: xiosbase:67
static constexpr _Fmtflags basefield
Definition: xiosbase:78
#define _USE(loc, fac)
Definition: xlocale:547
static constexpr _Fmtflags oct
Definition: xiosbase:66
numpunct< _Elem > _Mypunct
Definition: xlocnum:303
Definition: xiosbase:54
Definition: xlocale:2115
size_t _Find_elem(_Elem *_Base, _Elem _Ch)
Definition: xlocnum:89
#define _MAX_INT_DIG
Definition: yvals.h:588
#define CHAR_MAX
Definition: limits.h:24
size_type size() const _NOEXCEPT
Definition: xstring:1763
_Mybase::size_type size_type
Definition: xstring:762
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
void num_get< _Elem, _InIt >::_Init ( const _Locinfo )
inlineprotected
324  { // initialize from _Locinfo object
325  }
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
bool _Val 
) const
inlineprotectedvirtual
426  { // get bool from [_First, _Last) into _Val
427  _DEBUG_RANGE(_First, _Last);
428  int _Ans = -1; // negative answer indicates failure
429 
430  if (_Iosbase.flags() & ios_base::boolalpha)
431  { // get false name or true name
432  typedef typename _Mystr::size_type _Mystrsize;
433  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
434  _Mystr _Str((_Mystrsize)1, (char_type)0);
435  _Str += _Punct_fac.falsename();
436  _Str += (char_type)0;
437  _Str += _Punct_fac.truename(); // construct "\0false\0true"
438  _Ans = _Getloctxt(_First, _Last, (size_t)2, _Str.c_str());
439  }
440  else
441  { // get zero or nonzero integer
442  char _Ac[_MAX_INT_DIG], *_Ep;
443  int _Errno = 0;
444  const unsigned long _Ulo = _CSTD _Stoulx(_Ac, &_Ep,
445  _Getifld(_Ac, _First, _Last, _Iosbase.flags(),
446  _Iosbase.getloc()), &_Errno);
447  if (_Ep != _Ac && _Errno == 0 && _Ulo <= 1)
448  _Ans = _Ulo;
449  }
450 
451  if (_First == _Last)
452  _State |= ios_base::eofbit;
453  if (_Ans < 0)
454  _State |= ios_base::failbit;
455  else
456  _Val = _Ans != 0; // deliver value
457  return (_First);
458  }
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > _Mystr
Definition: xlocnum:305
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx(const char *, _Out_opt_ _Deref_post_opt_valid_ char **, int, int *)
#define _USE(loc, fac)
Definition: xlocale:547
_In_ int _Val
Definition: vcruntime_string.h:62
numpunct< _Elem > _Mypunct
Definition: xlocnum:303
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
int __CLRCALL_OR_CDECL _Getifld(char *_Ac, _InIt &_First, _InIt &_Last, ios_base::fmtflags _Basefield, const locale &_Loc) const
Definition: xlocnum:690
_Elem char_type
Definition: xlocnum:342
#define _MAX_INT_DIG
Definition: yvals.h:588
static constexpr _Fmtflags boolalpha
Definition: xiosbase:74
_Mybase::size_type size_type
Definition: xstring:762
#define _CSTD
Definition: yvals.h:570
_FwdIt _Last
Definition: algorithm:1936
int __CRTDECL _Getloctxt(_InIt &_First, _InIt &_Last, size_t _Numfields, const _Elem *_Ptr)
Definition: xlocale:604
static constexpr _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
unsigned short &  _Val 
) const
inlineprotectedvirtual
463  { // get unsigned short from [_First, _Last) into _Val
464  _DEBUG_RANGE(_First, _Last);
465  char _Ac[_MAX_INT_DIG], *_Ep;
466  int _Errno = 0;
467  int _Base = _Getifld(_Ac, _First, _Last, _Iosbase.flags(),
468  _Iosbase.getloc()); // gather field into _Ac
469  char *_Ptr = _Ac[0] == '-' ? _Ac + 1 : _Ac; // point past any sign
470  const unsigned long _Ans =
471  _CSTD _Stoulx(_Ptr, &_Ep, _Base, &_Errno); // convert
472 
473  if (_First == _Last)
474  _State |= ios_base::eofbit;
475  if (_Ep == _Ptr || _Errno != 0 || USHRT_MAX < _Ans)
476  _State |= ios_base::failbit;
477  else
478  _Val = (unsigned short)(_Ac[0] == '-'
479  ? 0 -_Ans : _Ans); // deliver value
480  return (_First);
481  }
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx(const char *, _Out_opt_ _Deref_post_opt_valid_ char **, int, int *)
_In_ int _Val
Definition: vcruntime_string.h:62
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
int __CLRCALL_OR_CDECL _Getifld(char *_Ac, _InIt &_First, _InIt &_Last, ios_base::fmtflags _Basefield, const locale &_Loc) const
Definition: xlocnum:690
#define USHRT_MAX
Definition: limits.h:33
#define _MAX_INT_DIG
Definition: yvals.h:588
#define _CSTD
Definition: yvals.h:570
_FwdIt _Last
Definition: algorithm:1936
static constexpr _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
unsigned int &  _Val 
) const
inlineprotectedvirtual
486  { // get unsigned int from [_First, _Last) into _Val
487  _DEBUG_RANGE(_First, _Last);
488  char _Ac[_MAX_INT_DIG], *_Ep;
489  int _Errno = 0;
490  int _Base = _Getifld(_Ac, _First, _Last, _Iosbase.flags(),
491  _Iosbase.getloc()); // gather field into _Ac
492  char *_Ptr = _Ac[0] == '-' ? _Ac + 1 : _Ac; // point past any sign
493  const unsigned long _Ans =
494  _CSTD _Stoulx(_Ptr, &_Ep, _Base, &_Errno); // convert
495 
496  if (_First == _Last)
497  _State |= ios_base::eofbit;
498  if (_Ep == _Ptr || _Errno != 0 || UINT_MAX < _Ans)
499  _State |= ios_base::failbit;
500  else
501  _Val = _Ac[0] == '-' ? 0 -_Ans : _Ans; // deliver value
502  return (_First);
503  }
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx(const char *, _Out_opt_ _Deref_post_opt_valid_ char **, int, int *)
_In_ int _Val
Definition: vcruntime_string.h:62
#define UINT_MAX
Definition: limits.h:36
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
int __CLRCALL_OR_CDECL _Getifld(char *_Ac, _InIt &_First, _InIt &_Last, ios_base::fmtflags _Basefield, const locale &_Loc) const
Definition: xlocnum:690
#define _MAX_INT_DIG
Definition: yvals.h:588
#define _CSTD
Definition: yvals.h:570
_FwdIt _Last
Definition: algorithm:1936
static constexpr _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
long &  _Val 
) const
inlineprotectedvirtual
508  { // get long from [_First, _Last) into _Val
509  _DEBUG_RANGE(_First, _Last);
510  char _Ac[_MAX_INT_DIG], *_Ep;
511  int _Errno = 0;
512  const long _Ans = _CSTD _Stolx(_Ac, &_Ep,
513  _Getifld(_Ac, _First, _Last, _Iosbase.flags(),
514  _Iosbase.getloc()), &_Errno); // gather field, convert
515 
516  if (_First == _Last)
517  _State |= ios_base::eofbit;
518  if (_Ep == _Ac || _Errno != 0)
519  _State |= ios_base::failbit;
520  else
521  _Val = _Ans; // deliver value
522  return (_First);
523  }
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_In_ int _Val
Definition: vcruntime_string.h:62
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
int __CLRCALL_OR_CDECL _Getifld(char *_Ac, _InIt &_First, _InIt &_Last, ios_base::fmtflags _Basefield, const locale &_Loc) const
Definition: xlocnum:690
#define _MAX_INT_DIG
Definition: yvals.h:588
_CRTIMP2_PURE long __CLRCALL_PURE_OR_CDECL _Stolx(const char *, _Out_opt_ _Deref_post_opt_valid_ char **, int, int *)
#define _CSTD
Definition: yvals.h:570
_FwdIt _Last
Definition: algorithm:1936
static constexpr _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
unsigned long &  _Val 
) const
inlineprotectedvirtual
528  { // get unsigned long from [_First, _Last) into _Val
529  _DEBUG_RANGE(_First, _Last);
530  char _Ac[_MAX_INT_DIG], *_Ep;
531  int _Errno = 0;
532  const unsigned long _Ans = _CSTD _Stoulx(_Ac, &_Ep,
533  _Getifld(_Ac, _First, _Last, _Iosbase.flags(),
534  _Iosbase.getloc()), &_Errno); // gather field, convert
535 
536  if (_First == _Last)
537  _State |= ios_base::eofbit;
538  if (_Ep == _Ac || _Errno != 0)
539  _State |= ios_base::failbit;
540  else
541  _Val = _Ans; // deliver value
542  return (_First);
543  }
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx(const char *, _Out_opt_ _Deref_post_opt_valid_ char **, int, int *)
_In_ int _Val
Definition: vcruntime_string.h:62
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
int __CLRCALL_OR_CDECL _Getifld(char *_Ac, _InIt &_First, _InIt &_Last, ios_base::fmtflags _Basefield, const locale &_Loc) const
Definition: xlocnum:690
#define _MAX_INT_DIG
Definition: yvals.h:588
#define _CSTD
Definition: yvals.h:570
_FwdIt _Last
Definition: algorithm:1936
static constexpr _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
_LONGLONG _Val 
) const
inlineprotectedvirtual
548  { // get long long from [_First, _Last) into _Val
549  _DEBUG_RANGE(_First, _Last);
550  char _Ac[_MAX_INT_DIG], *_Ep;
551  int _Errno = 0;
552  const _LONGLONG _Ans = _CSTD _Stollx(_Ac, &_Ep,
553  _Getifld(_Ac, _First, _Last, _Iosbase.flags(),
554  _Iosbase.getloc()), &_Errno); // gather field, convert
555 
556  if (_First == _Last)
557  _State |= ios_base::eofbit;
558  if (_Ep == _Ac || _Errno != 0)
559  _State |= ios_base::failbit;
560  else
561  _Val = _Ans; // deliver value
562  return (_First);
563  }
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_In_ int _Val
Definition: vcruntime_string.h:62
_CRTIMP2_PURE _LONGLONG __CLRCALL_PURE_OR_CDECL _Stollx(const char *, _Out_opt_ _Deref_post_opt_valid_ char **, int, int *)
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
int __CLRCALL_OR_CDECL _Getifld(char *_Ac, _InIt &_First, _InIt &_Last, ios_base::fmtflags _Basefield, const locale &_Loc) const
Definition: xlocnum:690
#define _LONGLONG
Definition: yvals.h:579
#define _MAX_INT_DIG
Definition: yvals.h:588
#define _CSTD
Definition: yvals.h:570
_FwdIt _Last
Definition: algorithm:1936
static constexpr _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
_ULONGLONG _Val 
) const
inlineprotectedvirtual
568  { // get unsigned long long from [_First, _Last) into _Val
569  _DEBUG_RANGE(_First, _Last);
570  char _Ac[_MAX_INT_DIG], *_Ep;
571  int _Errno = 0;
572  const _ULONGLONG _Ans = _CSTD _Stoullx(_Ac, &_Ep,
573  _Getifld(_Ac, _First, _Last, _Iosbase.flags(),
574  _Iosbase.getloc()), &_Errno); // gather field, convert
575 
576  if (_First == _Last)
577  _State |= ios_base::eofbit;
578  if (_Ep == _Ac || _Errno != 0)
579  _State |= ios_base::failbit;
580  else
581  _Val = _Ans; // deliver value
582  return (_First);
583  }
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _ULONGLONG
Definition: yvals.h:580
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_In_ int _Val
Definition: vcruntime_string.h:62
_CRTIMP2_PURE _ULONGLONG __CLRCALL_PURE_OR_CDECL _Stoullx(const char *, _Out_opt_ _Deref_post_opt_valid_ char **, int, int *)
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
int __CLRCALL_OR_CDECL _Getifld(char *_Ac, _InIt &_First, _InIt &_Last, ios_base::fmtflags _Basefield, const locale &_Loc) const
Definition: xlocnum:690
#define _MAX_INT_DIG
Definition: yvals.h:588
#define _CSTD
Definition: yvals.h:570
_FwdIt _Last
Definition: algorithm:1936
static constexpr _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
float &  _Val 
) const
inlineprotectedvirtual
594  { // get float from [_First, _Last) into _Val
595  _DEBUG_RANGE(_First, _Last);
596  char _Ac[_FLOATING_BUFFER_SIZE], *_Ep;
597  int _Errno = 0;
598  int _Hexexp = _ENABLE_V2_BEHAVIOR;
599  float _Ans = _Stofx_v2(_Ac, &_Ep,
600  _Getffld(_Ac, _First, _Last,
601  _Iosbase, &_Hexexp), &_Errno); // gather field, convert
602 
603  if (_Hexexp != _ENABLE_V2_BEHAVIOR && _Hexexp != 0)
604  _Ans = _CSTD ldexpf(_Ans, 4 * _Hexexp);
605 
606  if (_First == _Last)
607  _State |= ios_base::eofbit;
608  if (_Ep == _Ac || _Errno != 0)
609  _State |= ios_base::failbit;
610  else
611  _Val = _Ans; // deliver value
612  return (_First);
613  }
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_In_ int _Val
Definition: vcruntime_string.h:62
float ldexpf(float _X, int _Exp) __GPU_ONLY
Computes a real number from the mantissa and exponent
Definition: amp_math.h:728
#define _ENABLE_V2_BEHAVIOR
Definition: xlocnum:586
#define _FLOATING_BUFFER_SIZE
Definition: xlocnum:589
int __CLRCALL_OR_CDECL _Getffld(char *_Ac, _InIt &_First, _InIt &_Last, ios_base &_Iosbase, int *_Phexexp) const
Definition: xlocnum:789
float _Stofx_v2(const char *_Str, char **_Endptr, int _Pten, int *_Perr)
Definition: xlocnum:71
#define _CSTD
Definition: yvals.h:570
_FwdIt _Last
Definition: algorithm:1936
static constexpr _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
double &  _Val 
) const
inlineprotectedvirtual
618  { // get double from [_First, _Last) into _Val
619  _DEBUG_RANGE(_First, _Last);
620  char _Ac[_FLOATING_BUFFER_SIZE], *_Ep;
621  int _Errno = 0;
622  int _Hexexp = _ENABLE_V2_BEHAVIOR;
623  double _Ans = _Stodx_v2(_Ac, &_Ep,
624  _Getffld(_Ac, _First, _Last,
625  _Iosbase, &_Hexexp), &_Errno); // gather field, convert
626 
627  if (_Hexexp != _ENABLE_V2_BEHAVIOR && _Hexexp != 0)
628  _Ans = _CSTD ldexp(_Ans, 4 * _Hexexp);
629 
630  if (_First == _Last)
631  _State |= ios_base::eofbit;
632  if (_Ep == _Ac || _Errno != 0)
633  _State |= ios_base::failbit;
634  else
635  _Val = _Ans; // deliver value
636  return (_First);
637  }
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_In_ int _Val
Definition: vcruntime_string.h:62
#define _ENABLE_V2_BEHAVIOR
Definition: xlocnum:586
#define _FLOATING_BUFFER_SIZE
Definition: xlocnum:589
int __CLRCALL_OR_CDECL _Getffld(char *_Ac, _InIt &_First, _InIt &_Last, ios_base &_Iosbase, int *_Phexexp) const
Definition: xlocnum:789
float ldexp(float _X, int _Exp) __GPU_ONLY
Computes a real number from the mantissa and exponent
Definition: amp_math.h:746
_END_C_LIB_DECL _STD_BEGIN double _Stodx_v2(const char *_Str, char **_Endptr, int _Pten, int *_Perr)
Definition: xlocnum:54
#define _CSTD
Definition: yvals.h:570
_FwdIt _Last
Definition: algorithm:1936
static constexpr _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
long double &  _Val 
) const
inlineprotectedvirtual
642  { // get long double from [_First, _Last) into _Val
643  _DEBUG_RANGE(_First, _Last);
644  char _Ac[_FLOATING_BUFFER_SIZE], *_Ep;
645  int _Errno = 0;
646  int _Hexexp = _ENABLE_V2_BEHAVIOR;
647  long double _Ans = _Stodx_v2(_Ac, &_Ep,
648  _Getffld(_Ac, _First, _Last,
649  _Iosbase, &_Hexexp), &_Errno); // gather field, convert, "widen" double to long double
650 
651  if (_Hexexp != _ENABLE_V2_BEHAVIOR && _Hexexp != 0)
652  _Ans = _CSTD ldexpl(_Ans, 4 * _Hexexp);
653 
654  if (_First == _Last)
655  _State |= ios_base::eofbit;
656  if (_Ep == _Ac || _Errno != 0)
657  _State |= ios_base::failbit;
658  else
659  _Val = _Ans; // deliver value
660  return (_First);
661  }
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_In_ int _Val
Definition: vcruntime_string.h:62
#define _ENABLE_V2_BEHAVIOR
Definition: xlocnum:586
#define _FLOATING_BUFFER_SIZE
Definition: xlocnum:589
int __CLRCALL_OR_CDECL _Getffld(char *_Ac, _InIt &_First, _InIt &_Last, ios_base &_Iosbase, int *_Phexexp) const
Definition: xlocnum:789
_END_C_LIB_DECL _STD_BEGIN double _Stodx_v2(const char *_Str, char **_Endptr, int _Pten, int *_Perr)
Definition: xlocnum:54
#define _CSTD
Definition: yvals.h:570
_FwdIt _Last
Definition: algorithm:1936
static constexpr _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
void *&  _Val 
) const
inlineprotectedvirtual
668  { // get void pointer from [_First, _Last) into _Val
669  _DEBUG_RANGE(_First, _Last);
670  char _Ac[_MAX_INT_DIG], *_Ep;
671  int _Errno = 0;
672 
673  int _Base = _Getifld(_Ac, _First, _Last, ios_base::hex,
674  _Iosbase.getloc()); // gather field
675  const _ULONGLONG _Ans =
676  (sizeof (void *) == sizeof (unsigned long))
677  ? (_ULONGLONG)_CSTD _Stoulx(_Ac, &_Ep, _Base, &_Errno)
678  : _CSTD _Stoullx(_Ac, &_Ep, _Base, &_Errno);
679 
680  if (_First == _Last)
681  _State |= ios_base::eofbit;
682  if (_Ep == _Ac || _Errno != 0)
683  _State |= ios_base::failbit;
684  else
685  _Val = (void *)((char *)0 + _Ans); // deliver value
686  return (_First);
687  }
static constexpr _Fmtflags hex
Definition: xiosbase:67
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _ULONGLONG
Definition: yvals.h:580
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
_CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx(const char *, _Out_opt_ _Deref_post_opt_valid_ char **, int, int *)
_In_ int _Val
Definition: vcruntime_string.h:62
_CRTIMP2_PURE _ULONGLONG __CLRCALL_PURE_OR_CDECL _Stoullx(const char *, _Out_opt_ _Deref_post_opt_valid_ char **, int, int *)
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
int __CLRCALL_OR_CDECL _Getifld(char *_Ac, _InIt &_First, _InIt &_Last, ios_base::fmtflags _Basefield, const locale &_Loc) const
Definition: xlocnum:690
#define _MAX_INT_DIG
Definition: yvals.h:588
#define _CSTD
Definition: yvals.h:570
_FwdIt _Last
Definition: algorithm:1936
static constexpr _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
bool _Val 
) const
inline
348  { // get bool from [_First, _Last) into _Val
349  return (do_get(_First, _Last, _Iosbase, _State, _Val));
350  }
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
Definition: xlocnum:423
_In_ int _Val
Definition: vcruntime_string.h:62
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
unsigned short &  _Val 
) const
inline
355  { // get unsigned short from [_First, _Last) into _Val
356  return (do_get(_First, _Last, _Iosbase, _State, _Val));
357  }
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
Definition: xlocnum:423
_In_ int _Val
Definition: vcruntime_string.h:62
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
unsigned int &  _Val 
) const
inline
362  { // get unsigned int from [_First, _Last) into _Val
363  return (do_get(_First, _Last, _Iosbase, _State, _Val));
364  }
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
Definition: xlocnum:423
_In_ int _Val
Definition: vcruntime_string.h:62
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
long &  _Val 
) const
inline
369  { // get long from [_First, _Last) into _Val
370  return (do_get(_First, _Last, _Iosbase, _State, _Val));
371  }
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
Definition: xlocnum:423
_In_ int _Val
Definition: vcruntime_string.h:62
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
unsigned long &  _Val 
) const
inline
376  { // get unsigned long from [_First, _Last) into _Val
377  return (do_get(_First, _Last, _Iosbase, _State, _Val));
378  }
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
Definition: xlocnum:423
_In_ int _Val
Definition: vcruntime_string.h:62
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
_LONGLONG _Val 
) const
inline
383  { // get long long from [_First, _Last) into _Val
384  return (do_get(_First, _Last, _Iosbase, _State, _Val));
385  }
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
Definition: xlocnum:423
_In_ int _Val
Definition: vcruntime_string.h:62
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
_ULONGLONG _Val 
) const
inline
390  { // get unsigned long long from [_First, _Last) into _Val
391  return (do_get(_First, _Last, _Iosbase, _State, _Val));
392  }
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
Definition: xlocnum:423
_In_ int _Val
Definition: vcruntime_string.h:62
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
float &  _Val 
) const
inline
397  { // get float from [_First, _Last) into _Val
398  return (do_get(_First, _Last, _Iosbase, _State, _Val));
399  }
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
Definition: xlocnum:423
_In_ int _Val
Definition: vcruntime_string.h:62
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
double &  _Val 
) const
inline
404  { // get double from [_First, _Last) into _Val
405  return (do_get(_First, _Last, _Iosbase, _State, _Val));
406  }
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
Definition: xlocnum:423
_In_ int _Val
Definition: vcruntime_string.h:62
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
long double &  _Val 
) const
inline
411  { // get long double from [_First, _Last) into _Val
412  return (do_get(_First, _Last, _Iosbase, _State, _Val));
413  }
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
Definition: xlocnum:423
_In_ int _Val
Definition: vcruntime_string.h:62
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL num_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
void *&  _Val 
) const
inline
418  { // get void pointer from [_First, _Last) into _Val
419  return (do_get(_First, _Last, _Iosbase, _State, _Val));
420  }
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, bool &_Val) const
Definition: xlocnum:423
_In_ int _Val
Definition: vcruntime_string.h:62
_FwdIt _Last
Definition: algorithm:1936

Member Data Documentation

template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
__PURE_APPDOMAIN_GLOBAL locale::id num_get< _Elem, _InIt >::id
static

The documentation for this class was generated from the following file: