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, long long &_Val) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, unsigned long long &_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, long long &_Val) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, unsigned long long &_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
319  { // destroy the object
320  }
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
328  : locale::facet(_Refs)
329  { // construct from current locale
330  _BEGIN_LOCINFO(_Lobj)
331  _Init(_Lobj);
332  _END_LOCINFO()
333  }
Definition: xlocale:137
void _Init(const _Locinfo &)
Definition: xlocnum:322
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
336  : locale::facet(_Refs)
337  { // construct from specified locale
338  _Init(_Lobj);
339  }
Definition: xlocale:137
void _Init(const _Locinfo &)
Definition: xlocnum:322

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