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_put< _Elem, _OutIt > Class Template Reference
Inheritance diagram for num_put< _Elem, _OutIt >:
locale::facet _Facet_base

Public Types

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

Public Member Functions

__CLR_OR_THIS_CALL num_put (size_t _Refs=0)
 
__CLR_OR_THIS_CALL num_put (const _Locinfo &_Lobj, size_t _Refs=0)
 
_OutIt __CLR_OR_THIS_CALL put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, _Bool _Val) const
 
_OutIt __CLR_OR_THIS_CALL put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, long _Val) const
 
_OutIt __CLR_OR_THIS_CALL put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, unsigned long _Val) const
 
_OutIt __CLR_OR_THIS_CALL put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, double _Val) const
 
_OutIt __CLR_OR_THIS_CALL put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, long double _Val) const
 
_OutIt __CLR_OR_THIS_CALL put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, const 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_put () _NOEXCEPT
 
void __CLR_OR_THIS_CALL _Init (const _Locinfo &)
 
virtual _OutIt __CLR_OR_THIS_CALL do_put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, _Bool _Val) const
 
virtual _OutIt __CLR_OR_THIS_CALL do_put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, long _Val) const
 
virtual _OutIt __CLR_OR_THIS_CALL do_put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, unsigned long _Val) const
 
virtual _OutIt __CLR_OR_THIS_CALL do_put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, double _Val) const
 
virtual _OutIt __CLR_OR_THIS_CALL do_put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, long double _Val) const
 
virtual _OutIt __CLR_OR_THIS_CALL do_put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, const 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

char *__CLRCALL_OR_CDECL _Ffmt (char *_Fmt, char _Spec, ios_base::fmtflags _Flags) const
 
_OutIt __CLRCALL_OR_CDECL _Fput (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, const char *_Buf, size_t _Beforepoint, size_t _Afterpoint, size_t _Trailing, size_t _Count) const
 
char *__CLRCALL_OR_CDECL _Ifmt (char *_Fmt, const char *_Spec, ios_base::fmtflags _Flags) const
 
_OutIt __CLRCALL_OR_CDECL _Iput (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
 
_OutIt __CLRCALL_OR_CDECL _Put (_OutIt _Dest, const _Elem *_Ptr, size_t _Count) const
 
_OutIt __CLRCALL_OR_CDECL _Rep (_OutIt _Dest, _Elem _Ch, size_t _Count) const
 

Member Typedef Documentation

template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef numpunct<_Elem> num_put< _Elem, _OutIt >::_Mypunct
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef basic_string<_Elem, char_traits<_Elem>, allocator<_Elem> > num_put< _Elem, _OutIt >::_Mystr
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef _Elem num_put< _Elem, _OutIt >::char_type
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef _OutIt num_put< _Elem, _OutIt >::iter_type

Constructor & Destructor Documentation

template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::~num_put ( )
inlineprotectedvirtual
1101  { // destroy the object
1102  }
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
__CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::num_put ( size_t  _Refs = 0)
inlineexplicit
1110  : locale::facet(_Refs)
1111  { // construct from current locale
1112  _BEGIN_LOCINFO(_Lobj)
1113  _Init(_Lobj);
1114  _END_LOCINFO()
1115  }
void __CLR_OR_THIS_CALL _Init(const _Locinfo &)
Definition: xlocnum:1104
Definition: xlocale:102
_Atomic_counter_t _Refs
Definition: xlocale:157
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
__CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::num_put ( const _Locinfo _Lobj,
size_t  _Refs = 0 
)
inline
1118  : locale::facet(_Refs)
1119  { // construct from specified locale
1120  _Init(_Lobj);
1121  }
void __CLR_OR_THIS_CALL _Init(const _Locinfo &)
Definition: xlocnum:1104
Definition: xlocale:102
_Atomic_counter_t _Refs
Definition: xlocale:157

Member Function Documentation

template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
char* __CLRCALL_OR_CDECL num_put< _Elem, _OutIt >::_Ffmt ( char *  _Fmt,
char  _Spec,
ios_base::fmtflags  _Flags 
) const
inlineprivate
1344  { // generate sprintf format for floating-point
1345  char *_Ptr = _Fmt;
1346  *_Ptr++ = '%';
1347 
1348  if (_Flags & ios_base::showpos)
1349  *_Ptr++ = '+';
1350  if (_Flags & ios_base::showpoint)
1351  *_Ptr++ = '#';
1352  *_Ptr++ = '.';
1353  *_Ptr++ = '*'; // for precision argument
1354  if (_Spec != '\0')
1355  *_Ptr++ = _Spec; // 'L' qualifier for long double only
1356 
1357  ios_base::fmtflags _Ffl = _Flags & ios_base::floatfield;
1358  if (_Flags & ios_base::uppercase)
1359  *_Ptr++ = _Ffl == ios_base::fixed ? 'f'
1360  : _Ffl == ios_base::hexfloat ? 'A' // added with TR1
1361  : _Ffl == ios_base::scientific ? 'E' : 'G'; // specifier
1362  else
1363  *_Ptr++ = _Ffl == ios_base::fixed ? 'f'
1364  : _Ffl == ios_base::hexfloat ? 'a' // added with TR1
1365  : _Ffl == ios_base::scientific ? 'e' : 'g'; // specifier
1366 
1367  *_Ptr = '\0';
1368  return (_Fmt);
1369  }
static const _Fmtflags uppercase
Definition: xiosbase:58
static const _Fmtflags showpoint
Definition: xiosbase:60
static const _Fmtflags showpos
Definition: xiosbase:61
static const _Fmtflags scientific
Definition: xiosbase:68
static const _Fmtflags floatfield
Definition: xiosbase:80
static const _Fmtflags fixed
Definition: xiosbase:69
static const _Fmtflags hexfloat
Definition: xiosbase:71
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLRCALL_OR_CDECL num_put< _Elem, _OutIt >::_Fput ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
const char *  _Buf,
size_t  _Beforepoint,
size_t  _Afterpoint,
size_t  _Trailing,
size_t  _Count 
) const
inlineprivate
1375  { // put formatted floating-point to _Dest
1376  _DEBUG_POINTER(_Dest);
1377  size_t _Prefix = 0 < _Count && (*_Buf == '+' || *_Buf == '-')
1378  ? 1 : 0;
1379 
1380  const char *_Exps;
1381  if ((_Iosbase.flags() & ios_base::floatfield) != ios_base::hexfloat)
1382  _Exps = "eE";
1383  else
1384  { // correct for hexadecimal floating-point
1385  _Exps = "pP";
1386  if (_Prefix + 2 <= _Count && _Buf[_Prefix] == '0'
1387  && (_Buf[_Prefix + 1] == 'x' || _Buf[_Prefix + 1] == 'X'))
1388  _Prefix += 2;
1389  }
1390  const size_t _Eoff =
1391  _CSTD strcspn(&_Buf[0], _Exps); // find exponent
1392  char _Dp[2] = {"."};
1393  _Dp[0] = _CSTD localeconv()->decimal_point[0];
1394  const size_t _Poff =
1395  _CSTD strcspn(&_Buf[0], &_Dp[0]); // find decimal point
1396 
1397  const ctype<_Elem>& _Ctype_fac =
1398  _USE(_Iosbase.getloc(), ctype<_Elem>);
1399  const _Elem _E0 = _Ctype_fac.widen('0');
1400  _Mystr _Groupstring(_Count, _Elem(0)); // reserve space
1401  _Ctype_fac.widen(&_Buf[0], &_Buf[_Count], &_Groupstring[0]);
1402 
1403  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
1404  const string _Grouping = _Punct_fac.grouping();
1405  const _Elem _Kseparator = _Punct_fac.thousands_sep();
1406 
1407  size_t _Off = _Beforepoint; // offset of (effective) decimal point
1408  if (_Poff == _Count)
1409  { // no decimal point, ignore _Afterpoint and _Trailing
1410  _Off += _Eoff;
1411  _Groupstring.insert(_Eoff, _Beforepoint, _E0);
1412  }
1413  else
1414  { // fill in zeros around decimal point
1415  _Off += _Poff;
1416  _Groupstring.insert(_Eoff, _Trailing, _E0);
1417  _Groupstring.insert(_Poff + 1, _Afterpoint, _E0);
1418  _Groupstring[_Poff] = _Punct_fac.decimal_point();
1419  _Groupstring.insert(_Poff, _Beforepoint, _E0);
1420  }
1421 
1422  const char *_Pg = &_Grouping[0];
1423  while (*_Pg != CHAR_MAX && '\0' < *_Pg
1424  && (size_t)*_Pg < _Off - _Prefix)
1425  { // add thousands separator
1426  _Groupstring.insert(_Off -= *_Pg, (size_t)1, _Kseparator);
1427  if ('\0' < _Pg[1])
1428  ++_Pg; // not last group, advance
1429  }
1430 
1431  _Count = _Groupstring.size();
1432  size_t _Fillcount = _Iosbase.width() <= 0
1433  || (size_t)_Iosbase.width() <= _Count
1434  ? 0 : (size_t)_Iosbase.width() - _Count;
1435 
1436  ios_base::fmtflags _Adjustfield =
1437  _Iosbase.flags() & ios_base::adjustfield;
1438  if (_Adjustfield != ios_base::left
1439  && _Adjustfield != ios_base::internal)
1440  { // put leading fill
1441  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1442  _Fillcount = 0;
1443  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1444  }
1445  else if (_Adjustfield == ios_base::internal)
1446  { // put internal fill
1447  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1448  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1449  _Fillcount = 0;
1450  }
1451  else
1452  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1453 
1454  _Dest = _Put(_Dest, &_Groupstring[_Prefix], _Count - _Prefix);
1455  _Iosbase.width(0);
1456  return (_Rep(_Dest, _Fill, _Fillcount)); // put trailing fill
1457  }
numpunct< _Elem > _Mypunct
Definition: xlocnum:1084
Definition: regex:1520
_W64 unsigned int size_t
Definition: crtdefs.h:496
#define _USE(loc, fac)
Definition: xlocale:555
char * decimal_point
Definition: locale.h:56
_Check_return_opt_ _CRTIMP struct lconv *__cdecl localeconv(void)
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:365
Definition: xlocale:2113
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:410
_OutIt __CLRCALL_OR_CDECL _Rep(_OutIt _Dest, _Elem _Ch, size_t _Count) const
Definition: xlocnum:1555
_Check_return_ _CRTIMP size_t __cdecl strcspn(_In_z_ const char *_Str, _In_z_ const char *_Control)
#define _DEBUG_POINTER(first)
Definition: xutility:465
static const _Fmtflags internal
Definition: xiosbase:64
static const _Fmtflags floatfield
Definition: xiosbase:80
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: xlocale:2162
_OutIt __CLRCALL_OR_CDECL _Put(_OutIt _Dest, const _Elem *_Ptr, size_t _Count) const
Definition: xlocnum:1547
static const _Fmtflags hexfloat
Definition: xiosbase:71
#define CHAR_MAX
Definition: limits.h:29
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > _Mystr
Definition: xlocnum:1086
_Diff _Count
Definition: algorithm:1941
#define _CSTD
Definition: yvals.h:559
static const _Fmtflags adjustfield
Definition: xiosbase:76
static const _Fmtflags left
Definition: xiosbase:62
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
static size_t __CLRCALL_OR_CDECL num_put< _Elem, _OutIt >::_Getcat ( const locale::facet **  _Ppf = 0,
const locale _Ploc = 0 
)
inlinestatic
1090  { // return locale category mask and construct standard facet
1091  if (_Ppf != 0 && *_Ppf == 0)
1093  _Locinfo(_Ploc->c_str()));
1094  return (_X_NUMERIC);
1095  }
#define _NEW_CRT
Definition: xdebug:69
Definition: xlocinfo:54
const char * c_str() const
Definition: xlocale:460
#define _X_NUMERIC
Definition: xlocinfo.h:41
Definition: xlocnum:1080
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
char* __CLRCALL_OR_CDECL num_put< _Elem, _OutIt >::_Ifmt ( char *  _Fmt,
const char *  _Spec,
ios_base::fmtflags  _Flags 
) const
inlineprivate
1461  { // generate sprintf format for integer
1462  char *_Ptr = _Fmt;
1463  *_Ptr++ = '%';
1464 
1465  if (_Flags & ios_base::showpos)
1466  *_Ptr++ = '+';
1467  if (_Flags & ios_base::showbase)
1468  *_Ptr++ = '#';
1469  if (_Spec[0] != 'L')
1470  *_Ptr++ = _Spec[0]; // qualifier
1471  else
1472 
1473  { /* change L to I64 */
1474  *_Ptr++ = 'I';
1475  *_Ptr++ = '6';
1476  *_Ptr++ = '4';
1477  }
1478 
1479  ios_base::fmtflags _Basefield = _Flags & ios_base::basefield;
1480  *_Ptr++ = _Basefield == ios_base::oct ? 'o'
1481  : _Basefield != ios_base::hex ? _Spec[1] // 'd' or 'u'
1482  : _Flags & ios_base::uppercase ? 'X' : 'x';
1483  *_Ptr = '\0';
1484  return (_Fmt);
1485  }
static const _Fmtflags hex
Definition: xiosbase:67
static const _Fmtflags basefield
Definition: xiosbase:78
static const _Fmtflags uppercase
Definition: xiosbase:58
static const _Fmtflags oct
Definition: xiosbase:66
static const _Fmtflags showpos
Definition: xiosbase:61
static const _Fmtflags showbase
Definition: xiosbase:59
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
void __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::_Init ( const _Locinfo )
inlineprotected
1105  { // initialize from _Locinfo object
1106  }
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLRCALL_OR_CDECL num_put< _Elem, _OutIt >::_Iput ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
char *  _Buf,
size_t  _Count 
) const
inlineprivate
1489  { // put formatted integer to _Dest
1490  _DEBUG_POINTER(_Dest);
1491  size_t _Prefix = 0 < _Count && (*_Buf == '+' || *_Buf == '-')
1492  ? 1 : 0;
1493  if ((_Iosbase.flags() & ios_base::basefield) == ios_base::hex
1494  && _Prefix + 2 <= _Count && _Buf[_Prefix] == '0'
1495  && (_Buf[_Prefix + 1] == 'x' || _Buf[_Prefix + 1] == 'X'))
1496  _Prefix += 2;
1497 
1498  const ctype<_Elem>& _Ctype_fac =
1499  _USE(_Iosbase.getloc(), ctype<_Elem>);
1500  _Mystr _Groupstring(_Count, _Elem(0)); // reserve space
1501  _Ctype_fac.widen(&_Buf[0], &_Buf[_Count], &_Groupstring[0]);
1502 
1503  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
1504  const string _Grouping = _Punct_fac.grouping();
1505  const char *_Pg = &_Grouping[0];
1506  if (*_Pg != CHAR_MAX && '\0' < *_Pg)
1507  { // grouping specified, add thousands separators
1508  const _Elem _Kseparator = _Punct_fac.thousands_sep();
1509  while (*_Pg != CHAR_MAX && '\0' < *_Pg
1510  && (size_t)*_Pg < _Count - _Prefix)
1511  { // insert thousands separator
1512  _Count -= *_Pg;
1513  _Groupstring.insert(_Count, 1, _Kseparator);
1514  if ('\0' < _Pg[1])
1515  ++_Pg; // not last group, advance
1516  }
1517  }
1518 
1519  _Count = _Groupstring.size();
1520  size_t _Fillcount = _Iosbase.width() <= 0
1521  || (size_t)_Iosbase.width() <= _Count
1522  ? 0 : (size_t)_Iosbase.width() - _Count;
1523 
1524  ios_base::fmtflags _Adjustfield =
1525  _Iosbase.flags() & ios_base::adjustfield;
1526  if (_Adjustfield != ios_base::left
1527  && _Adjustfield != ios_base::internal)
1528  { // put leading fill
1529  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1530  _Fillcount = 0;
1531  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1532  }
1533  else if (_Adjustfield == ios_base::internal)
1534  { // put internal fill
1535  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1536  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1537  _Fillcount = 0;
1538  }
1539  else
1540  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1541 
1542  _Dest = _Put(_Dest, &_Groupstring[_Prefix], _Count - _Prefix);
1543  _Iosbase.width(0);
1544  return (_Rep(_Dest, _Fill, _Fillcount)); // put trailing fill
1545  }
static const _Fmtflags hex
Definition: xiosbase:67
numpunct< _Elem > _Mypunct
Definition: xlocnum:1084
Definition: regex:1520
_W64 unsigned int size_t
Definition: crtdefs.h:496
static const _Fmtflags basefield
Definition: xiosbase:78
#define _USE(loc, fac)
Definition: xlocale:555
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:365
Definition: xlocale:2113
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:410
_OutIt __CLRCALL_OR_CDECL _Rep(_OutIt _Dest, _Elem _Ch, size_t _Count) const
Definition: xlocnum:1555
#define _DEBUG_POINTER(first)
Definition: xutility:465
static const _Fmtflags internal
Definition: xiosbase:64
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: xlocale:2162
_OutIt __CLRCALL_OR_CDECL _Put(_OutIt _Dest, const _Elem *_Ptr, size_t _Count) const
Definition: xlocnum:1547
#define CHAR_MAX
Definition: limits.h:29
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > _Mystr
Definition: xlocnum:1086
_Diff _Count
Definition: algorithm:1941
static const _Fmtflags adjustfield
Definition: xiosbase:76
static const _Fmtflags left
Definition: xiosbase:62
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLRCALL_OR_CDECL num_put< _Elem, _OutIt >::_Put ( _OutIt  _Dest,
const _Elem *  _Ptr,
size_t  _Count 
) const
inlineprivate
1549  { // put [_Ptr, _Ptr + _Count) to _Dest
1550  for (; 0 < _Count; --_Count, ++_Dest, ++_Ptr)
1551  *_Dest = *_Ptr;
1552  return (_Dest);
1553  }
_Diff _Count
Definition: algorithm:1941
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLRCALL_OR_CDECL num_put< _Elem, _OutIt >::_Rep ( _OutIt  _Dest,
_Elem  _Ch,
size_t  _Count 
) const
inlineprivate
1557  { // put _Count * _Ch to _Dest
1558  for (; 0 < _Count; --_Count, ++_Dest)
1559  *_Dest = _Ch;
1560  return (_Dest);
1561  }
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Diff _Count
Definition: algorithm:1941
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::do_put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
_Bool  _Val 
) const
inlineprotectedvirtual
1179  { // put formatted bool to _Dest
1180  _DEBUG_POINTER(_Dest);
1181  if (!(_Iosbase.flags() & ios_base::boolalpha))
1182  return (do_put(_Dest, _Iosbase, _Fill, (long)_Val));
1183  else
1184  { // put "false" or "true"
1185  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
1186  _Mystr _Str;
1187  if (_Val)
1188  _Str.assign(_Punct_fac.truename());
1189  else
1190  _Str.assign(_Punct_fac.falsename());
1191 
1192  size_t _Fillcount = _Iosbase.width() <= 0
1193  || (size_t)_Iosbase.width() <= _Str.size()
1194  ? 0 : (size_t)_Iosbase.width() - _Str.size();
1195 
1196  if ((_Iosbase.flags() & ios_base::adjustfield) != ios_base::left)
1197  { // put leading fill
1198  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1199  _Fillcount = 0;
1200  }
1201  _Dest = _Put(_Dest, _Str.c_str(), _Str.size()); // put field
1202  _Iosbase.width(0);
1203  return (_Rep(_Dest, _Fill, _Fillcount)); // put trailing fill
1204  }
1205  }
numpunct< _Elem > _Mypunct
Definition: xlocnum:1084
_W64 unsigned int size_t
Definition: crtdefs.h:496
#define _USE(loc, fac)
Definition: xlocale:555
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:365
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:410
_OutIt __CLRCALL_OR_CDECL _Rep(_OutIt _Dest, _Elem _Ch, size_t _Count) const
Definition: xlocnum:1555
#define _DEBUG_POINTER(first)
Definition: xutility:465
_OutIt __CLRCALL_OR_CDECL _Put(_OutIt _Dest, const _Elem *_Ptr, size_t _Count) const
Definition: xlocnum:1547
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > _Mystr
Definition: xlocnum:1086
static const _Fmtflags boolalpha
Definition: xiosbase:74
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, _Bool _Val) const
Definition: xlocnum:1177
_FwdIt const _Ty _Val
Definition: algorithm:1938
static const _Fmtflags adjustfield
Definition: xiosbase:76
static const _Fmtflags left
Definition: xiosbase:62
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::do_put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
long  _Val 
) const
inlineprotectedvirtual
1209  { // put formatted long to _Dest
1210  char _Buf[2 * _MAX_INT_DIG], _Fmt[6];
1211 
1212  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1213  _CSTD sprintf_s(_Buf, sizeof (_Buf), _Ifmt(_Fmt, "ld",
1214  _Iosbase.flags()), _Val)));
1215  }
Definition: regex:1520
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:365
_Check_return_opt_ _CRTIMP_ALTERNATIVE int __cdecl sprintf_s(_Out_writes_z_(_SizeInBytes) char *_DstBuf, _In_ size_t _SizeInBytes, _In_z_ _Printf_format_string_ const char *_Format,...)
#define _MAX_INT_DIG
Definition: yvals.h:583
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1487
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
char *__CLRCALL_OR_CDECL _Ifmt(char *_Fmt, const char *_Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1459
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::do_put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
unsigned long  _Val 
) const
inlineprotectedvirtual
1219  { // put formatted unsigned long to _Dest
1220  char _Buf[2 * _MAX_INT_DIG], _Fmt[6];
1221 
1222  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1223  _CSTD sprintf_s(_Buf, sizeof (_Buf), _Ifmt(_Fmt, "lu",
1224  _Iosbase.flags()), _Val)));
1225  }
Definition: regex:1520
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:365
_Check_return_opt_ _CRTIMP_ALTERNATIVE int __cdecl sprintf_s(_Out_writes_z_(_SizeInBytes) char *_DstBuf, _In_ size_t _SizeInBytes, _In_z_ _Printf_format_string_ const char *_Format,...)
#define _MAX_INT_DIG
Definition: yvals.h:583
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1487
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
char *__CLRCALL_OR_CDECL _Ifmt(char *_Fmt, const char *_Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1459
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::do_put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
double  _Val 
) const
inlineprotectedvirtual
1251  { // put formatted double to _Dest
1252  char _Buf[_MAX_EXP_DIG + _MAX_SIG_DIG + 64], _Fmt[8];
1253  streamsize _Precision = _Iosbase.precision() <= 0
1254  && !(_Iosbase.flags() & ios_base::fixed)
1255  ? 6 : _Iosbase.precision(); // desired precision
1256  int _Significance = _MAX_SIG_DIG < _Precision
1257  ? _MAX_SIG_DIG : (int)_Precision; // actual sprintf precision
1258  _Precision -= _Significance;
1259  size_t _Beforepoint = 0; // zeros to add before decimal point
1260  size_t _Afterpoint = 0; // zeros to add after decimal point
1261 
1262  if ((_Iosbase.flags() & ios_base::floatfield) == ios_base::fixed
1263  && _Val * 0.5 != _Val) // skip -Inf, 0, Inf
1264  { // scale silly fixed-point value
1265  bool _Signed = _Val < 0;
1266  if (_Signed)
1267  _Val = -_Val;
1268 
1269  for (; 1e35 <= _Val && _Beforepoint < 5000; _Beforepoint += 10)
1270  _Val /= 1e10; // drop 10 zeros before decimal point
1271 
1272  if (0 < _Val)
1273  for (; 10 <= _Precision && _Val <= 1e-35
1274  && _Afterpoint < 5000; _Afterpoint += 10)
1275  { // drop 10 zeros after decimal point
1276  _Val *= 1e10;
1277  _Precision -= 10;
1278  }
1279 
1280  if (_Signed)
1281  _Val = -_Val;
1282  }
1283 
1284  return (_Fput(_Dest, _Iosbase, _Fill, _Buf,
1285  _Beforepoint, _Afterpoint, (size_t)_Precision,
1286  _CSTD sprintf_s(_Buf, sizeof (_Buf),
1287  _Ffmt(_Fmt, 0, _Iosbase.flags()),
1288  _Significance, _Val))); // convert and put
1289  }
_Longlong streamsize
Definition: iosfwd:22
Definition: regex:1520
#define _MAX_SIG_DIG
Definition: yvals.h:584
_CRTIMP _In_opt_z_ const wchar_t _In_opt_z_ const wchar_t unsigned int
Definition: crtdefs.h:642
streamsize __CLR_OR_THIS_CALL precision() const
Definition: xiosbase:398
#define _MAX_EXP_DIG
Definition: yvals.h:582
_OutIt __CLRCALL_OR_CDECL _Fput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, const char *_Buf, size_t _Beforepoint, size_t _Afterpoint, size_t _Trailing, size_t _Count) const
Definition: xlocnum:1371
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:365
_Check_return_opt_ _CRTIMP_ALTERNATIVE int __cdecl sprintf_s(_Out_writes_z_(_SizeInBytes) char *_DstBuf, _In_ size_t _SizeInBytes, _In_z_ _Printf_format_string_ const char *_Format,...)
char *__CLRCALL_OR_CDECL _Ffmt(char *_Fmt, char _Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1342
static const _Fmtflags floatfield
Definition: xiosbase:80
static const _Fmtflags fixed
Definition: xiosbase:69
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::do_put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
long double  _Val 
) const
inlineprotectedvirtual
1293  { // put formatted long double to _Dest
1294  char _Buf[_MAX_EXP_DIG + _MAX_SIG_DIG + 64], _Fmt[8];
1295  streamsize _Precision = _Iosbase.precision() <= 0
1296  && !(_Iosbase.flags() & ios_base::fixed)
1297  ? 6 : _Iosbase.precision(); // desired precision
1298  int _Significance = _MAX_SIG_DIG < _Precision
1299  ? _MAX_SIG_DIG : (int)_Precision; // actual sprintf precision
1300  _Precision -= _Significance;
1301  size_t _Beforepoint = 0; // zeros to add before decimal point
1302  size_t _Afterpoint = 0; // zeros to add after decimal point
1303 
1304  if ((_Iosbase.flags() & ios_base::floatfield) == ios_base::fixed)
1305  { // scale silly fixed-point value
1306  bool _Signed = _Val < 0;
1307  if (_Signed)
1308  _Val = -_Val;
1309 
1310  for (; 1e35 <= _Val && _Beforepoint < 5000; _Beforepoint += 10)
1311  _Val /= 1e10; // drop 10 zeros before decimal point
1312 
1313  if (0 < _Val)
1314  for (; 10 <= _Precision && _Val <= 1e-35
1315  && _Afterpoint < 5000; _Afterpoint += 10)
1316  { // drop 10 zeros after decimal point
1317  _Val *= 1e10;
1318  _Precision -= 10;
1319  }
1320 
1321  if (_Signed)
1322  _Val = -_Val;
1323  }
1324 
1325  return (_Fput(_Dest, _Iosbase, _Fill, _Buf,
1326  _Beforepoint, _Afterpoint, (size_t)_Precision,
1327  _CSTD sprintf_s(_Buf, sizeof (_Buf),
1328  _Ffmt(_Fmt, 'L', _Iosbase.flags()),
1329  _Significance, _Val))); // convert and put
1330  }
_Longlong streamsize
Definition: iosfwd:22
Definition: regex:1520
#define _MAX_SIG_DIG
Definition: yvals.h:584
_CRTIMP _In_opt_z_ const wchar_t _In_opt_z_ const wchar_t unsigned int
Definition: crtdefs.h:642
streamsize __CLR_OR_THIS_CALL precision() const
Definition: xiosbase:398
#define _MAX_EXP_DIG
Definition: yvals.h:582
_OutIt __CLRCALL_OR_CDECL _Fput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, const char *_Buf, size_t _Beforepoint, size_t _Afterpoint, size_t _Trailing, size_t _Count) const
Definition: xlocnum:1371
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:365
_Check_return_opt_ _CRTIMP_ALTERNATIVE int __cdecl sprintf_s(_Out_writes_z_(_SizeInBytes) char *_DstBuf, _In_ size_t _SizeInBytes, _In_z_ _Printf_format_string_ const char *_Format,...)
char *__CLRCALL_OR_CDECL _Ffmt(char *_Fmt, char _Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1342
static const _Fmtflags floatfield
Definition: xiosbase:80
static const _Fmtflags fixed
Definition: xiosbase:69
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::do_put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
const void _Val 
) const
inlineprotectedvirtual
1334  { // put formatted void pointer to _Dest
1335  char _Buf[2 * _MAX_INT_DIG];
1336 
1337  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1338  _CSTD sprintf_s(_Buf, sizeof (_Buf), "%p", _Val)));
1339  }
Definition: regex:1520
_Check_return_opt_ _CRTIMP_ALTERNATIVE int __cdecl sprintf_s(_Out_writes_z_(_SizeInBytes) char *_DstBuf, _In_ size_t _SizeInBytes, _In_z_ _Printf_format_string_ const char *_Format,...)
#define _MAX_INT_DIG
Definition: yvals.h:583
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1487
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
_Bool  _Val 
) const
inline
1128  { // put formatted bool to _Dest
1129  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1130  }
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, _Bool _Val) const
Definition: xlocnum:1177
_FwdIt const _Ty _Val
Definition: algorithm:1938
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
long  _Val 
) const
inline
1134  { // put formatted long to _Dest
1135  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1136  }
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, _Bool _Val) const
Definition: xlocnum:1177
_FwdIt const _Ty _Val
Definition: algorithm:1938
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
unsigned long  _Val 
) const
inline
1140  { // put formatted unsigned long to _Dest
1141  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1142  }
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, _Bool _Val) const
Definition: xlocnum:1177
_FwdIt const _Ty _Val
Definition: algorithm:1938
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
double  _Val 
) const
inline
1160  { // put formatted double to _Dest
1161  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1162  }
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, _Bool _Val) const
Definition: xlocnum:1177
_FwdIt const _Ty _Val
Definition: algorithm:1938
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
long double  _Val 
) const
inline
1166  { // put formatted long double to _Dest
1167  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1168  }
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, _Bool _Val) const
Definition: xlocnum:1177
_FwdIt const _Ty _Val
Definition: algorithm:1938
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
const void _Val 
) const
inline
1172  { // put formatted void pointer to _Dest
1173  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1174  }
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, _Bool _Val) const
Definition: xlocnum:1177
_FwdIt const _Ty _Val
Definition: algorithm:1938
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597

Member Data Documentation

template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
__PURE_APPDOMAIN_GLOBAL locale::id num_put< _Elem, _OutIt >::id
static

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