1024 const string _Grouping = _Punct_fac.grouping();
1027 _NUMGET_SIGNOFF = 22,
1030 static constexpr
char _Src[] = {
"0123456789ABCDEFabcdef-+XxPp"};
1031 _Elem _Atoms[
sizeof (
_Src)];
1034 _Ctype_fac.widen(&_Src[0], &_Src[
sizeof (_Src)], _Atoms);
1040 if (_First ==
_Last)
1042 else if (*_First == _Atoms[_NUMGET_SIGNOFF + 1])
1047 else if (*_First == _Atoms[_NUMGET_SIGNOFF])
1056 bool _Seendigit =
false;
1057 int _Significant = 0;
1060 if (_First ==
_Last || *_First != _Atoms[0])
1062 else if (++_First !=
_Last
1063 && (*_First == _Atoms[_NUMGET_XOFF + 1]
1064 || *_First == _Atoms[_NUMGET_XOFF]))
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)
1078 else if (_Idx == 0 && _Significant == 0)
1082 *_Ptr++ = _Src[_Idx];
1087 const _Elem _Kseparator = _Grouping.size() == 0
1088 ? (_Elem)0 : _Punct_fac.thousands_sep();
1089 string _Groups((
size_t)1,
'\0');
1092 for (; _First !=
_Last; ++_First)
1093 if ((_Idx =
_Find_elem(_Atoms, *_First)) < _NUMGET_SIGNOFF)
1096 if (_Max_sig_dig <= _Significant)
1098 else if (_Idx == 0 && _Significant == 0)
1102 *_Ptr++ = _Src[_Idx];
1108 else if (_Groups[_Group] ==
'\0'
1109 || _Kseparator == (_Elem)0
1110 || *_First != _Kseparator)
1114 _Groups.append((
size_t)1,
'\0');
1119 else if (
'\0' < _Groups[_Group])
1124 while (!_Bad && 0 < _Group)
1127 else if ((0 < --_Group && *_Pg != _Groups[_Group])
1128 || (0 == _Group && *_Pg < _Groups[_Group]))
1130 else if (
'\0' < _Pg[1])
1134 if (_Seendigit && _Significant == 0)
1137 if (_First !=
_Last && *_First == _Punct_fac.decimal_point())
1143 if (_Significant == 0)
1145 for (; _First !=
_Last && *_First == _Atoms[0];
1146 _Seendigit =
true, (
void)++_First)
1155 for (; _First !=
_Last
1156 && (_Idx =
_Find_elem(_Atoms, *_First)) < _NUMGET_SIGNOFF;
1157 _Seendigit =
true, (
void)++_First)
1158 if (_Significant < _Max_sig_dig)
1160 *_Ptr++ = _Src[_Idx];
1164 if (_Seendigit && _First !=
_Last
1165 && (*_First == _Atoms[_NUMGET_POFF + 1]
1166 || *_First == _Atoms[_NUMGET_POFF]))
1173 if (_First ==
_Last)
1175 else if (*_First == _Atoms[_NUMGET_SIGNOFF + 1])
1180 else if (*_First == _Atoms[_NUMGET_SIGNOFF])
1186 for (; _First !=
_Last && *_First == _Atoms[0]; ++_First)
1193 for (; _First !=
_Last
1194 && (_Idx =
_Find_elem(_Atoms, *_First)) < _NUMGET_SIGNOFF;
1195 _Seendigit =
true, (
void)++_First)
1198 *_Ptr++ = _Src[_Idx];
1203 if (_Bad || !_Seendigit)
#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)
_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