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

Namespaces

 literals
 
 literals::string_literals
 

Macros

#define _STRING_
 

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)
 
long long stoll (const string &_Str, size_t *_Idx=0, int _Base=10)
 
unsigned long long 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)
 
long long stoll (const wstring &_Str, size_t *_Idx=0, int _Base=10)
 
unsigned long long 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)
 
template<class _Elem , class _UTy >
_Elem * _UIntegral_to_buff (_Elem *_RNext, _UTy _UVal)
 
template<class _Elem , class _Ty >
basic_string< _Elem > _Integral_to_string (const _Ty _Val)
 
template<class _Ty >
string _Floating_to_string (const char *_Fmt, _Ty _Val)
 
template<class _Ty >
wstring _Floating_to_wstring (const wchar_t *_Fmt, _Ty _Val)
 
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 (long long _Val)
 
string to_string (unsigned long long _Val)
 
string to_string (float _Val)
 
string to_string (double _Val)
 
string to_string (long double _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 (long long _Val)
 
wstring to_wstring (unsigned long long _Val)
 
wstring to_wstring (float _Val)
 
wstring to_wstring (double _Val)
 
wstring to_wstring (long double _Val)
 
string literals::string_literals::operator""s (const char *_Str, size_t _Len)
 
wstring literals::string_literals::operator""s (const wchar_t *_Str, size_t _Len)
 
u16string literals::string_literals::operator""s (const char16_t *_Str, size_t _Len)
 
u32string literals::string_literals::operator""s (const char32_t *_Str, size_t _Len)
 

Macro Definition Documentation

#define _STRING_

Function Documentation

template<class _Ty >
string _Floating_to_string ( const char *  _Fmt,
_Ty  _Val 
)
inline
547  { // convert _Val to string
548  static_assert(is_floating_point<_Ty>::value,
549  "_Ty must be floating point");
550 
551  int _Len = _CSTD _scprintf(_Fmt, _Val);
552  string _Str(_Len + 1, '\0');
553  _CSTD sprintf_s(&_Str[0], _Len + 1, _Fmt, _Val);
554  _Str.resize(_Len);
555  return (_Str);
556  }
Definition: xtr1common:275
_In_ int _Val
Definition: vcruntime_string.h:62
#define _CSTD
Definition: yvals.h:570
template<class _Ty >
wstring _Floating_to_wstring ( const wchar_t _Fmt,
_Ty  _Val 
)
inline
560  { // convert _Val to wstring
561  static_assert(is_floating_point<_Ty>::value,
562  "_Ty must be floating point");
563 
564  int _Len = _CSTD _scwprintf(_Fmt, _Val);
565  wstring _Str(_Len + 1, L'\0');
566  _CSTD swprintf_s(&_Str[0], _Len + 1, _Fmt, _Val);
567  _Str.resize(_Len);
568  return (_Str);
569  }
Definition: xtr1common:275
_In_ int _Val
Definition: vcruntime_string.h:62
#define _CSTD
Definition: yvals.h:570
Definition: xstring:21
template<class _Elem , class _Ty >
basic_string<_Elem> _Integral_to_string ( const _Ty  _Val)
inline
527  { // convert _Val to string
528  static_assert(is_integral<_Ty>::value, "_Ty must be integral");
529  using _UTy = make_unsigned_t<_Ty>;
530  _Elem _Buff[21]; // can hold -2^63 and 2^64 - 1, plus NUL
531  _Elem* const _Buff_end = _STD end(_Buff);
532  _Elem* _RNext = _Buff_end;
533  auto _UVal = static_cast<_UTy>(_Val);
534  if (_Val < 0)
535  {
536  _RNext = _UIntegral_to_buff(_RNext, 0 - _UVal);
537  *--_RNext = '-';
538  }
539  else
540  _RNext = _UIntegral_to_buff(_RNext, _UVal);
541 
542  return (basic_string<_Elem>(_RNext, _Buff_end));
543  }
directory_iterator end(const directory_iterator &) _NOEXCEPT
Definition: filesystem:1974
_In_ int _Val
Definition: vcruntime_string.h:62
_Elem * _UIntegral_to_buff(_Elem *_RNext, _UTy _UVal)
Definition: string:489
Definition: xtr1common:238
Definition: xstring:21
typename make_unsigned< _Ty >::type make_unsigned_t
Definition: type_traits:1850
template<class _Elem , class _UTy >
_Elem* _UIntegral_to_buff ( _Elem *  _RNext,
_UTy  _UVal 
)
inline
490  { // format _UVal into buffer *ending at* _RNext
491  static_assert(is_unsigned<_UTy>::value, "_UTy must be unsigned");
492 
493 #ifdef _WIN64
494  auto _UVal_trunc = _UVal;
495 #else /* ^^^ _WIN64 ^^^ // vvv !_WIN64 vvv */
496  if (sizeof(_UTy) > 4)
497  { // For 64-bit numbers, work in chunks to avoid 64-bit divisions.
498  while (_UVal > 0xFFFFFFFFU)
499  {
500  auto _UVal_chunk = static_cast<_Uint32t>(_UVal % 1000000000);
501  _UVal /= 1000000000;
502 
503  for (int _Idx = 0; _Idx != 9; ++_Idx)
504  {
505  *--_RNext = '0' + _UVal_chunk % 10;
506  _UVal_chunk /= 10;
507  }
508  }
509  }
510 
511  auto _UVal_trunc = static_cast<_Uint32t>(_UVal);
512 #endif /* _WIN64 */
513 
514  do
515  {
516  *--_RNext = '0' + _UVal_trunc % 10;
517  _UVal_trunc /= 10;
518  }
519  while (_UVal_trunc != 0);
520  return (_RNext);
521  }
unsigned long _Uint32t
Definition: yvals.h:811
Definition: type_traits:735
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
77  { // get characters into string, discard delimiter
78  typedef basic_istream<_Elem, _Traits> _Myis;
79 
80  ios_base::iostate _State = ios_base::goodbit;
81  bool _Changed = false;
82  const typename _Myis::sentry _Ok(_Istr, true);
83 
84  if (_Ok)
85  { // state okay, extract characters
87  _Str.erase();
88  const typename _Traits::int_type _Metadelim =
89  _Traits::to_int_type(_Delim);
90  typename _Traits::int_type _Meta = _Istr.rdbuf()->sgetc();
91 
92  for (; ; _Meta = _Istr.rdbuf()->snextc())
93  if (_Traits::eq_int_type(_Traits::eof(), _Meta))
94  { // end of file, quit
95  _State |= ios_base::eofbit;
96  break;
97  }
98  else if (_Traits::eq_int_type(_Meta, _Metadelim))
99  { // got a delimiter, discard it and quit
100  _Changed = true;
101  _Istr.rdbuf()->sbumpc();
102  break;
103  }
104  else if (_Str.max_size() <= _Str.size())
105  { // string too large, quit
106  _State |= ios_base::failbit;
107  break;
108  }
109  else
110  { // got a character, add it to string
111  _Str += _Traits::to_char_type(_Meta);
112  _Changed = true;
113  }
114  _CATCH_IO_(_Istr)
115  }
116 
117  if (!_Changed)
118  _State |= ios_base::failbit;
119  _Istr.setstate(_State);
120  return (_Istr);
121  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:154
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _CATCH_IO_(x)
Definition: ostream:32
#define _TRY_IO_BEGIN
Definition: ostream:30
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:90
int_type __CLR_OR_THIS_CALL sbumpc()
Definition: streambuf:148
int_type __CLR_OR_THIS_CALL snextc()
Definition: streambuf:166
size_type max_size() const _NOEXCEPT
Definition: xstring:1768
_Myt & erase(size_type _Off=0)
Definition: xstring:1339
static constexpr _Iostate goodbit
Definition: xiosbase:87
size_type size() const _NOEXCEPT
Definition: xstring:1763
Definition: iosfwd:628
static constexpr _Iostate eofbit
Definition: xiosbase:88
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:56
template<class _Elem , class _Traits , class _Alloc >
basic_istream<_Elem, _Traits>& getline ( basic_istream< _Elem, _Traits > &&  _Istr,
basic_string< _Elem, _Traits, _Alloc > &  _Str 
)
inline
129  { // get characters into string, discard newline
130  return (getline(_Istr, _Str, _Istr.widen('\n')));
131  }
basic_istream< _Elem, _Traits > & getline(basic_istream< _Elem, _Traits > &&_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str, const _Elem _Delim)
Definition: string:73
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: ios:129
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
150  { // get characters into string, discard delimiter
151  return (getline(_STD move(_Istr), _Str, _Delim));
152  }
basic_istream< _Elem, _Traits > & getline(basic_istream< _Elem, _Traits > &&_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str, const _Elem _Delim)
Definition: string:73
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
template<class _Elem , class _Traits , class _Alloc >
basic_istream<_Elem, _Traits>& getline ( basic_istream< _Elem, _Traits > &  _Istr,
basic_string< _Elem, _Traits, _Alloc > &  _Str 
)
inline
160  { // get characters into string, discard newline
161  return (getline(_STD move(_Istr), _Str, _Istr.widen('\n')));
162  }
basic_istream< _Elem, _Traits > & getline(basic_istream< _Elem, _Traits > &&_Istr, basic_string< _Elem, _Traits, _Alloc > &_Str, const _Elem _Delim)
Definition: string:73
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: ios:129
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
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
170  { // insert a string
171  typedef basic_ostream<_Elem, _Traits> _Myos;
173  typedef typename _Mystr::size_type _Mysizt;
174 
175  ios_base::iostate _State = ios_base::goodbit;
176  _Mysizt _Size = _Str.size();
177  _Mysizt _Pad = _Ostr.width() <= 0 || (_Mysizt)_Ostr.width() <= _Size
178  ? 0 : (_Mysizt)_Ostr.width() - _Size;
179  const typename _Myos::sentry _Ok(_Ostr);
180 
181  if (!_Ok)
182  _State |= ios_base::badbit;
183  else
184  { // state okay, insert characters
186  if ((_Ostr.flags() & ios_base::adjustfield) != ios_base::left)
187  for (; 0 < _Pad; --_Pad) // pad on left
188  if (_Traits::eq_int_type(_Traits::eof(),
189  _Ostr.rdbuf()->sputc(_Ostr.fill())))
190  { // insertion failed, quit
191  _State |= ios_base::badbit;
192  break;
193  }
194 
195  if (_State == ios_base::goodbit
196  && _Ostr.rdbuf()->sputn(_Str.c_str(), (streamsize)_Size)
197  != (streamsize)_Size)
198  _State |= ios_base::badbit;
199  else
200  for (; 0 < _Pad; --_Pad) // pad on right
201  if (_Traits::eq_int_type(_Traits::eof(),
202  _Ostr.rdbuf()->sputc(_Ostr.fill())))
203  { // insertion failed, quit
204  _State |= ios_base::badbit;
205  break;
206  }
207  _Ostr.width(0);
208  _CATCH_IO_(_Ostr)
209  }
210 
211  _Ostr.setstate(_State);
212  return (_Ostr);
213  }
_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:1741
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:90
_Elem __CLR_OR_THIS_CALL fill() const
Definition: ios:111
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
Definition: iosfwd:631
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:421
static constexpr _Iostate goodbit
Definition: xiosbase:87
size_type size() const _NOEXCEPT
Definition: xstring:1763
int_type __CLR_OR_THIS_CALL sputc(_Elem _Ch)
Definition: streambuf:198
Definition: xstring:21
static constexpr _Iostate badbit
Definition: xiosbase:90
streamsize __CLR_OR_THIS_CALL sputn(const _Elem *_Ptr, streamsize _Count)
Definition: streambuf:205
_Size
Definition: vcruntime_string.h:36
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:56
static constexpr _Fmtflags adjustfield
Definition: xiosbase:76
Definition: xthread:164
static constexpr _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
25  { // extract a string
26  typedef ctype<_Elem> _Ctype;
27  typedef basic_istream<_Elem, _Traits> _Myis;
29  typedef typename _Mystr::size_type _Mysizt;
30 
31  ios_base::iostate _State = ios_base::goodbit;
32  bool _Changed = false;
33  const typename _Myis::sentry _Ok(_Istr);
34 
35  if (_Ok)
36  { // state okay, extract characters
37  const _Ctype& _Ctype_fac = _USE(_Istr.getloc(), _Ctype);
38  _Str.erase();
39 
41  _Mysizt _Size = 0 < _Istr.width()
42  && (_Mysizt)_Istr.width() < _Str.max_size()
43  ? (_Mysizt)_Istr.width() : _Str.max_size();
44  typename _Traits::int_type _Meta = _Istr.rdbuf()->sgetc();
45 
46  for (; 0 < _Size; --_Size, _Meta = _Istr.rdbuf()->snextc())
47  if (_Traits::eq_int_type(_Traits::eof(), _Meta))
48  { // end of file, quit
49  _State |= ios_base::eofbit;
50  break;
51  }
52  else if (_Ctype_fac.is(_Ctype::space,
53  _Traits::to_char_type(_Meta)))
54  break; // whitespace, quit
55  else
56  { // add character to string
57  _Str.append(1, _Traits::to_char_type(_Meta));
58  _Changed = true;
59  }
60  _CATCH_IO_(_Istr)
61  }
62 
63  _Istr.width(0);
64  if (!_Changed)
65  _State |= ios_base::failbit;
66  _Istr.setstate(_State);
67  return (_Istr);
68  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:154
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _CATCH_IO_(x)
Definition: ostream:32
#define _USE(loc, fac)
Definition: xlocale:547
#define _TRY_IO_BEGIN
Definition: ostream:30
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:90
Definition: xlocale:2115
int_type __CLR_OR_THIS_CALL snextc()
Definition: streambuf:166
streamsize __CLR_OR_THIS_CALL width() const
Definition: xiosbase:421
size_type max_size() const _NOEXCEPT
Definition: xstring:1768
_Myt & erase(size_type _Off=0)
Definition: xstring:1339
static constexpr _Iostate goodbit
Definition: xiosbase:87
space_info space(const path &)
Definition: filesystem:3125
Definition: iosfwd:628
Definition: xstring:21
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
_Size
Definition: vcruntime_string.h:36
static constexpr _Iostate eofbit
Definition: xiosbase:88
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:56
template<class _Elem , class _Traits , class _Alloc >
basic_istream<_Elem, _Traits>& operator>> ( basic_istream< _Elem, _Traits > &  _Istr,
basic_string< _Elem, _Traits, _Alloc > &  _Str 
)
inline
139  { // extract a string
140  return (_STD move(_Istr) >> _Str);
141  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
double stod ( const string _Str,
size_t _Idx = 0 
)
inline
319  { // convert string to double
320  const char *_Ptr = _Str.c_str();
321  char *_Eptr;
322  errno = 0;
323  double _Ans = _CSTD strtod(_Ptr, &_Eptr);
324 
325  if (_Ptr == _Eptr)
326  _Xinvalid_argument("invalid stod argument");
327  if (errno == ERANGE)
328  _Xout_of_range("stod argument out of range");
329  if (_Idx != 0)
330  *_Idx = (size_t)(_Eptr - _Ptr);
331  return (_Ans);
332  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
double stod ( const wstring _Str,
size_t _Idx = 0 
)
inline
453  { // convert wstring to double
454  const wchar_t *_Ptr = _Str.c_str();
455  wchar_t *_Eptr;
456  errno = 0;
457  double _Ans = _CSTD wcstod(_Ptr, &_Eptr);
458 
459  if (_Ptr == _Eptr)
460  _Xinvalid_argument("invalid stod argument");
461  if (errno == ERANGE)
462  _Xout_of_range("stod argument out of range");
463  if (_Idx != 0)
464  *_Idx = (size_t)(_Eptr - _Ptr);
465  return (_Ans);
466  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
float stof ( const string _Str,
size_t _Idx = 0 
)
inline
303  { // convert string to float
304  const char *_Ptr = _Str.c_str();
305  char *_Eptr;
306  errno = 0;
307  float _Ans = _CSTD strtof(_Ptr, &_Eptr);
308 
309  if (_Ptr == _Eptr)
310  _Xinvalid_argument("invalid stof argument");
311  if (errno == ERANGE)
312  _Xout_of_range("stof argument out of range");
313  if (_Idx != 0)
314  *_Idx = (size_t)(_Eptr - _Ptr);
315  return (_Ans);
316  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
float stof ( const wstring _Str,
size_t _Idx = 0 
)
inline
437  { // convert wstring to float
438  const wchar_t *_Ptr = _Str.c_str();
439  wchar_t *_Eptr;
440  errno = 0;
441  float _Ans = _CSTD wcstof(_Ptr, &_Eptr);
442 
443  if (_Ptr == _Eptr)
444  _Xinvalid_argument("invalid stof argument");
445  if (errno == ERANGE)
446  _Xout_of_range("stof argument out of range");
447  if (_Idx != 0)
448  *_Idx = (size_t)(_Eptr - _Ptr);
449  return (_Ans);
450  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
int stoi ( const string _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
219  { // convert string to int
220  const char *_Ptr = _Str.c_str();
221  char *_Eptr;
222  errno = 0;
223  long _Ans = _CSTD strtol(_Ptr, &_Eptr, _Base);
224 
225  if (_Ptr == _Eptr)
226  _Xinvalid_argument("invalid stoi argument");
227  if (errno == ERANGE || _Ans < INT_MIN || INT_MAX < _Ans)
228  _Xout_of_range("stoi argument out of range");
229  if (_Idx != 0)
230  *_Idx = (size_t)(_Eptr - _Ptr);
231  return ((int)_Ans);
232  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
#define INT_MIN
Definition: limits.h:34
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
#define INT_MAX
Definition: limits.h:35
int stoi ( const wstring _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
353  { // convert wstring to int
354  const wchar_t *_Ptr = _Str.c_str();
355  wchar_t *_Eptr;
356  errno = 0;
357  long _Ans = _CSTD wcstol(_Ptr, &_Eptr, _Base);
358 
359  if (_Ptr == _Eptr)
360  _Xinvalid_argument("invalid stoi argument");
361  if (errno == ERANGE || _Ans < INT_MIN || INT_MAX < _Ans)
362  _Xout_of_range("stoi argument out of range");
363  if (_Idx != 0)
364  *_Idx = (size_t)(_Eptr - _Ptr);
365  return ((int)_Ans);
366  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
#define INT_MIN
Definition: limits.h:34
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
#define INT_MAX
Definition: limits.h:35
long stol ( const string _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
236  { // convert string to long
237  const char *_Ptr = _Str.c_str();
238  char *_Eptr;
239  errno = 0;
240  long _Ans = _CSTD strtol(_Ptr, &_Eptr, _Base);
241 
242  if (_Ptr == _Eptr)
243  _Xinvalid_argument("invalid stol argument");
244  if (errno == ERANGE)
245  _Xout_of_range("stol argument out of range");
246  if (_Idx != 0)
247  *_Idx = (size_t)(_Eptr - _Ptr);
248  return (_Ans);
249  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
long stol ( const wstring _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
370  { // convert wstring to long
371  const wchar_t *_Ptr = _Str.c_str();
372  wchar_t *_Eptr;
373  errno = 0;
374  long _Ans = _CSTD wcstol(_Ptr, &_Eptr, _Base);
375 
376  if (_Ptr == _Eptr)
377  _Xinvalid_argument("invalid stol argument");
378  if (errno == ERANGE)
379  _Xout_of_range("stol argument out of range");
380  if (_Idx != 0)
381  *_Idx = (size_t)(_Eptr - _Ptr);
382  return (_Ans);
383  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
long double stold ( const string _Str,
size_t _Idx = 0 
)
inline
335  { // convert string to long double
336  const char *_Ptr = _Str.c_str();
337  char *_Eptr;
338  errno = 0;
339  long double _Ans = _CSTD strtold(_Ptr, &_Eptr);
340 
341  if (_Ptr == _Eptr)
342  _Xinvalid_argument("invalid stold argument");
343  if (errno == ERANGE)
344  _Xout_of_range("stold argument out of range");
345  if (_Idx != 0)
346  *_Idx = (size_t)(_Eptr - _Ptr);
347  return (_Ans);
348  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
long double stold ( const wstring _Str,
size_t _Idx = 0 
)
inline
469  { // convert wstring to long double
470  const wchar_t *_Ptr = _Str.c_str();
471  wchar_t *_Eptr;
472  errno = 0;
473  long double _Ans = _CSTD wcstold(_Ptr, &_Eptr);
474 
475  if (_Ptr == _Eptr)
476  _Xinvalid_argument("invalid stold argument");
477  if (errno == ERANGE)
478  _Xout_of_range("stold argument out of range");
479  if (_Idx != 0)
480  *_Idx = (size_t)(_Eptr - _Ptr);
481  return (_Ans);
482  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
long long stoll ( const string _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
270  { // convert string to long long
271  const char *_Ptr = _Str.c_str();
272  char *_Eptr;
273  errno = 0;
274  long long _Ans = _CSTD strtoll(_Ptr, &_Eptr, _Base);
275 
276  if (_Ptr == _Eptr)
277  _Xinvalid_argument("invalid stoll argument");
278  if (errno == ERANGE)
279  _Xout_of_range("stoll argument out of range");
280  if (_Idx != 0)
281  *_Idx = (size_t)(_Eptr - _Ptr);
282  return (_Ans);
283  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
long long stoll ( const wstring _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
404  { // convert wstring to long long
405  const wchar_t *_Ptr = _Str.c_str();
406  wchar_t *_Eptr;
407  errno = 0;
408  long long _Ans = _CSTD wcstoll(_Ptr, &_Eptr, _Base);
409 
410  if (_Ptr == _Eptr)
411  _Xinvalid_argument("invalid stoll argument");
412  if (errno == ERANGE)
413  _Xout_of_range("stoll argument out of range");
414  if (_Idx != 0)
415  *_Idx = (size_t)(_Eptr - _Ptr);
416  return (_Ans);
417  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
unsigned long stoul ( const string _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
253  { // convert string to unsigned long
254  const char *_Ptr = _Str.c_str();
255  char *_Eptr;
256  errno = 0;
257  unsigned long _Ans = _CSTD strtoul(_Ptr, &_Eptr, _Base);
258 
259  if (_Ptr == _Eptr)
260  _Xinvalid_argument("invalid stoul argument");
261  if (errno == ERANGE)
262  _Xout_of_range("stoul argument out of range");
263  if (_Idx != 0)
264  *_Idx = (size_t)(_Eptr - _Ptr);
265  return (_Ans);
266  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
unsigned long stoul ( const wstring _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
387  { // convert wstring to unsigned long
388  const wchar_t *_Ptr = _Str.c_str();
389  wchar_t *_Eptr;
390  errno = 0;
391  unsigned long _Ans = _CSTD wcstoul(_Ptr, &_Eptr, _Base);
392 
393  if (_Ptr == _Eptr)
394  _Xinvalid_argument("invalid stoul argument");
395  if (errno == ERANGE)
396  _Xout_of_range("stoul argument out of range");
397  if (_Idx != 0)
398  *_Idx = (size_t)(_Eptr - _Ptr);
399  return (_Ans);
400  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
unsigned long long stoull ( const string _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
287  { // convert string to unsigned long long
288  const char *_Ptr = _Str.c_str();
289  char *_Eptr;
290  errno = 0;
291  unsigned long long _Ans = _CSTD strtoull(_Ptr, &_Eptr, _Base);
292 
293  if (_Ptr == _Eptr)
294  _Xinvalid_argument("invalid stoull argument");
295  if (errno == ERANGE)
296  _Xout_of_range("stoull argument out of range");
297  if (_Idx != 0)
298  *_Idx = (size_t)(_Eptr - _Ptr);
299  return (_Ans);
300  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
unsigned long long stoull ( const wstring _Str,
size_t _Idx = 0,
int  _Base = 10 
)
inline
421  { // convert wstring to unsigned long long
422  const wchar_t *_Ptr = _Str.c_str();
423  wchar_t *_Eptr;
424  errno = 0;
425  unsigned long long _Ans = _CSTD wcstoull(_Ptr, &_Eptr, _Base);
426 
427  if (_Ptr == _Eptr)
428  _Xinvalid_argument("invalid stoull argument");
429  if (errno == ERANGE)
430  _Xout_of_range("stoull argument out of range");
431  if (_Idx != 0)
432  *_Idx = (size_t)(_Eptr - _Ptr);
433  return (_Ans);
434  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xinvalid_argument(_In_z_ const char *)
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
unsigned int size_t
Definition: sourceannotations.h:19
#define errno
Definition: cerrno:18
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
#define _CSTD
Definition: yvals.h:570
string to_string ( int  _Val)
inline
575  { // convert int to string
576  return (_Integral_to_string<char>(_Val));
577  }
_In_ int _Val
Definition: vcruntime_string.h:62
string to_string ( unsigned int  _Val)
inline
580  { // convert unsigned int to string
581  return (_Integral_to_string<char>(_Val));
582  }
_In_ int _Val
Definition: vcruntime_string.h:62
string to_string ( long  _Val)
inline
585  { // convert long to string
586  return (_Integral_to_string<char>(_Val));
587  }
_In_ int _Val
Definition: vcruntime_string.h:62
string to_string ( unsigned long  _Val)
inline
590  { // convert unsigned long to string
591  return (_Integral_to_string<char>(_Val));
592  }
_In_ int _Val
Definition: vcruntime_string.h:62
string to_string ( long long  _Val)
inline
595  { // convert long long to string
596  return (_Integral_to_string<char>(_Val));
597  }
_In_ int _Val
Definition: vcruntime_string.h:62
string to_string ( unsigned long long  _Val)
inline
600  { // convert unsigned long long to string
601  return (_Integral_to_string<char>(_Val));
602  }
_In_ int _Val
Definition: vcruntime_string.h:62
string to_string ( float  _Val)
inline
605  { // convert float to string
606  return (_Floating_to_string("%f", _Val));
607  }
string _Floating_to_string(const char *_Fmt, _Ty _Val)
Definition: string:546
_In_ int _Val
Definition: vcruntime_string.h:62
string to_string ( double  _Val)
inline
610  { // convert double to string
611  return (_Floating_to_string("%f", _Val));
612  }
string _Floating_to_string(const char *_Fmt, _Ty _Val)
Definition: string:546
_In_ int _Val
Definition: vcruntime_string.h:62
string to_string ( long double  _Val)
inline
615  { // convert long double to string
616  return (_Floating_to_string("%Lf", _Val));
617  }
string _Floating_to_string(const char *_Fmt, _Ty _Val)
Definition: string:546
_In_ int _Val
Definition: vcruntime_string.h:62
wstring to_wstring ( int  _Val)
inline
621  { // convert int to wstring
622  return (_Integral_to_string<wchar_t>(_Val));
623  }
_In_ int _Val
Definition: vcruntime_string.h:62
wstring to_wstring ( unsigned int  _Val)
inline
626  { // convert unsigned int to wstring
627  return (_Integral_to_string<wchar_t>(_Val));
628  }
_In_ int _Val
Definition: vcruntime_string.h:62
wstring to_wstring ( long  _Val)
inline
631  { // convert long to wstring
632  return (_Integral_to_string<wchar_t>(_Val));
633  }
_In_ int _Val
Definition: vcruntime_string.h:62
wstring to_wstring ( unsigned long  _Val)
inline
636  { // convert unsigned long to wstring
637  return (_Integral_to_string<wchar_t>(_Val));
638  }
_In_ int _Val
Definition: vcruntime_string.h:62
wstring to_wstring ( long long  _Val)
inline
641  { // convert long long to wstring
642  return (_Integral_to_string<wchar_t>(_Val));
643  }
_In_ int _Val
Definition: vcruntime_string.h:62
wstring to_wstring ( unsigned long long  _Val)
inline
646  { // convert unsigned long long to wstring
647  return (_Integral_to_string<wchar_t>(_Val));
648  }
_In_ int _Val
Definition: vcruntime_string.h:62
wstring to_wstring ( float  _Val)
inline
651  { // convert float to wstring
652  return (_Floating_to_wstring(L"%f", _Val));
653  }
_In_ int _Val
Definition: vcruntime_string.h:62
wstring _Floating_to_wstring(const wchar_t *_Fmt, _Ty _Val)
Definition: string:559
wstring to_wstring ( double  _Val)
inline
656  { // convert double to wstring
657  return (_Floating_to_wstring(L"%f", _Val));
658  }
_In_ int _Val
Definition: vcruntime_string.h:62
wstring _Floating_to_wstring(const wchar_t *_Fmt, _Ty _Val)
Definition: string:559
wstring to_wstring ( long double  _Val)
inline
661  { // convert long double to wstring
662  return (_Floating_to_wstring(L"%Lf", _Val));
663  }
_In_ int _Val
Definition: vcruntime_string.h:62
wstring _Floating_to_wstring(const wchar_t *_Fmt, _Ty _Val)
Definition: string:559