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, _LONGLONG _Val) const
 
_OutIt __CLR_OR_THIS_CALL put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, _ULONGLONG _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, _LONGLONG _Val) const
 
virtual _OutIt __CLR_OR_THIS_CALL do_put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, _ULONGLONG _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
1179  { // destroy the object
1180  }
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
1188  : locale::facet(_Refs)
1189  { // construct from current locale
1190  _BEGIN_LOCINFO(_Lobj)
1191  _Init(_Lobj);
1192  _END_LOCINFO()
1193  }
void __CLR_OR_THIS_CALL _Init(const _Locinfo &)
Definition: xlocnum:1182
Definition: xlocale:138
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
1196  : locale::facet(_Refs)
1197  { // construct from specified locale
1198  _Init(_Lobj);
1199  }
void __CLR_OR_THIS_CALL _Init(const _Locinfo &)
Definition: xlocnum:1182
Definition: xlocale:138

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
1383  { // generate sprintf format for floating-point
1384  char *_Ptr = _Fmt;
1385  *_Ptr++ = '%';
1386 
1387  if (_Flags & ios_base::showpos)
1388  *_Ptr++ = '+';
1389  if (_Flags & ios_base::showpoint)
1390  *_Ptr++ = '#';
1391  *_Ptr++ = '.';
1392  *_Ptr++ = '*'; // for precision argument
1393  if (_Spec != '\0')
1394  *_Ptr++ = _Spec; // 'L' qualifier for long double only
1395 
1396  ios_base::fmtflags _Ffl = _Flags & ios_base::floatfield;
1397  if (_Flags & ios_base::uppercase)
1398  *_Ptr++ = _Ffl == ios_base::fixed ? 'f'
1399  : _Ffl == ios_base::hexfloat ? 'A' // added with TR1
1400  : _Ffl == ios_base::scientific ? 'E' : 'G'; // specifier
1401  else
1402  *_Ptr++ = _Ffl == ios_base::fixed ? 'f'
1403  : _Ffl == ios_base::hexfloat ? 'a' // added with TR1
1404  : _Ffl == ios_base::scientific ? 'e' : 'g'; // specifier
1405 
1406  *_Ptr = '\0';
1407  return (_Fmt);
1408  }
static constexpr _Fmtflags uppercase
Definition: xiosbase:58
static constexpr _Fmtflags showpoint
Definition: xiosbase:60
static constexpr _Fmtflags showpos
Definition: xiosbase:61
static constexpr _Fmtflags scientific
Definition: xiosbase:68
static constexpr _Fmtflags floatfield
Definition: xiosbase:80
static constexpr _Fmtflags fixed
Definition: xiosbase:69
static constexpr _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  _Count 
) const
inlineprivate
1413  { // put formatted floating-point to _Dest
1414  _DEBUG_POINTER(_Dest);
1415  size_t _Prefix = 0 < _Count && (*_Buf == '+' || *_Buf == '-')
1416  ? 1 : 0;
1417 
1418  const char *_Exps;
1419  if ((_Iosbase.flags() & ios_base::floatfield) != ios_base::hexfloat)
1420  _Exps = "eE";
1421  else
1422  { // correct for hexadecimal floating-point
1423  _Exps = "pP";
1424  if (_Prefix + 2 <= _Count && _Buf[_Prefix] == '0'
1425  && (_Buf[_Prefix + 1] == 'x' || _Buf[_Prefix + 1] == 'X'))
1426  _Prefix += 2;
1427  }
1428  const size_t _Eoff =
1429  _CSTD strcspn(&_Buf[0], _Exps); // find exponent
1430  char _Dp[2] = {"."};
1431  _Dp[0] = _CSTD localeconv()->decimal_point[0];
1432  const size_t _Poff =
1433  _CSTD strcspn(&_Buf[0], &_Dp[0]); // find decimal point
1434 
1435  const ctype<_Elem>& _Ctype_fac =
1436  _USE(_Iosbase.getloc(), ctype<_Elem>);
1437  _Mystr _Groupstring(_Count, _Elem(0)); // reserve space
1438  _Ctype_fac.widen(&_Buf[0], &_Buf[_Count], &_Groupstring[0]);
1439 
1440  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
1441  const string _Grouping = _Punct_fac.grouping();
1442  const _Elem _Kseparator = _Punct_fac.thousands_sep();
1443 
1444  if (_Poff != _Count)
1445  _Groupstring[_Poff] = _Punct_fac.decimal_point();
1446 
1447  size_t _Off = _Poff == _Count ? _Eoff : _Poff;
1448  const char *_Pg = &_Grouping[0];
1449  while (*_Pg != CHAR_MAX && '\0' < *_Pg
1450  && (size_t)*_Pg < _Off - _Prefix)
1451  { // add thousands separator
1452  _Groupstring.insert(_Off -= *_Pg, (size_t)1, _Kseparator);
1453  if ('\0' < _Pg[1])
1454  ++_Pg; // not last group, advance
1455  }
1456 
1457  _Count = _Groupstring.size();
1458  size_t _Fillcount = _Iosbase.width() <= 0
1459  || (size_t)_Iosbase.width() <= _Count
1460  ? 0 : (size_t)_Iosbase.width() - _Count;
1461 
1462  ios_base::fmtflags _Adjustfield =
1463  _Iosbase.flags() & ios_base::adjustfield;
1464  if (_Adjustfield != ios_base::left
1465  && _Adjustfield != ios_base::internal)
1466  { // put leading fill
1467  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1468  _Fillcount = 0;
1469  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1470  }
1471  else if (_Adjustfield == ios_base::internal)
1472  { // put internal fill
1473  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1474  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1475  _Fillcount = 0;
1476  }
1477  else
1478  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1479 
1480  _Dest = _Put(_Dest, &_Groupstring[_Prefix], _Count - _Prefix);
1481  _Iosbase.width(0);
1482  return (_Rep(_Dest, _Fill, _Fillcount)); // put trailing fill
1483  }
unsigned int _Count
Definition: xcomplex:668
numpunct< _Elem > _Mypunct
Definition: xlocnum:1162
Definition: regex:1539
#define _USE(loc, fac)
Definition: xlocale:547
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
unsigned int size_t
Definition: sourceannotations.h:19
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
Definition: xlocale:2115
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:421
_OutIt __CLRCALL_OR_CDECL _Rep(_OutIt _Dest, _Elem _Ch, size_t _Count) const
Definition: xlocnum:1581
#define _DEBUG_POINTER(first)
Definition: xutility:819
static constexpr _Fmtflags internal
Definition: xiosbase:64
static constexpr _Fmtflags floatfield
Definition: xiosbase:80
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: xlocale:2164
_OutIt __CLRCALL_OR_CDECL _Put(_OutIt _Dest, const _Elem *_Ptr, size_t _Count) const
Definition: xlocnum:1573
static constexpr _Fmtflags hexfloat
Definition: xiosbase:71
#define CHAR_MAX
Definition: limits.h:24
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > _Mystr
Definition: xlocnum:1164
#define _CSTD
Definition: yvals.h:570
static constexpr _Fmtflags adjustfield
Definition: xiosbase:76
static constexpr _Fmtflags left
Definition: xiosbase:62
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
1168  { // return locale category mask and construct standard facet
1169  if (_Ppf != 0 && *_Ppf == 0)
1170  *_Ppf = new num_put<_Elem, _OutIt>(
1171  _Locinfo(_Ploc->c_str()));
1172  return (_X_NUMERIC);
1173  }
Definition: xlocinfo:54
const char * c_str() const
Definition: xlocale:452
#define _X_NUMERIC
Definition: xlocinfo.h:41
Definition: xlocnum:1158
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
1487  { // generate sprintf format for integer
1488  char *_Ptr = _Fmt;
1489  *_Ptr++ = '%';
1490 
1491  if (_Flags & ios_base::showpos)
1492  *_Ptr++ = '+';
1493  if (_Flags & ios_base::showbase)
1494  *_Ptr++ = '#';
1495  if (_Spec[0] != 'L')
1496  *_Ptr++ = _Spec[0]; // qualifier
1497  else
1498 
1499  { /* change L to I64 */
1500  *_Ptr++ = 'I';
1501  *_Ptr++ = '6';
1502  *_Ptr++ = '4';
1503  }
1504 
1505  ios_base::fmtflags _Basefield = _Flags & ios_base::basefield;
1506  *_Ptr++ = _Basefield == ios_base::oct ? 'o'
1507  : _Basefield != ios_base::hex ? _Spec[1] // 'd' or 'u'
1508  : _Flags & ios_base::uppercase ? 'X' : 'x';
1509  *_Ptr = '\0';
1510  return (_Fmt);
1511  }
static constexpr _Fmtflags hex
Definition: xiosbase:67
static constexpr _Fmtflags basefield
Definition: xiosbase:78
static constexpr _Fmtflags uppercase
Definition: xiosbase:58
static constexpr _Fmtflags oct
Definition: xiosbase:66
static constexpr _Fmtflags showpos
Definition: xiosbase:61
static constexpr _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
1183  { // initialize from _Locinfo object
1184  }
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
1515  { // put formatted integer to _Dest
1516  _DEBUG_POINTER(_Dest);
1517  size_t _Prefix = 0 < _Count && (*_Buf == '+' || *_Buf == '-')
1518  ? 1 : 0;
1519  if ((_Iosbase.flags() & ios_base::basefield) == ios_base::hex
1520  && _Prefix + 2 <= _Count && _Buf[_Prefix] == '0'
1521  && (_Buf[_Prefix + 1] == 'x' || _Buf[_Prefix + 1] == 'X'))
1522  _Prefix += 2;
1523 
1524  const ctype<_Elem>& _Ctype_fac =
1525  _USE(_Iosbase.getloc(), ctype<_Elem>);
1526  _Mystr _Groupstring(_Count, _Elem(0)); // reserve space
1527  _Ctype_fac.widen(&_Buf[0], &_Buf[_Count], &_Groupstring[0]);
1528 
1529  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
1530  const string _Grouping = _Punct_fac.grouping();
1531  const char *_Pg = &_Grouping[0];
1532  if (*_Pg != CHAR_MAX && '\0' < *_Pg)
1533  { // grouping specified, add thousands separators
1534  const _Elem _Kseparator = _Punct_fac.thousands_sep();
1535  while (*_Pg != CHAR_MAX && '\0' < *_Pg
1536  && (size_t)*_Pg < _Count - _Prefix)
1537  { // insert thousands separator
1538  _Count -= *_Pg;
1539  _Groupstring.insert(_Count, 1, _Kseparator);
1540  if ('\0' < _Pg[1])
1541  ++_Pg; // not last group, advance
1542  }
1543  }
1544 
1545  _Count = _Groupstring.size();
1546  size_t _Fillcount = _Iosbase.width() <= 0
1547  || (size_t)_Iosbase.width() <= _Count
1548  ? 0 : (size_t)_Iosbase.width() - _Count;
1549 
1550  ios_base::fmtflags _Adjustfield =
1551  _Iosbase.flags() & ios_base::adjustfield;
1552  if (_Adjustfield != ios_base::left
1553  && _Adjustfield != ios_base::internal)
1554  { // put leading fill
1555  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1556  _Fillcount = 0;
1557  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1558  }
1559  else if (_Adjustfield == ios_base::internal)
1560  { // put internal fill
1561  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1562  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1563  _Fillcount = 0;
1564  }
1565  else
1566  _Dest = _Put(_Dest, &_Groupstring[0], _Prefix);
1567 
1568  _Dest = _Put(_Dest, &_Groupstring[_Prefix], _Count - _Prefix);
1569  _Iosbase.width(0);
1570  return (_Rep(_Dest, _Fill, _Fillcount)); // put trailing fill
1571  }
static constexpr _Fmtflags hex
Definition: xiosbase:67
unsigned int _Count
Definition: xcomplex:668
numpunct< _Elem > _Mypunct
Definition: xlocnum:1162
Definition: regex:1539
static constexpr _Fmtflags basefield
Definition: xiosbase:78
#define _USE(loc, fac)
Definition: xlocale:547
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
unsigned int size_t
Definition: sourceannotations.h:19
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
Definition: xlocale:2115
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:421
_OutIt __CLRCALL_OR_CDECL _Rep(_OutIt _Dest, _Elem _Ch, size_t _Count) const
Definition: xlocnum:1581
#define _DEBUG_POINTER(first)
Definition: xutility:819
static constexpr _Fmtflags internal
Definition: xiosbase:64
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: xlocale:2164
_OutIt __CLRCALL_OR_CDECL _Put(_OutIt _Dest, const _Elem *_Ptr, size_t _Count) const
Definition: xlocnum:1573
#define CHAR_MAX
Definition: limits.h:24
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > _Mystr
Definition: xlocnum:1164
static constexpr _Fmtflags adjustfield
Definition: xiosbase:76
static constexpr _Fmtflags left
Definition: xiosbase:62
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
1575  { // put [_Ptr, _Ptr + _Count) to _Dest
1576  for (; 0 < _Count; --_Count, (void)++_Dest, ++_Ptr)
1577  *_Dest = *_Ptr;
1578  return (_Dest);
1579  }
unsigned int _Count
Definition: xcomplex:668
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
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
1583  { // put _Count * _Ch to _Dest
1584  for (; 0 < _Count; --_Count, (void)++_Dest)
1585  *_Dest = _Ch;
1586  return (_Dest);
1587  }
unsigned int _Count
Definition: xcomplex:668
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
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
1255  { // put formatted bool to _Dest
1256  _DEBUG_POINTER(_Dest);
1257  if (!(_Iosbase.flags() & ios_base::boolalpha))
1258  return (do_put(_Dest, _Iosbase, _Fill, (long)_Val));
1259  else
1260  { // put "false" or "true"
1261  const _Mypunct& _Punct_fac = _USE(_Iosbase.getloc(), _Mypunct);
1262  _Mystr _Str;
1263  if (_Val)
1264  _Str.assign(_Punct_fac.truename());
1265  else
1266  _Str.assign(_Punct_fac.falsename());
1267 
1268  size_t _Fillcount = _Iosbase.width() <= 0
1269  || (size_t)_Iosbase.width() <= _Str.size()
1270  ? 0 : (size_t)_Iosbase.width() - _Str.size();
1271 
1272  if ((_Iosbase.flags() & ios_base::adjustfield) != ios_base::left)
1273  { // put leading fill
1274  _Dest = _Rep(_Dest, _Fill, _Fillcount);
1275  _Fillcount = 0;
1276  }
1277  _Dest = _Put(_Dest, _Str.c_str(), _Str.size()); // put field
1278  _Iosbase.width(0);
1279  return (_Rep(_Dest, _Fill, _Fillcount)); // put trailing fill
1280  }
1281  }
numpunct< _Elem > _Mypunct
Definition: xlocnum:1162
#define _USE(loc, fac)
Definition: xlocale:547
_In_ int _Val
Definition: vcruntime_string.h:62
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1253
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
unsigned int size_t
Definition: sourceannotations.h:19
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:421
_OutIt __CLRCALL_OR_CDECL _Rep(_OutIt _Dest, _Elem _Ch, size_t _Count) const
Definition: xlocnum:1581
#define _DEBUG_POINTER(first)
Definition: xutility:819
_OutIt __CLRCALL_OR_CDECL _Put(_OutIt _Dest, const _Elem *_Ptr, size_t _Count) const
Definition: xlocnum:1573
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > _Mystr
Definition: xlocnum:1164
static constexpr _Fmtflags boolalpha
Definition: xiosbase:74
static constexpr _Fmtflags adjustfield
Definition: xiosbase:76
static constexpr _Fmtflags left
Definition: xiosbase:62
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
1285  { // put formatted long to _Dest
1286  char _Buf[2 * _MAX_INT_DIG], _Fmt[6];
1287 
1288  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1289  _CSTD sprintf_s(_Buf, sizeof (_Buf), _Ifmt(_Fmt, "ld",
1290  _Iosbase.flags()), _Val)));
1291  }
Definition: regex:1539
_In_ int _Val
Definition: vcruntime_string.h:62
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
#define _MAX_INT_DIG
Definition: yvals.h:588
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1513
#define _CSTD
Definition: yvals.h:570
char *__CLRCALL_OR_CDECL _Ifmt(char *_Fmt, const char *_Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1485
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
1295  { // put formatted unsigned long to _Dest
1296  char _Buf[2 * _MAX_INT_DIG], _Fmt[6];
1297 
1298  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1299  _CSTD sprintf_s(_Buf, sizeof (_Buf), _Ifmt(_Fmt, "lu",
1300  _Iosbase.flags()), _Val)));
1301  }
Definition: regex:1539
_In_ int _Val
Definition: vcruntime_string.h:62
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
#define _MAX_INT_DIG
Definition: yvals.h:588
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1513
#define _CSTD
Definition: yvals.h:570
char *__CLRCALL_OR_CDECL _Ifmt(char *_Fmt, const char *_Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1485
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,
_LONGLONG  _Val 
) const
inlineprotectedvirtual
1305  { // put formatted long long to _Dest
1306  char _Buf[2 * _MAX_INT_DIG], _Fmt[8];
1307 
1308  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1309  _CSTD sprintf_s(_Buf, sizeof (_Buf), _Ifmt(_Fmt, "Ld",
1310  _Iosbase.flags()), _Val)));
1311  }
Definition: regex:1539
_In_ int _Val
Definition: vcruntime_string.h:62
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
#define _MAX_INT_DIG
Definition: yvals.h:588
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1513
#define _CSTD
Definition: yvals.h:570
char *__CLRCALL_OR_CDECL _Ifmt(char *_Fmt, const char *_Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1485
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,
_ULONGLONG  _Val 
) const
inlineprotectedvirtual
1315  { // put formatted unsigned long long to _Dest
1316  char _Buf[2 * _MAX_INT_DIG], _Fmt[8];
1317 
1318  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1319  _CSTD sprintf_s(_Buf, sizeof (_Buf), _Ifmt(_Fmt, "Lu",
1320  _Iosbase.flags()), _Val)));
1321  }
Definition: regex:1539
_In_ int _Val
Definition: vcruntime_string.h:62
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
#define _MAX_INT_DIG
Definition: yvals.h:588
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1513
#define _CSTD
Definition: yvals.h:570
char *__CLRCALL_OR_CDECL _Ifmt(char *_Fmt, const char *_Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1485
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
1325  { // put formatted double to _Dest
1326  string _Buf;
1327  char _Fmt[8];
1328  bool _Isfixed = (_Iosbase.flags() & ios_base::floatfield)
1329  == ios_base::fixed;
1330  streamsize _Precision = _Iosbase.precision() <= 0 && !_Isfixed
1331  ? 6 : _Iosbase.precision(); // desired precision
1332  size_t _Bufsize = (size_t)_Precision;
1333  if (_Isfixed && 1e10 < _CSTD fabs(_Val))
1334  { // f or F format
1335  int _Ptwo;
1336  (void)_CSTD frexp(_Val, &_Ptwo);
1337  _Bufsize += _CSTD abs(_Ptwo) * 30103L / 100000L;
1338  }
1339  _Buf.resize(_Bufsize + 50); // add fudge factor
1340 
1341  int _Ngen = _CSTD sprintf_s((char *)_Buf.c_str(), _Buf.size(),
1342  _Ffmt(_Fmt, 0, _Iosbase.flags()), (int)_Precision, _Val);
1343 
1344  return (_Fput(_Dest, _Iosbase, _Fill, _Buf.c_str(), _Ngen));
1345  }
_Longlong streamsize
Definition: iosfwd:22
Definition: regex:1539
_In_ int _Val
Definition: vcruntime_string.h:62
streamsize __CLR_OR_THIS_CALL precision() const
Definition: xiosbase:409
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
_OutIt __CLRCALL_OR_CDECL _Fput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, const char *_Buf, size_t _Count) const
Definition: xlocnum:1410
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:1381
int abs(int _X) __GPU_ONLY
Returns the absolute value of the argument
Definition: amp.h:7221
static constexpr _Fmtflags floatfield
Definition: xiosbase:80
static constexpr _Fmtflags fixed
Definition: xiosbase:69
return(_PAIR_TYPE(_FwdIt)(_First, _First))
size_type size() const _NOEXCEPT
Definition: xstring:1763
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
#define _CSTD
Definition: yvals.h:570
void resize(size_type _Newsize)
Definition: xstring:1774
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
1349  { // put formatted long double to _Dest
1350  string _Buf;
1351  char _Fmt[8];
1352  bool _Isfixed = (_Iosbase.flags() & ios_base::floatfield)
1353  == ios_base::fixed;
1354  streamsize _Precision = _Iosbase.precision() <= 0 && !_Isfixed
1355  ? 6 : _Iosbase.precision(); // desired precision
1356  size_t _Bufsize = (size_t)_Precision;
1357  if (_Isfixed && 1e10 < _CSTD fabsl(_Val))
1358  { // f or F format
1359  int _Ptwo;
1360  (void)_CSTD frexpl(_Val, &_Ptwo);
1361  _Bufsize += _CSTD abs(_Ptwo) * 30103L / 100000L;
1362  }
1363  _Buf.resize(_Bufsize + 50); // add fudge factor
1364 
1365  int _Ngen = _CSTD sprintf_s((char *)_Buf.c_str(), _Buf.size(),
1366  _Ffmt(_Fmt, 'L', _Iosbase.flags()), (int)_Precision, _Val);
1367 
1368  return (_Fput(_Dest, _Iosbase, _Fill, _Buf.c_str(), _Ngen));
1369  }
_Longlong streamsize
Definition: iosfwd:22
Definition: regex:1539
_In_ int _Val
Definition: vcruntime_string.h:62
streamsize __CLR_OR_THIS_CALL precision() const
Definition: xiosbase:409
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
_OutIt __CLRCALL_OR_CDECL _Fput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, const char *_Buf, size_t _Count) const
Definition: xlocnum:1410
char *__CLRCALL_OR_CDECL _Ffmt(char *_Fmt, char _Spec, ios_base::fmtflags _Flags) const
Definition: xlocnum:1381
int abs(int _X) __GPU_ONLY
Returns the absolute value of the argument
Definition: amp.h:7221
static constexpr _Fmtflags floatfield
Definition: xiosbase:80
static constexpr _Fmtflags fixed
Definition: xiosbase:69
return(_PAIR_TYPE(_FwdIt)(_First, _First))
size_type size() const _NOEXCEPT
Definition: xstring:1763
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
#define _CSTD
Definition: yvals.h:570
void resize(size_type _Newsize)
Definition: xstring:1774
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
1373  { // put formatted void pointer to _Dest
1374  char _Buf[2 * _MAX_INT_DIG];
1375 
1376  return (_Iput(_Dest, _Iosbase, _Fill, _Buf,
1377  _CSTD sprintf_s(_Buf, sizeof (_Buf), "%p", _Val)));
1378  }
Definition: regex:1539
_In_ int _Val
Definition: vcruntime_string.h:62
#define _MAX_INT_DIG
Definition: yvals.h:588
_OutIt __CLRCALL_OR_CDECL _Iput(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, char *_Buf, size_t _Count) const
Definition: xlocnum:1513
#define _CSTD
Definition: yvals.h:570
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
1206  { // put formatted bool to _Dest
1207  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1208  }
_In_ int _Val
Definition: vcruntime_string.h:62
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1253
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
1212  { // put formatted long to _Dest
1213  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1214  }
_In_ int _Val
Definition: vcruntime_string.h:62
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1253
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
1218  { // put formatted unsigned long to _Dest
1219  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1220  }
_In_ int _Val
Definition: vcruntime_string.h:62
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1253
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,
_LONGLONG  _Val 
) const
inline
1224  { // put formatted long long to _Dest
1225  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1226  }
_In_ int _Val
Definition: vcruntime_string.h:62
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1253
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,
_ULONGLONG  _Val 
) const
inline
1230  { // put formatted unsigned long long to _Dest
1231  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1232  }
_In_ int _Val
Definition: vcruntime_string.h:62
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1253
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
1236  { // put formatted double to _Dest
1237  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1238  }
_In_ int _Val
Definition: vcruntime_string.h:62
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1253
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
1242  { // put formatted long double to _Dest
1243  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1244  }
_In_ int _Val
Definition: vcruntime_string.h:62
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1253
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
1248  { // put formatted void pointer to _Dest
1249  return (do_put(_Dest, _Iosbase, _Fill, _Val));
1250  }
_In_ int _Val
Definition: vcruntime_string.h:62
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, bool _Val) const
Definition: xlocnum:1253

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: