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 _Crt_new_delete

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, long long _Val) const
 
_OutIt __CLR_OR_THIS_CALL put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, unsigned long 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, long long _Val) const
 
virtual _OutIt __CLR_OR_THIS_CALL do_put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, unsigned long 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 _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
1243  { // destroy the object
1244  }
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
1252  : locale::facet(_Refs)
1253  { // construct from current locale
1254  _BEGIN_LOCINFO(_Lobj)
1255  _Init(_Lobj);
1256  _END_LOCINFO()
1257  }
void __CLR_OR_THIS_CALL _Init(const _Locinfo &)
Definition: xlocnum:1246
Definition: xlocale:137
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
1260  : locale::facet(_Refs)
1261  { // construct from specified locale
1262  _Init(_Lobj);
1263  }
void __CLR_OR_THIS_CALL _Init(const _Locinfo &)
Definition: xlocnum:1246
Definition: xlocale:137

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
1446  { // generate sprintf format for floating-point
1447  char *_Ptr = _Fmt;
1448  *_Ptr++ = '%';
1449 
1450  if (_Flags & ios_base::showpos)
1451  *_Ptr++ = '+';
1452  if (_Flags & ios_base::showpoint)
1453  *_Ptr++ = '#';
1454  *_Ptr++ = '.';
1455  *_Ptr++ = '*'; // for precision argument
1456  if (_Spec != '\0')
1457  *_Ptr++ = _Spec; // 'L' qualifier for long double only
1458 
1459  ios_base::fmtflags _Ffl = _Flags & ios_base::floatfield;
1460  if (_Flags & ios_base::uppercase)
1461  *_Ptr++ = _Ffl == ios_base::fixed ? 'f'
1462  : _Ffl == ios_base::hexfloat ? 'A' // added with TR1
1463  : _Ffl == ios_base::scientific ? 'E' : 'G'; // specifier
1464  else
1465  *_Ptr++ = _Ffl == ios_base::fixed ? 'f'
1466  : _Ffl == ios_base::hexfloat ? 'a' // added with TR1
1467  : _Ffl == ios_base::scientific ? 'e' : 'g'; // specifier
1468 
1469  *_Ptr = '\0';
1470  return (_Fmt);
1471  }
static constexpr _Fmtflags uppercase
Definition: xiosbase:57
static constexpr _Fmtflags showpoint
Definition: xiosbase:59
static constexpr _Fmtflags showpos
Definition: xiosbase:60
static constexpr _Fmtflags scientific
Definition: xiosbase:67
static constexpr _Fmtflags floatfield
Definition: xiosbase:79
static constexpr _Fmtflags fixed
Definition: xiosbase:68
static constexpr _Fmtflags hexfloat
Definition: xiosbase:70
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  _Count 
) const
inlineprivate
1476  { // put formatted floating-point to _Dest
1477  size_t _Prefix = 0 < _Count && (*_Buf == '+' || *_Buf == '-')
1478  ? 1 : 0;
1479 
1480  const char *_Exps;
1481  if ((_Iosbase.flags() & ios_base::floatfield) != ios_base::hexfloat)
1482  _Exps = "eE";
1483  else
1484  { // correct for hexadecimal floating-point
1485  _Exps = "pP";
1486  if (_Prefix + 2 <= _Count && _Buf[_Prefix] == '0'
1487  && (_Buf[_Prefix + 1] == 'x' || _Buf[_Prefix + 1] == 'X'))
1488  _Prefix += 2;
1489  }
1490  const size_t _Eoff =
1491  _CSTD strcspn(&_Buf[0], _Exps); // find exponent
1492  char _Dp[2] = {"."};
1493  _Dp[0] = _CSTD localeconv()->decimal_point[0];
1494  const size_t _Poff =
1495  _CSTD strcspn(&_Buf[0], &_Dp[0]); // find decimal point
1496 
1497  const ctype<_Elem>& _Ctype_fac =
1498  _USE(_Iosbase.getloc(), ctype<_Elem>);
1499  _Mystr _Groupstring(_Count, _Elem(0)); // reserve space
1500  _Ctype_fac.widen(&_Buf[0], &_Buf[_Count], &_Groupstring[0]);
1501 
1502  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
1503  const string _Grouping = _Punct_fac.grouping();
1504  const _Elem _Kseparator = _Punct_fac.thousands_sep();
1505 
1506  if (_Poff != _Count)
1507  _Groupstring[_Poff] = _Punct_fac.decimal_point();
1508 
1509  size_t _Off = _Poff == _Count ? _Eoff : _Poff;
1510  const char *_Pg = &_Grouping[0];
1511  while (*_Pg != CHAR_MAX && '\0' < *_Pg
1512  && (size_t)*_Pg < _Off - _Prefix)
1513  { // add thousands separator
1514  _Groupstring.insert(_Off -= *_Pg, (size_t)1, _Kseparator);
1515  if ('\0' < _Pg[1])
1516  ++_Pg; // not last group, advance
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  }
numpunct< _Elem > _Mypunct
Definition: xlocnum:1226
Definition: regex:1559
unsigned _Dest
Definition: mbstring.h:107
unsigned int size_t
Definition: sourceannotations.h:19
#define _USE(loc, fac)
Definition: xlocale:499
char * decimal_point
Definition: locale.h:31
_In_z_ char const _Source _Check_return_ _ACRTIMP size_t __cdecl strcspn(_In_z_ char const *_Str, _In_z_ char const *_Control)
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
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:420
_OutIt __CLRCALL_OR_CDECL _Rep(_OutIt _Dest, _Elem _Ch, size_t _Count) const
Definition: xlocnum:1642
static constexpr _Fmtflags internal
Definition: xiosbase:63
static constexpr _Fmtflags floatfield
Definition: xiosbase:79
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: xlocale:2126
_OutIt __CLRCALL_OR_CDECL _Put(_OutIt _Dest, const _Elem *_Ptr, size_t _Count) const
Definition: xlocnum:1634
static constexpr _Fmtflags hexfloat
Definition: xiosbase:70
#define CHAR_MAX
Definition: limits.h:24
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > _Mystr
Definition: xlocnum:1228
_Diff _Count
Definition: algorithm:1941
#define _CSTD
Definition: yvals.h:570
static constexpr _Fmtflags adjustfield
Definition: xiosbase:75
static constexpr _Fmtflags left
Definition: xiosbase:61
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
1232  { // return locale category mask and construct standard facet
1233  if (_Ppf != 0 && *_Ppf == 0)
1234  *_Ppf = new num_put<_Elem, _OutIt>(
1235  _Locinfo(_Ploc->c_str()));
1236  return (_X_NUMERIC);
1237  }
Definition: xlocinfo:53
_Ret_z_ const char * c_str() const
Definition: xlocale:424
#define _X_NUMERIC
Definition: xlocinfo.h:41
Definition: xlocnum:1222
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
1549  { // generate sprintf format for integer
1550  char *_Ptr = _Fmt;
1551  *_Ptr++ = '%';
1552 
1553  if (_Flags & ios_base::showpos)
1554  *_Ptr++ = '+';
1555  if (_Flags & ios_base::showbase)
1556  *_Ptr++ = '#';
1557  if (_Spec[0] != 'L')
1558  *_Ptr++ = _Spec[0]; // qualifier
1559  else
1560 
1561  { /* change L to I64 */
1562  *_Ptr++ = 'I';
1563  *_Ptr++ = '6';
1564  *_Ptr++ = '4';
1565  }
1566 
1567  ios_base::fmtflags _Basefield = _Flags & ios_base::basefield;
1568  *_Ptr++ = _Basefield == ios_base::oct ? 'o'
1569  : _Basefield != ios_base::hex ? _Spec[1] // 'd' or 'u'
1570  : _Flags & ios_base::uppercase ? 'X' : 'x';
1571  *_Ptr = '\0';
1572  return (_Fmt);
1573  }
static constexpr _Fmtflags hex
Definition: xiosbase:66
static constexpr _Fmtflags basefield
Definition: xiosbase:77
static constexpr _Fmtflags uppercase
Definition: xiosbase:57
static constexpr _Fmtflags oct
Definition: xiosbase:65
static constexpr _Fmtflags showpos
Definition: xiosbase:60
static constexpr _Fmtflags showbase
Definition: xiosbase:58
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
void __CLR_OR_THIS_CALL num_put< _Elem, _OutIt >::_Init ( const _Locinfo )
inlineprotected
1247  { // initialize from _Locinfo object
1248  }
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
1577  { // put formatted integer to _Dest
1578  size_t _Prefix = 0 < _Count && (*_Buf == '+' || *_Buf == '-')
1579  ? 1 : 0;
1580  if ((_Iosbase.flags() & ios_base::basefield) == ios_base::hex
1581  && _Prefix + 2 <= _Count && _Buf[_Prefix] == '0'
1582  && (_Buf[_Prefix + 1] == 'x' || _Buf[_Prefix + 1] == 'X'))
1583  _Prefix += 2;
1584 
1585  const ctype<_Elem>& _Ctype_fac =
1586  _USE(_Iosbase.getloc(), ctype<_Elem>);
1587  _Mystr _Groupstring(_Count, _Elem(0)); // reserve space
1588  _Ctype_fac.widen(&_Buf[0], &_Buf[_Count], &_Groupstring[0]);
1589 
1590  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
1591  const string _Grouping = _Punct_fac.grouping();
1592  const char *_Pg = &_Grouping[0];
1593  if (*_Pg != CHAR_MAX && '\0' < *_Pg)
1594  { // grouping specified, add thousands separators
1595  const _Elem _Kseparator = _Punct_fac.thousands_sep();
1596  while (*_Pg != CHAR_MAX && '\0' < *_Pg
1597  && (size_t)*_Pg < _Count - _Prefix)
1598  { // insert thousands separator
1599  _Count -= *_Pg;
1600  _Groupstring.insert(_Count, 1, _Kseparator);
1601  if ('\0' < _Pg[1])
1602  ++_Pg; // not last group, advance
1603  }
1604  }
1605 
1606  _Count = _Groupstring.size();
1607  size_t _Fillcount = _Iosbase.width() <= 0
1608  || (size_t)_Iosbase.width() <= _Count
1609  ? 0 : (size_t)_Iosbase.width() - _Count;
1610 
1611  ios_base::fmtflags _Adjustfield =
1612  _Iosbase.flags() & ios_base::adjustfield;
1613  if (_Adjustfield != ios_base::left
1614  && _Adjustfield != ios_base::internal)
1615  { // put leading fill
1616  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1617  _Fillcount = 0;
1618  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1619  }
1620  else if (_Adjustfield == ios_base::internal)
1621  { // put internal fill
1622  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1623  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1624  _Fillcount = 0;
1625  }
1626  else
1627  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1628 
1629  _Dest = _Put(_Dest, &_Groupstring[_Prefix], _Count - _Prefix);
1630  _Iosbase.width(0);
1631  return (_Rep(_Dest, _Fill, _Fillcount)); // put trailing fill
1632  }
static constexpr _Fmtflags hex
Definition: xiosbase:66
numpunct< _Elem > _Mypunct
Definition: xlocnum:1226
Definition: regex:1559
unsigned _Dest
Definition: mbstring.h:107
unsigned int size_t
Definition: sourceannotations.h:19
static constexpr _Fmtflags basefield
Definition: xiosbase:77
#define _USE(loc, fac)
Definition: xlocale:499
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:375
Definition: xlocale:2077
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:420
_OutIt __CLRCALL_OR_CDECL _Rep(_OutIt _Dest, _Elem _Ch, size_t _Count) const
Definition: xlocnum:1642
static constexpr _Fmtflags internal
Definition: xiosbase:63
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: xlocale:2126
_OutIt __CLRCALL_OR_CDECL _Put(_OutIt _Dest, const _Elem *_Ptr, size_t _Count) const
Definition: xlocnum:1634
#define CHAR_MAX
Definition: limits.h:24
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > _Mystr
Definition: xlocnum:1228
_Diff _Count
Definition: algorithm:1941
static constexpr _Fmtflags adjustfield
Definition: xiosbase:75
static constexpr _Fmtflags left
Definition: xiosbase:61
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
1636  { // put [_Ptr, _Ptr + _Count) to _Dest
1637  for (; 0 < _Count; --_Count, (void)++_Dest, ++_Ptr)
1638  *_Dest = *_Ptr;
1639  return (_Dest);
1640  }
unsigned _Dest
Definition: mbstring.h:107
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *terminate_handler)()
_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
1644  { // put _Count * _Ch to _Dest
1645  for (; 0 < _Count; --_Count, (void)++_Dest)
1646  *_Dest = _Ch;
1647  return (_Dest);
1648  }
unsigned _Dest
Definition: mbstring.h:107
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *terminate_handler)()
_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
1319  { // put formatted bool to _Dest
1320  if (!(_Iosbase.flags() & ios_base::boolalpha))
1321  return (do_put(_Dest, _Iosbase, _Fill, (long)_Val));
1322  else
1323  { // put "false" or "true"
1324  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
1325  _Mystr _Str;
1326  if (_Val)
1327  _Str.assign(_Punct_fac.truename());
1328  else
1329  _Str.assign(_Punct_fac.falsename());
1330 
1331  size_t _Fillcount = _Iosbase.width() <= 0
1332  || (size_t)_Iosbase.width() <= _Str.size()
1333  ? 0 : (size_t)_Iosbase.width() - _Str.size();
1334 
1335  if ((_Iosbase.flags() & ios_base::adjustfield) != ios_base::left)
1336  { // put leading fill
1337  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1338  _Fillcount = 0;
1339  }
1340  _Dest = _Put(_Dest, _Str.c_str(), _Str.size()); // put field
1341  _Iosbase.width(0);
1342  return (_Rep(_Dest, _Fill, _Fillcount)); // put trailing fill
1343  }
1344  }
numpunct< _Elem > _Mypunct
Definition: xlocnum:1226
unsigned _Dest
Definition: mbstring.h:107
unsigned int size_t
Definition: sourceannotations.h:19
#define _USE(loc, fac)
Definition: xlocale:499
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1317
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:375
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:420
_OutIt __CLRCALL_OR_CDECL _Rep(_OutIt _Dest, _Elem _Ch, size_t _Count) const
Definition: xlocnum:1642
_OutIt __CLRCALL_OR_CDECL _Put(_OutIt _Dest, const _Elem *_Ptr, size_t _Count) const
Definition: xlocnum:1634
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > _Mystr
Definition: xlocnum:1228
static constexpr _Fmtflags boolalpha
Definition: xiosbase:73
_FwdIt const _Ty _Val
Definition: algorithm:1938
static constexpr _Fmtflags adjustfield
Definition: xiosbase:75
static constexpr _Fmtflags left
Definition: xiosbase:61
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
1348  { // put formatted long to _Dest
1349  char _Buf[2 * _MAX_INT_DIG], _Fmt[6];
1350 
1351  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1352  _CSTD sprintf_s(_Buf, sizeof (_Buf), _Ifmt(_Fmt, "ld",
1353  _Iosbase.flags()), _Val)));
1354  }
Definition: regex:1559
unsigned _Dest
Definition: mbstring.h:107
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:375
#define _MAX_INT_DIG
Definition: yvals.h:578
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1575
#define _CSTD
Definition: yvals.h:570
_FwdIt const _Ty _Val
Definition: algorithm:1938
char *__CLRCALL_OR_CDECL _Ifmt(char *_Fmt, const char *_Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1547
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
1358  { // put formatted unsigned long to _Dest
1359  char _Buf[2 * _MAX_INT_DIG], _Fmt[6];
1360 
1361  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1362  _CSTD sprintf_s(_Buf, sizeof (_Buf), _Ifmt(_Fmt, "lu",
1363  _Iosbase.flags()), _Val)));
1364  }
Definition: regex:1559
unsigned _Dest
Definition: mbstring.h:107
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:375
#define _MAX_INT_DIG
Definition: yvals.h:578
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1575
#define _CSTD
Definition: yvals.h:570
_FwdIt const _Ty _Val
Definition: algorithm:1938
char *__CLRCALL_OR_CDECL _Ifmt(char *_Fmt, const char *_Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1547
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 long  _Val 
) const
inlineprotectedvirtual
1368  { // put formatted long long to _Dest
1369  char _Buf[2 * _MAX_INT_DIG], _Fmt[8];
1370 
1371  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1372  _CSTD sprintf_s(_Buf, sizeof (_Buf), _Ifmt(_Fmt, "Ld",
1373  _Iosbase.flags()), _Val)));
1374  }
Definition: regex:1559
unsigned _Dest
Definition: mbstring.h:107
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:375
#define _MAX_INT_DIG
Definition: yvals.h:578
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1575
#define _CSTD
Definition: yvals.h:570
_FwdIt const _Ty _Val
Definition: algorithm:1938
char *__CLRCALL_OR_CDECL _Ifmt(char *_Fmt, const char *_Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1547
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 long  _Val 
) const
inlineprotectedvirtual
1378  { // put formatted unsigned long long to _Dest
1379  char _Buf[2 * _MAX_INT_DIG], _Fmt[8];
1380 
1381  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1382  _CSTD sprintf_s(_Buf, sizeof (_Buf), _Ifmt(_Fmt, "Lu",
1383  _Iosbase.flags()), _Val)));
1384  }
Definition: regex:1559
unsigned _Dest
Definition: mbstring.h:107
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:375
#define _MAX_INT_DIG
Definition: yvals.h:578
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1575
#define _CSTD
Definition: yvals.h:570
_FwdIt const _Ty _Val
Definition: algorithm:1938
char *__CLRCALL_OR_CDECL _Ifmt(char *_Fmt, const char *_Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1547
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
1388  { // put formatted double to _Dest
1389  string _Buf;
1390  char _Fmt[8];
1391  bool _Isfixed = (_Iosbase.flags() & ios_base::floatfield)
1392  == ios_base::fixed;
1393  streamsize _Precision = _Iosbase.precision() <= 0 && !_Isfixed
1394  ? 6 : _Iosbase.precision(); // desired precision
1395  size_t _Bufsize = (size_t)_Precision;
1396  if (_Isfixed && 1e10 < _CSTD fabs(_Val))
1397  { // f or F format
1398  int _Ptwo;
1399  (void)_CSTD frexp(_Val, &_Ptwo);
1400  _Bufsize += _CSTD abs(_Ptwo) * 30103L / 100000L;
1401  }
1402  _Buf.resize(_Bufsize + 50); // add fudge factor
1403 
1404  int _Ngen = _CSTD sprintf_s((char *)_Buf.c_str(), _Buf.size(),
1405  _Ffmt(_Fmt, 0, _Iosbase.flags()), (int)_Precision, _Val);
1406 
1407  return (_Fput(_Dest, _Iosbase, _Fill, _Buf.c_str(), _Ngen));
1408  }
return
Definition: corecrt_memcpy_s.h:60
_Ret_z_ const _Elem * c_str() const _NOEXCEPT
Definition: xstring:3001
long long streamsize
Definition: iosfwd:23
Definition: regex:1559
unsigned _Dest
Definition: mbstring.h:107
unsigned int size_t
Definition: sourceannotations.h:19
streamsize __CLR_OR_THIS_CALL precision() const
Definition: xiosbase:408
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:375
_OutIt __CLRCALL_OR_CDECL _Fput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, const char *_Buf, size_t _Count) const
Definition: xlocnum:1473
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *terminate_handler)()
float frexp(float _X, _Out_ int *_Exp) __GPU_ONLY
Gets the mantissa and exponent of _X
Definition: amp_math.h:669
char *__CLRCALL_OR_CDECL _Ffmt(char *_Fmt, char _Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1444
int abs(int _X) __GPU_ONLY
Returns the absolute value of the argument
Definition: amp.h:7221
static constexpr _Fmtflags floatfield
Definition: xiosbase:79
static constexpr _Fmtflags fixed
Definition: xiosbase:68
size_type size() const _NOEXCEPT
Definition: xstring:3023
#define _CSTD
Definition: yvals.h:570
void resize(_CRT_GUARDOVERFLOW const size_type _Newsize)
Definition: xstring:3034
_FwdIt const _Ty _Val
Definition: algorithm:1938
float fabs(float _X) __GPU_ONLY
Returns the absolute value of the argument
Definition: amp_math.h:241
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
1412  { // put formatted long double to _Dest
1413  string _Buf;
1414  char _Fmt[8];
1415  bool _Isfixed = (_Iosbase.flags() & ios_base::floatfield)
1416  == ios_base::fixed;
1417  streamsize _Precision = _Iosbase.precision() <= 0 && !_Isfixed
1418  ? 6 : _Iosbase.precision(); // desired precision
1419  size_t _Bufsize = (size_t)_Precision;
1420  if (_Isfixed && 1e10 < _CSTD fabsl(_Val))
1421  { // f or F format
1422  int _Ptwo;
1423  (void)_CSTD frexpl(_Val, &_Ptwo);
1424  _Bufsize += _CSTD abs(_Ptwo) * 30103L / 100000L;
1425  }
1426  _Buf.resize(_Bufsize + 50); // add fudge factor
1427 
1428  int _Ngen = _CSTD sprintf_s((char *)_Buf.c_str(), _Buf.size(),
1429  _Ffmt(_Fmt, 'L', _Iosbase.flags()), (int)_Precision, _Val);
1430 
1431  return (_Fput(_Dest, _Iosbase, _Fill, _Buf.c_str(), _Ngen));
1432  }
return
Definition: corecrt_memcpy_s.h:60
_Ret_z_ const _Elem * c_str() const _NOEXCEPT
Definition: xstring:3001
long long streamsize
Definition: iosfwd:23
Definition: regex:1559
unsigned _Dest
Definition: mbstring.h:107
unsigned int size_t
Definition: sourceannotations.h:19
_Check_return_ __inline long double __CRTDECL frexpl(_In_ long double _X, _Out_ int *_Y)
Definition: corecrt_math.h:861
streamsize __CLR_OR_THIS_CALL precision() const
Definition: xiosbase:408
_Check_return_ __inline long double __CRTDECL fabsl(_In_ long double _X)
Definition: corecrt_math.h:840
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:375
_OutIt __CLRCALL_OR_CDECL _Fput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, const char *_Buf, size_t _Count) const
Definition: xlocnum:1473
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *terminate_handler)()
char *__CLRCALL_OR_CDECL _Ffmt(char *_Fmt, char _Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1444
int abs(int _X) __GPU_ONLY
Returns the absolute value of the argument
Definition: amp.h:7221
static constexpr _Fmtflags floatfield
Definition: xiosbase:79
static constexpr _Fmtflags fixed
Definition: xiosbase:68
size_type size() const _NOEXCEPT
Definition: xstring:3023
#define _CSTD
Definition: yvals.h:570
void resize(_CRT_GUARDOVERFLOW const size_type _Newsize)
Definition: xstring:3034
_FwdIt const _Ty _Val
Definition: algorithm:1938
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
1436  { // put formatted void pointer to _Dest
1437  char _Buf[2 * _MAX_INT_DIG];
1438 
1439  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1440  _CSTD sprintf_s(_Buf, sizeof (_Buf), "%p", _Val)));
1441  }
Definition: regex:1559
unsigned _Dest
Definition: mbstring.h:107
#define _MAX_INT_DIG
Definition: yvals.h:578
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1575
#define _CSTD
Definition: yvals.h:570
_FwdIt const _Ty _Val
Definition: algorithm:1938
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
1270  { // put formatted bool to _Dest
1271  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1272  }
unsigned _Dest
Definition: mbstring.h:107
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1317
_FwdIt const _Ty _Val
Definition: algorithm:1938
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
1276  { // put formatted long to _Dest
1277  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1278  }
unsigned _Dest
Definition: mbstring.h:107
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1317
_FwdIt const _Ty _Val
Definition: algorithm:1938
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
1282  { // put formatted unsigned long to _Dest
1283  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1284  }
unsigned _Dest
Definition: mbstring.h:107
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1317
_FwdIt const _Ty _Val
Definition: algorithm:1938
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 long  _Val 
) const
inline
1288  { // put formatted long long to _Dest
1289  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1290  }
unsigned _Dest
Definition: mbstring.h:107
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1317
_FwdIt const _Ty _Val
Definition: algorithm:1938
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 long  _Val 
) const
inline
1294  { // put formatted unsigned long long to _Dest
1295  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1296  }
unsigned _Dest
Definition: mbstring.h:107
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1317
_FwdIt const _Ty _Val
Definition: algorithm:1938
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
1300  { // put formatted double to _Dest
1301  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1302  }
unsigned _Dest
Definition: mbstring.h:107
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1317
_FwdIt const _Ty _Val
Definition: algorithm:1938
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
1306  { // put formatted long double to _Dest
1307  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1308  }
unsigned _Dest
Definition: mbstring.h:107
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1317
_FwdIt const _Ty _Val
Definition: algorithm:1938
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
1312  { // put formatted void pointer to _Dest
1313  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1314  }
unsigned _Dest
Definition: mbstring.h:107
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1317
_FwdIt const _Ty _Val
Definition: algorithm:1938

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: