984 const string _Grouping = _Punct_fac.grouping();
987 _NUMGET_SIGNOFF = 22,
990 static const char _Src[] = {
"0123456789ABCDEFabcdef-+XxPp"};
991 _Elem _Atoms[
sizeof (_Src)];
994 _Ctype_fac.widen(&_Src[0], &_Src[
sizeof (_Src)], _Atoms);
1000 if (_First ==
_Last)
1002 else if (*_First == _Atoms[_NUMGET_SIGNOFF + 1])
1003 *_Ptr++ =
'+', ++_First;
1004 else if (*_First == _Atoms[_NUMGET_SIGNOFF])
1005 *_Ptr++ =
'-', ++_First;
1010 bool _Seendigit =
false;
1011 int _Significant = 0;
1014 if (_First ==
_Last || *_First != _Atoms[0])
1016 else if (++_First !=
_Last
1017 && (*_First == _Atoms[_NUMGET_XOFF + 1]
1018 || *_First == _Atoms[_NUMGET_XOFF]))
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)
1032 else if (_Idx == 0 && _Significant == 0)
1036 *_Ptr++ = _Src[_Idx];
1041 const _Elem _Kseparator = _Grouping.size() == 0
1042 ? (_Elem)0 : _Punct_fac.thousands_sep();
1043 string _Groups((
size_t)1,
'\0');
1046 for (; _First !=
_Last; ++_First)
1047 if ((_Idx =
_Find_elem(_Atoms, *_First)) < _NUMGET_SIGNOFF)
1050 if (_Max_sig_dig <= _Significant)
1052 else if (_Idx == 0 && _Significant == 0)
1056 *_Ptr++ = _Src[_Idx];
1062 else if (_Groups[_Group] ==
'\0'
1063 || _Kseparator == (_Elem)0
1064 || *_First != _Kseparator)
1068 _Groups.append((
size_t)1,
'\0');
1073 else if (
'\0' < _Groups[_Group])
1078 while (!_Bad && 0 < _Group)
1081 else if ((0 < --_Group && *_Pg != _Groups[_Group])
1082 || (0 == _Group && *_Pg < _Groups[_Group]))
1084 else if (
'\0' < _Pg[1])
1088 if (_Seendigit && _Significant == 0)
1091 if (_First !=
_Last && *_First == _Punct_fac.decimal_point())
1092 *_Ptr++ = localeconv()->decimal_point[0], ++_First;
1094 if (_Significant == 0)
1096 for (; _First !=
_Last && *_First == _Atoms[0];
1097 _Seendigit =
true, ++_First)
1100 *_Ptr++ =
'0', ++_Phex;
1103 for (; _First !=
_Last
1104 && (_Idx =
_Find_elem(_Atoms, *_First)) < _NUMGET_SIGNOFF;
1105 _Seendigit =
true, ++_First)
1106 if (_Significant < _Max_sig_dig)
1108 *_Ptr++ = _Src[_Idx];
1112 if (_Seendigit && _First !=
_Last
1113 && (*_First == _Atoms[_NUMGET_POFF + 1]
1114 || *_First == _Atoms[_NUMGET_POFF]))
1116 *_Ptr++ =
'p', ++_First;
1117 _Seendigit =
false, _Significant = 0;
1119 if (_First ==
_Last)
1121 else if (*_First == _Atoms[_NUMGET_SIGNOFF + 1])
1122 *_Ptr++ =
'+', ++_First;
1123 else if (*_First == _Atoms[_NUMGET_SIGNOFF])
1124 *_Ptr++ =
'-', ++_First;
1125 for (; _First !=
_Last && *_First == _Atoms[0]; )
1126 _Seendigit =
true, ++_First;
1129 for (; _First !=
_Last
1130 && (_Idx =
_Find_elem(_Atoms, *_First)) < _NUMGET_SIGNOFF;
1131 _Seendigit =
true, ++_First)
1134 *_Ptr++ = _Src[_Idx];
1139 if (_Bad || !_Seendigit)
#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
#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