STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Macros | Functions
string File Reference
#include <iterator>

Macros

#define _STRING_
 
#define _STRTO_LL   _strtoi64
 
#define _STRTO_ULL   _strtoui64
 
#define _STRTO_F   strtod
 
#define _STRTO_LD   strtod
 
#define _WCSTO_LL   _wcstoi64
 
#define _WCSTO_ULL   _wcstoui64
 
#define _WCSTO_F   wcstod
 
#define _WCSTO_LD   wcstod
 
#define _LLFMT   "%I64"
 
#define _TOSTRING(buf, fmt, val)   sprintf_s(buf, sizeof (buf), fmt, val)
 
#define _WLLFMT   L"%I64"
 
#define _TOWSTRING(buf, fmt, val)   swprintf_s(buf, sizeof (buf) / sizeof (wchar_t), fmt, val)
 

Functions

template<class _Elem , class _Traits , class _Alloc >
_STD_BEGIN basic_istream< _Elem, _Traits > & operator>> (basic_istream< _Elem, _Traits > &&_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str)
 
template<class _Elem , class _Traits , class _Alloc >
basic_istream< _Elem, _Traits > & getline (basic_istream< _Elem, _Traits > &&_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str, const _Elem _Delim)
 
template<class _Elem , class _Traits , class _Alloc >
basic_istream< _Elem, _Traits > & getline (basic_istream< _Elem, _Traits > &&_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str)
 
template<class _Elem , class _Traits , class _Alloc >
basic_istream< _Elem, _Traits > & operator>> (basic_istream< _Elem, _Traits > &_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str)
 
template<class _Elem , class _Traits , class _Alloc >
basic_istream< _Elem, _Traits > & getline (basic_istream< _Elem, _Traits > &_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str, const _Elem _Delim)
 
template<class _Elem , class _Traits , class _Alloc >
basic_istream< _Elem, _Traits > & getline (basic_istream< _Elem, _Traits > &_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str)
 
template<class _Elem , class _Traits , class _Alloc >
basic_ostream< _Elem, _Traits > & operator<< (basic_ostream< _Elem, _Traits > &_Ostr, const basic_string< _Elem, _Traits, _Alloc > &_Str)
 
int stoi (const string &_Str, size_t *_Idx=0, int _Base=10)
 
long stol (const string &_Str, size_t *_Idx=0, int _Base=10)
 
unsigned long stoul (const string &_Str, size_t *_Idx=0, int _Base=10)
 
_Longlong stoll (const string &_Str, size_t *_Idx=0, int _Base=10)
 
_ULonglong stoull (const string &_Str, size_t *_Idx=0, int _Base=10)
 
float stof (const string &_Str, size_t *_Idx=0)
 
double stod (const string &_Str, size_t *_Idx=0)
 
long double stold (const string &_Str, size_t *_Idx=0)
 
int stoi (const wstring &_Str, size_t *_Idx=0, int _Base=10)
 
long stol (const wstring &_Str, size_t *_Idx=0, int _Base=10)
 
unsigned long stoul (const wstring &_Str, size_t *_Idx=0, int _Base=10)
 
_Longlong stoll (const wstring &_Str, size_t *_Idx=0, int _Base=10)
 
_ULonglong stoull (const wstring &_Str, size_t *_Idx=0, int _Base=10)
 
float stof (const wstring &_Str, size_t *_Idx=0)
 
double stod (const wstring &_Str, size_t *_Idx=0)
 
long double stold (const wstring &_Str, size_t *_Idx=0)
 
string to_string (int _Val)
 
string to_string (unsigned int _Val)
 
string to_string (long _Val)
 
string to_string (unsigned long _Val)
 
string to_string (_Longlong _Val)
 
string to_string (_ULonglong _Val)
 
string to_string (long double _Val)
 
string to_string (double _Val)
 
string to_string (float _Val)
 
wstring to_wstring (int _Val)
 
wstring to_wstring (unsigned int _Val)
 
wstring to_wstring (long _Val)
 
wstring to_wstring (unsigned long _Val)
 
wstring to_wstring (_Longlong _Val)
 
wstring to_wstring (_ULonglong _Val)
 
wstring to_wstring (long double _Val)
 
wstring to_wstring (double _Val)
 
wstring to_wstring (float _Val)
 

Macro Definition Documentation

#define _LLFMT   "%I64"
#define _STRING_
#define _STRTO_F   strtod
#define _STRTO_LD   strtod
#define _STRTO_LL   _strtoi64
#define _STRTO_ULL   _strtoui64
#define _TOSTRING (   buf,
  fmt,
  val 
)    sprintf_s(buf, sizeof (buf), fmt, val)
#define _TOWSTRING (   buf,
  fmt,
  val 
)    swprintf_s(buf, sizeof (buf) / sizeof (wchar_t), fmt, val)
#define _WCSTO_F   wcstod
#define _WCSTO_LD   wcstod
#define _WCSTO_LL   _wcstoi64
#define _WCSTO_ULL   _wcstoui64
#define _WLLFMT   L"%I64"

Function Documentation

template<class _Elem , class _Traits , class _Alloc >
basic_istream<_Elem, _Traits>& getline ( basic_istream< _Elem, _Traits > &&  _Istr,
basic_string< _Elem, _Traits, _Alloc > &  _Str,
const _Elem  _Delim 
)
inline
76  { // get characters into string, discard delimiter
77  typedef basic_istream<_Elem, _Traits> _Myis;
78 
79  ios_base::iostate _State = ios_base::goodbit;
80  bool _Changed = false;
81  const typename _Myis::sentry _Ok(_Istr, true);
82 
83  if (_Ok)
84  { // state okay, extract characters
86  _Str.erase();
87  const typename _Traits::int_type _Metadelim =
88  _Traits::to_int_type(_Delim);
89  typename _Traits::int_type _Meta = _Istr.rdbuf()->sgetc();
90 
91  for (; ; _Meta = _Istr.rdbuf()->snextc())
92  if (_Traits::eq_int_type(_Traits::eof(), _Meta))
93  { // end of file, quit
94  _State |= ios_base::eofbit;
95  break;
96  }
97  else if (_Traits::eq_int_type(_Meta, _Metadelim))
98  { // got a delimiter, discard it and quit
99  _Changed = true;
100  _Istr.rdbuf()->sbumpc();
101  break;
102  }
103  else if (_Str.max_size() <= _Str.size())
104  { // string too large, quit
105  _State |= ios_base::failbit;
106  break;
107  }
108  else
109  { // got a character, add it to string
110  _Str += _Traits::to_char_type(_Meta);
111  _Changed = true;
112  }
113  _CATCH_IO_(_Istr)
114  }
115 
116  if (!_Changed)
117  _State |= ios_base::failbit;
118  _Istr.setstate(_State);
119  return (_Istr);
120  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:150
static const _Iostate failbit
Definition: xiosbase:89
#define _CATCH_IO_(x)
Definition: ostream:32
_Check_return_ _CRTIMP _In_z_ const unsigned char * _Delim
Definition: mbstring.h:214
#define _TRY_IO_BEGIN
Definition: ostream:30
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:86
int_type __CLR_OR_THIS_CALL sbumpc()
Definition: streambuf:144
int_type __CLR_OR_THIS_CALL snextc()
Definition: streambuf:162
size_type max_size() const _NOEXCEPT
Definition: xstring:1757
_Myt & erase(size_type _Off=0)
Definition: xstring:1333
static const _Iostate goodbit
Definition: xiosbase:87
size_type size() const _NOEXCEPT
Definition: xstring:1752
Definition: iosfwd:627
static const _Iostate eofbit
Definition: xiosbase:88
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:54
template<class _Elem , class _Traits , class _Alloc >
basic_istream<_Elem, _Traits>& getline ( basic_istream< _Elem, _Traits > &&  _Istr,
basic_string< _Elem, _Traits, _Alloc > &  _Str 
)
inline
128  { // get characters into string, discard newline
129  return (getline(_Istr, _Str, _Istr.widen('\n')));
130  }
basic_istream< _Elem, _Traits > & getline(basic_istream< _Elem, _Traits > &&_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str, const _Elem _Delim)
Definition: string:72
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: ios:125
template<class _Elem , class _Traits , class _Alloc >
basic_istream<_Elem, _Traits>& getline ( basic_istream< _Elem, _Traits > &  _Istr,
basic_string< _Elem, _Traits, _Alloc > &  _Str,
const _Elem  _Delim 
)
inline
149  { // get characters into string, discard delimiter
150  return (getline(_STD move(_Istr), _Str, _Delim));
151  }
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
_Check_return_ _CRTIMP _In_z_ const unsigned char * _Delim
Definition: mbstring.h:214
basic_istream< _Elem, _Traits > & getline(basic_istream< _Elem, _Traits > &&_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str, const _Elem _Delim)
Definition: string:72
template<class _Elem , class _Traits , class _Alloc >
basic_istream<_Elem, _Traits>& getline ( basic_istream< _Elem, _Traits > &  _Istr,
basic_string< _Elem, _Traits, _Alloc > &  _Str 
)
inline
159  { // get characters into string, discard newline
160  return (getline(_STD move(_Istr), _Str, _Istr.widen('\n')));
161  }
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
basic_istream< _Elem, _Traits > & getline(basic_istream< _Elem, _Traits > &&_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str, const _Elem _Delim)
Definition: string:72
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: ios:125
template<class _Elem , class _Traits , class _Alloc >
basic_ostream<_Elem, _Traits>& operator<< ( basic_ostream< _Elem, _Traits > &  _Ostr,
const basic_string< _Elem, _Traits, _Alloc > &  _Str 
)
inline
169  { // insert a string
170  typedef basic_ostream<_Elem, _Traits> _Myos;
172  typedef typename _Mystr::size_type _Mysizt;
173 
174  ios_base::iostate _State = ios_base::goodbit;
175  _Mysizt _Size = _Str.size();
176  _Mysizt _Pad = _Ostr.width() <= 0 || (_Mysizt)_Ostr.width() <= _Size
177  ? 0 : (_Mysizt)_Ostr.width() - _Size;
178  const typename _Myos::sentry _Ok(_Ostr);
179 
180  if (!_Ok)
181  _State |= ios_base::badbit;
182  else
183  { // state okay, insert characters
185  if ((_Ostr.flags() & ios_base::adjustfield) != ios_base::left)
186  for (; 0 < _Pad; --_Pad) // pad on left
187  if (_Traits::eq_int_type(_Traits::eof(),
188  _Ostr.rdbuf()->sputc(_Ostr.fill())))
189  { // insertion failed, quit
190  _State |= ios_base::badbit;
191  break;
192  }
193 
194  if (_State == ios_base::goodbit
195  && _Ostr.rdbuf()->sputn(_Str.c_str(), (streamsize)_Size)
196  != (streamsize)_Size)
197  _State |= ios_base::badbit;
198  else
199  for (; 0 < _Pad; --_Pad) // pad on right
200  if (_Traits::eq_int_type(_Traits::eof(),
201  _Ostr.rdbuf()->sputc(_Ostr.fill())))
202  { // insertion failed, quit
203  _State |= ios_base::badbit;
204  break;
205  }
206  _Ostr.width(0);
207  _CATCH_IO_(_Ostr)
208  }
209 
210  _Ostr.setstate(_State);
211  return (_Ostr);
212  }
_Longlong streamsize
Definition: iosfwd:22
#define _CATCH_IO_(x)
Definition: ostream:32
#define _TRY_IO_BEGIN
Definition: ostream:30
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:86
_Elem __CLR_OR_THIS_CALL fill() const
Definition: ios:107
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:365
Definition: iosfwd:630
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:410
static const _Iostate goodbit
Definition: xiosbase:87
size_type size() const _NOEXCEPT
Definition: xstring:1752
int_type __CLR_OR_THIS_CALL sputc(_Elem _Ch)
Definition: streambuf:192
Definition: xstring:21
static const _Iostate badbit
Definition: xiosbase:90
_Check_return_ _In_ long _Size
Definition: io.h:325
streamsize __CLR_OR_THIS_CALL sputn(const _Elem *_Ptr, streamsize _Count)
Definition: streambuf:199
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:54
static const _Fmtflags adjustfield
Definition: xiosbase:76
Definition: xthread:159
static const _Fmtflags left
Definition: xiosbase:62
template<class _Elem , class _Traits , class _Alloc >
_STD_BEGIN basic_istream<_Elem, _Traits>& operator>> ( basic_istream< _Elem, _Traits > &&  _Istr,
basic_string< _Elem, _Traits, _Alloc > &  _Str 
)
inline
24  { // extract a string
25  typedef ctype<_Elem> _Ctype;
26  typedef basic_istream<_Elem, _Traits> _Myis;
28  typedef typename _Mystr::size_type _Mysizt;
29 
30  ios_base::iostate _State = ios_base::goodbit;
31  bool _Changed = false;
32  const typename _Myis::sentry _Ok(_Istr);
33 
34  if (_Ok)
35  { // state okay, extract characters
36  const _Ctype& _Ctype_fac = _USE(_Istr.getloc(), _Ctype);
37  _Str.erase();
38 
40  _Mysizt _Size = 0 < _Istr.width()
41  && (_Mysizt)_Istr.width() < _Str.max_size()
42  ? (_Mysizt)_Istr.width() : _Str.max_size();
43  typename _Traits::int_type _Meta = _Istr.rdbuf()->sgetc();
44 
45  for (; 0 < _Size; --_Size, _Meta = _Istr.rdbuf()->snextc())
46  if(_Traits::eq_int_type(_Traits::eof(), _Meta))
47  { // end of file, quit
48  _State |= ios_base::eofbit;
49  break;
50  }
51  else if (_Ctype_fac.is(_Ctype::space,
52  _Traits::to_char_type(_Meta)))
53  break; // whitespace, quit
54  else
55  { // add character to string
56  _Str.append(1, _Traits::to_char_type(_Meta));
57  _Changed = true;
58  }
59  _CATCH_IO_(_Istr)
60  }
61 
62  _Istr.width(0);
63  if (!_Changed)
64  _State |= ios_base::failbit;
65  _Istr.setstate(_State);
66  return (_Istr);
67  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:150
static const _Iostate failbit
Definition: xiosbase:89
#define _CATCH_IO_(x)
Definition: ostream:32
#define _USE(loc, fac)
Definition: xlocale:555
#define _TRY_IO_BEGIN
Definition: ostream:30
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:86
Definition: xlocale:2113
int_type __CLR_OR_THIS_CALL snextc()
Definition: streambuf:162
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:410
size_type max_size() const _NOEXCEPT
Definition: xstring:1757
_Myt & erase(size_type _Off=0)
Definition: xstring:1333
space_info space(const _Path &_Pval)
Definition: filesystem:1778
static const _Iostate goodbit
Definition: xiosbase:87
Definition: iosfwd:627
Definition: xstring:21
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
_Check_return_ _In_ long _Size
Definition: io.h:325
static const _Iostate eofbit
Definition: xiosbase:88
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:54
template<class _Elem , class _Traits , class _Alloc >
basic_istream<_Elem, _Traits>& operator>> ( basic_istream< _Elem, _Traits > &  _Istr,
basic_string< _Elem, _Traits, _Alloc > &  _Str 
)
inline
138  { // extract a string
139  return (_STD move(_Istr) >> _Str);
140  }
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
double stod ( const string _Str,
size_t _Idx = 0 
)
inline
328  { // convert string to double
329  const char *_Ptr = _Str.c_str();
330  errno = 0;
331  char *_Eptr;
332  double _Ans = _CSTD strtod(_Ptr, &_Eptr);
333 
334  if (_Ptr == _Eptr)
335  _Xinvalid_argument("invalid stod argument");
336  if (errno == ERANGE)
337  _Xout_of_range("stod argument out of range");
338  if (_Idx != 0)
339  *_Idx = (size_t)(_Eptr - _Ptr);
340  return (_Ans);
341  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
_Check_return_ _CRTIMP double __cdecl strtod(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr)
#define _CSTD
Definition: yvals.h:559
double stod ( const wstring _Str,
size_t _Idx = 0 
)
inline
462  { // convert wstring to double
463  const wchar_t *_Ptr = _Str.c_str();
464  errno = 0;
465  wchar_t *_Eptr;
466  double _Ans = _CSTD wcstod(_Ptr, &_Eptr);
467 
468  if (_Ptr == _Eptr)
469  _Xinvalid_argument("invalid stod argument");
470  if (errno == ERANGE)
471  _Xout_of_range("stod argument out of range");
472  if (_Idx != 0)
473  *_Idx = (size_t)(_Eptr - _Ptr);
474  return (_Ans);
475  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
_Check_return_ _CRTIMP double __cdecl wcstod(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
#define _CSTD
Definition: yvals.h:559
float stof ( const string _Str,
size_t _Idx = 0 
)
inline
312  { // convert string to float
313  const char *_Ptr = _Str.c_str();
314  errno = 0;
315  char *_Eptr;
316  float _Ans = (float)_CSTD _STRTO_F(_Ptr, &_Eptr);
317 
318  if (_Ptr == _Eptr)
319  _Xinvalid_argument("invalid stof argument");
320  if (errno == ERANGE)
321  _Xout_of_range("stof argument out of range");
322  if (_Idx != 0)
323  *_Idx = (size_t)(_Eptr - _Ptr);
324  return (_Ans);
325  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
#define _STRTO_F
Definition: string:218
#define _CSTD
Definition: yvals.h:559
float stof ( const wstring _Str,
size_t _Idx = 0 
)
inline
446  { // convert wstring to float
447  const wchar_t *_Ptr = _Str.c_str();
448  errno = 0;
449  wchar_t *_Eptr;
450  float _Ans = (float)_CSTD _WCSTO_F(_Ptr, &_Eptr);
451 
452  if (_Ptr == _Eptr)
453  _Xinvalid_argument("invalid stof argument");
454  if (errno == ERANGE)
455  _Xout_of_range("stof argument out of range");
456  if (_Idx != 0)
457  *_Idx = (size_t)(_Eptr - _Ptr);
458  return (_Ans);
459  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
#define _WCSTO_F
Definition: string:223
#define _CSTD
Definition: yvals.h:559
int stoi ( const string _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
228  { // convert string to int
229  const char *_Ptr = _Str.c_str();
230  char *_Eptr;
231  errno = 0;
232  long _Ans = _CSTD strtol(_Ptr, &_Eptr, _Base);
233 
234  if (_Ptr == _Eptr)
235  _Xinvalid_argument("invalid stoi argument");
236  if (errno == ERANGE || _Ans < INT_MIN != INT_MAX < _Ans)
237  _Xout_of_range("stoi argument out of range");
238  if (_Idx != 0)
239  *_Idx = (size_t)(_Eptr - _Ptr);
240  return ((int)_Ans);
241  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
_Check_return_ _CRTIMP long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
#define INT_MIN
Definition: limits.h:39
#define _CSTD
Definition: yvals.h:559
#define INT_MAX
Definition: limits.h:40
int stoi ( const wstring _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
362  { // convert wstring to int
363  const wchar_t *_Ptr = _Str.c_str();
364  wchar_t *_Eptr;
365  errno = 0;
366  long _Ans = _CSTD wcstol(_Ptr, &_Eptr, _Base);
367 
368  if (_Ptr == _Eptr)
369  _Xinvalid_argument("invalid stoi argument");
370  if (errno == ERANGE || _Ans < INT_MIN != INT_MAX < _Ans)
371  _Xout_of_range("stoi argument out of range");
372  if (_Idx != 0)
373  *_Idx = (size_t)(_Eptr - _Ptr);
374  return ((int)_Ans);
375  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
#define INT_MIN
Definition: limits.h:39
_Check_return_ _CRTIMP long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, int _Radix)
#define _CSTD
Definition: yvals.h:559
#define INT_MAX
Definition: limits.h:40
long stol ( const string _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
245  { // convert string to long
246  const char *_Ptr = _Str.c_str();
247  char *_Eptr;
248  errno = 0;
249  long _Ans = _CSTD strtol(_Ptr, &_Eptr, _Base);
250 
251  if (_Ptr == _Eptr)
252  _Xinvalid_argument("invalid stol argument");
253  if (errno == ERANGE)
254  _Xout_of_range("stol argument out of range");
255  if (_Idx != 0)
256  *_Idx = (size_t)(_Eptr - _Ptr);
257  return (_Ans);
258  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
_Check_return_ _CRTIMP long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
#define _CSTD
Definition: yvals.h:559
long stol ( const wstring _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
379  { // convert wstring to long
380  const wchar_t *_Ptr = _Str.c_str();
381  wchar_t *_Eptr;
382  errno = 0;
383  long _Ans = _CSTD wcstol(_Ptr, &_Eptr, _Base);
384 
385  if (_Ptr == _Eptr)
386  _Xinvalid_argument("invalid stol argument");
387  if (errno == ERANGE)
388  _Xout_of_range("stol argument out of range");
389  if (_Idx != 0)
390  *_Idx = (size_t)(_Eptr - _Ptr);
391  return (_Ans);
392  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
_Check_return_ _CRTIMP long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, int _Radix)
#define _CSTD
Definition: yvals.h:559
long double stold ( const string _Str,
size_t _Idx = 0 
)
inline
344  { // convert string to long double
345  const char *_Ptr = _Str.c_str();
346  errno = 0;
347  char *_Eptr;
348  long double _Ans = _CSTD _STRTO_LD(_Ptr, &_Eptr);
349 
350  if (_Ptr == _Eptr)
351  _Xinvalid_argument("invalid stold argument");
352  if (errno == ERANGE)
353  _Xout_of_range("stold argument out of range");
354  if (_Idx != 0)
355  *_Idx = (size_t)(_Eptr - _Ptr);
356  return (_Ans);
357  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
#define _STRTO_LD
Definition: string:219
#define _CSTD
Definition: yvals.h:559
long double stold ( const wstring _Str,
size_t _Idx = 0 
)
inline
478  { // convert wstring to long double
479  const wchar_t *_Ptr = _Str.c_str();
480  errno = 0;
481  wchar_t *_Eptr;
482  long double _Ans = _CSTD _WCSTO_LD(_Ptr, &_Eptr);
483 
484  if (_Ptr == _Eptr)
485  _Xinvalid_argument("invalid stold argument");
486  if (errno == ERANGE)
487  _Xout_of_range("stold argument out of range");
488  if (_Idx != 0)
489  *_Idx = (size_t)(_Eptr - _Ptr);
490  return (_Ans);
491  }
#define _WCSTO_LD
Definition: string:224
_W64 unsigned int size_t
Definition: crtdefs.h:496
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
#define _CSTD
Definition: yvals.h:559
_Longlong stoll ( const string _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
279  { // convert string to long long
280  const char *_Ptr = _Str.c_str();
281  char *_Eptr;
282  errno = 0;
283  _Longlong _Ans = _CSTD _STRTO_LL(_Ptr, &_Eptr, _Base);
284 
285  if (_Ptr == _Eptr)
286  _Xinvalid_argument("invalid stoll argument");
287  if (errno == ERANGE)
288  _Xout_of_range("stoll argument out of range");
289  if (_Idx != 0)
290  *_Idx = (size_t)(_Eptr - _Ptr);
291  return (_Ans);
292  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
#define _STRTO_LL
Definition: string:216
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
_LONGLONG _Longlong
Definition: yvals.h:586
#define _CSTD
Definition: yvals.h:559
_Longlong stoll ( const wstring _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
413  { // convert wstring to long long
414  const wchar_t *_Ptr = _Str.c_str();
415  wchar_t *_Eptr;
416  errno = 0;
417  _Longlong _Ans = _CSTD _WCSTO_LL(_Ptr, &_Eptr, _Base);
418 
419  if (_Ptr == _Eptr)
420  _Xinvalid_argument("invalid stoll argument");
421  if (errno == ERANGE)
422  _Xout_of_range("stoll argument out of range");
423  if (_Idx != 0)
424  *_Idx = (size_t)(_Eptr - _Ptr);
425  return (_Ans);
426  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
_LONGLONG _Longlong
Definition: yvals.h:586
#define _WCSTO_LL
Definition: string:221
#define _CSTD
Definition: yvals.h:559
unsigned long stoul ( const string _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
262  { // convert string to unsigned long
263  const char *_Ptr = _Str.c_str();
264  char *_Eptr;
265  errno = 0;
266  unsigned long _Ans = _CSTD strtoul(_Ptr, &_Eptr, _Base);
267 
268  if (_Ptr == _Eptr)
269  _Xinvalid_argument("invalid stoul argument");
270  if (errno == ERANGE)
271  _Xout_of_range("stoul argument out of range");
272  if (_Idx != 0)
273  *_Idx = (size_t)(_Eptr - _Ptr);
274  return (_Ans);
275  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
_Check_return_ _CRTIMP unsigned long __cdecl strtoul(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
#define _CSTD
Definition: yvals.h:559
unsigned long stoul ( const wstring _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
396  { // convert wstring to unsigned long
397  const wchar_t *_Ptr = _Str.c_str();
398  wchar_t *_Eptr;
399  errno = 0;
400  unsigned long _Ans = _CSTD wcstoul(_Ptr, &_Eptr, _Base);
401 
402  if (_Ptr == _Eptr)
403  _Xinvalid_argument("invalid stoul argument");
404  if (errno == ERANGE)
405  _Xout_of_range("stoul argument out of range");
406  if (_Idx != 0)
407  *_Idx = (size_t)(_Eptr - _Ptr);
408  return (_Ans);
409  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
_Check_return_ _CRTIMP unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, int _Radix)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
#define _CSTD
Definition: yvals.h:559
_ULonglong stoull ( const string _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
296  { // convert string to unsigned long long
297  const char *_Ptr = _Str.c_str();
298  errno = 0;
299  char *_Eptr;
300  _ULonglong _Ans = _CSTD _STRTO_ULL(_Ptr, &_Eptr, _Base);
301 
302  if (_Ptr == _Eptr)
303  _Xinvalid_argument("invalid stoull argument");
304  if (errno == ERANGE)
305  _Xout_of_range("stoull argument out of range");
306  if (_Idx != 0)
307  *_Idx = (size_t)(_Eptr - _Ptr);
308  return (_Ans);
309  }
#define _STRTO_ULL
Definition: string:217
_W64 unsigned int size_t
Definition: crtdefs.h:496
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
#define _CSTD
Definition: yvals.h:559
_ULONGLONG _ULonglong
Definition: yvals.h:587
_ULonglong stoull ( const wstring _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
430  { // convert wstring to unsigned long long
431  const wchar_t *_Ptr = _Str.c_str();
432  errno = 0;
433  wchar_t *_Eptr;
434  _ULonglong _Ans = _CSTD _WCSTO_ULL(_Ptr, &_Eptr, _Base);
435 
436  if (_Ptr == _Eptr)
437  _Xinvalid_argument("invalid stoull argument");
438  if (errno == ERANGE)
439  _Xout_of_range("stoull argument out of range");
440  if (_Idx != 0)
441  *_Idx = (size_t)(_Eptr - _Ptr);
442  return (_Ans);
443  }
_W64 unsigned int size_t
Definition: crtdefs.h:496
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1737
#define ERANGE
Definition: errno.h:82
#define errno
Definition: cerrno:18
#define _WCSTO_ULL
Definition: string:222
#define _CSTD
Definition: yvals.h:559
_ULONGLONG _ULonglong
Definition: yvals.h:587
string to_string ( int  _Val)
inline
501  { // convert int to string
502  char _Buf[2 * _MAX_INT_DIG];
503 
504  _CSTD _TOSTRING(_Buf, "%d", _Val);
505  return (string(_Buf));
506  }
Definition: regex:1520
#define _MAX_INT_DIG
Definition: yvals.h:583
#define _TOSTRING(buf, fmt, val)
Definition: string:497
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
string to_string ( unsigned int  _Val)
inline
509  { // convert unsigned int to string
510  char _Buf[2 * _MAX_INT_DIG];
511 
512  _CSTD _TOSTRING(_Buf, "%u", _Val);
513  return (string(_Buf));
514  }
Definition: regex:1520
#define _MAX_INT_DIG
Definition: yvals.h:583
#define _TOSTRING(buf, fmt, val)
Definition: string:497
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
string to_string ( long  _Val)
inline
517  { // convert long to string
518  char _Buf[2 * _MAX_INT_DIG];
519 
520  _CSTD _TOSTRING(_Buf, "%ld", _Val);
521  return (string(_Buf));
522  }
Definition: regex:1520
#define _MAX_INT_DIG
Definition: yvals.h:583
#define _TOSTRING(buf, fmt, val)
Definition: string:497
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
string to_string ( unsigned long  _Val)
inline
525  { // convert unsigned long to string
526  char _Buf[2 * _MAX_INT_DIG];
527 
528  _CSTD _TOSTRING(_Buf, "%lu", _Val);
529  return (string(_Buf));
530  }
Definition: regex:1520
#define _MAX_INT_DIG
Definition: yvals.h:583
#define _TOSTRING(buf, fmt, val)
Definition: string:497
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
string to_string ( _Longlong  _Val)
inline
533  { // convert long long to string
534  char _Buf[2 * _MAX_INT_DIG];
535 
536  _CSTD _TOSTRING(_Buf, _LLFMT "d", _Val);
537  return (string(_Buf));
538  }
Definition: regex:1520
#define _LLFMT
Definition: string:495
#define _MAX_INT_DIG
Definition: yvals.h:583
#define _TOSTRING(buf, fmt, val)
Definition: string:497
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
string to_string ( _ULonglong  _Val)
inline
541  { // convert unsigned long long to string
542  char _Buf[2 * _MAX_INT_DIG];
543 
544  _CSTD _TOSTRING(_Buf, _LLFMT "u", _Val);
545  return (string(_Buf));
546  }
Definition: regex:1520
#define _LLFMT
Definition: string:495
#define _MAX_INT_DIG
Definition: yvals.h:583
#define _TOSTRING(buf, fmt, val)
Definition: string:497
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
string to_string ( long double  _Val)
inline
549  { // convert long double to string
550  typedef back_insert_iterator<string> _Iter;
551  typedef num_put<char, _Iter> _Nput;
552  const _Nput& _Nput_fac = use_facet<_Nput>(locale());
553  ostream _Ios((streambuf *)0);
554  string _Str;
555 
556  _Ios.setf(ios_base::fixed);
557  _Nput_fac.put(_Iter(_Str), _Ios, ' ', _Val);
558  return (_Str);
559  }
Definition: iosfwd:624
Definition: xlocale:62
Definition: iterator:17
Definition: iosfwd:630
static const _Fmtflags fixed
Definition: xiosbase:69
Definition: xlocnum:1080
_FwdIt const _Ty _Val
Definition: algorithm:1938
string to_string ( double  _Val)
inline
562  { // convert double to string
563  return (to_string((long double)_Val));
564  }
string to_string(int _Val)
Definition: string:500
_FwdIt const _Ty _Val
Definition: algorithm:1938
string to_string ( float  _Val)
inline
567  { // convert float to string
568  return (to_string((long double)_Val));
569  }
string to_string(int _Val)
Definition: string:500
_FwdIt const _Ty _Val
Definition: algorithm:1938
wstring to_wstring ( int  _Val)
inline
579  { // convert int to wstring
580  wchar_t _Buf[2 * _MAX_INT_DIG];
581 
582  _CSTD _TOWSTRING(_Buf, L"%d", _Val);
583  return (wstring(_Buf));
584  }
Definition: regex:1520
#define _TOWSTRING(buf, fmt, val)
Definition: string:575
#define _MAX_INT_DIG
Definition: yvals.h:583
basic_string< wchar_t, char_traits< wchar_t >, allocator< wchar_t > > wstring
Definition: xstring:2645
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
wstring to_wstring ( unsigned int  _Val)
inline
587  { // convert unsigned int to wstring
588  wchar_t _Buf[2 * _MAX_INT_DIG];
589 
590  _CSTD _TOWSTRING(_Buf, L"%u", _Val);
591  return (wstring(_Buf));
592  }
Definition: regex:1520
#define _TOWSTRING(buf, fmt, val)
Definition: string:575
#define _MAX_INT_DIG
Definition: yvals.h:583
basic_string< wchar_t, char_traits< wchar_t >, allocator< wchar_t > > wstring
Definition: xstring:2645
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
wstring to_wstring ( long  _Val)
inline
595  { // convert long to wstring
596  wchar_t _Buf[2 * _MAX_INT_DIG];
597 
598  _CSTD _TOWSTRING(_Buf, L"%ld", _Val);
599  return (wstring(_Buf));
600  }
Definition: regex:1520
#define _TOWSTRING(buf, fmt, val)
Definition: string:575
#define _MAX_INT_DIG
Definition: yvals.h:583
basic_string< wchar_t, char_traits< wchar_t >, allocator< wchar_t > > wstring
Definition: xstring:2645
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
wstring to_wstring ( unsigned long  _Val)
inline
603  { // convert unsigned long to wstring
604  wchar_t _Buf[2 * _MAX_INT_DIG];
605 
606  _CSTD _TOWSTRING(_Buf, L"%lu", _Val);
607  return (wstring(_Buf));
608  }
Definition: regex:1520
#define _TOWSTRING(buf, fmt, val)
Definition: string:575
#define _MAX_INT_DIG
Definition: yvals.h:583
basic_string< wchar_t, char_traits< wchar_t >, allocator< wchar_t > > wstring
Definition: xstring:2645
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
wstring to_wstring ( _Longlong  _Val)
inline
611  { // convert long long to wstring
612  wchar_t _Buf[2 * _MAX_INT_DIG];
613 
614  _CSTD _TOWSTRING(_Buf, _WLLFMT L"d", _Val);
615  return (wstring(_Buf));
616  }
Definition: regex:1520
#define _TOWSTRING(buf, fmt, val)
Definition: string:575
#define _MAX_INT_DIG
Definition: yvals.h:583
basic_string< wchar_t, char_traits< wchar_t >, allocator< wchar_t > > wstring
Definition: xstring:2645
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
#define _WLLFMT
Definition: string:573
wstring to_wstring ( _ULonglong  _Val)
inline
619  { // convert unsigned long long to wstring
620  wchar_t _Buf[2 * _MAX_INT_DIG];
621 
622  _CSTD _TOWSTRING(_Buf, _WLLFMT L"u", _Val);
623  return (wstring(_Buf));
624  }
Definition: regex:1520
#define _TOWSTRING(buf, fmt, val)
Definition: string:575
#define _MAX_INT_DIG
Definition: yvals.h:583
basic_string< wchar_t, char_traits< wchar_t >, allocator< wchar_t > > wstring
Definition: xstring:2645
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
#define _WLLFMT
Definition: string:573
wstring to_wstring ( long double  _Val)
inline
627  { // convert long double to wstring
628  typedef back_insert_iterator<wstring> _Iter;
629  typedef num_put<wchar_t, _Iter> _Nput;
630  const _Nput& _Nput_fac = use_facet<_Nput>(locale());
631  ostream _Ios((streambuf *)0);
632  wstring _Str;
633 
634  _Ios.setf(ios_base::fixed);
635  _Nput_fac.put(_Iter(_Str), _Ios, L' ', _Val);
636  return (_Str);
637  }
Definition: iosfwd:624
Definition: xlocale:62
Definition: iterator:17
Definition: iosfwd:630
static const _Fmtflags fixed
Definition: xiosbase:69
Definition: xlocnum:1080
Definition: xstring:21
_FwdIt const _Ty _Val
Definition: algorithm:1938
wstring to_wstring ( double  _Val)
inline
640  { // convert double to wstring
641  return (to_wstring((long double)_Val));
642  }
wstring to_wstring(int _Val)
Definition: string:578
_FwdIt const _Ty _Val
Definition: algorithm:1938
wstring to_wstring ( float  _Val)
inline
645  { // convert float to wstring
646  return (to_wstring((long double)_Val));
647  }
wstring to_wstring(int _Val)
Definition: string:578
_FwdIt const _Ty _Val
Definition: algorithm:1938