38#pragma GCC system_header
41#pragma GCC diagnostic push
42#pragma GCC diagnostic ignored "-Wc++11-extensions"
46namespace std _GLIBCXX_VISIBILITY(default)
48_GLIBCXX_BEGIN_NAMESPACE_VERSION
50 template<
typename _CharT,
typename _Traits>
63 const __int_type
__eof = traits_type::eof();
65 __int_type __c =
__sb->sgetc();
68 while (!traits_type::eq_int_type(__c,
__eof)
69 &&
__ct.is(ctype_base::space,
70 traits_type::to_char_type(__c)))
76 if (traits_type::eq_int_type(__c,
__eof))
83 __throw_exception_again;
98 template<
typename _CharT,
typename _Traits>
99 template<
typename _ValueT>
110#ifndef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
121 __throw_exception_again;
131 template<
typename _CharT,
typename _Traits>
132 basic_istream<_CharT, _Traits>&
145#ifndef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
155 if (
__l < __gnu_cxx::__numeric_traits<short>::__min)
158 __n = __gnu_cxx::__numeric_traits<short>::__min;
160 else if (
__l > __gnu_cxx::__numeric_traits<short>::__max)
163 __n = __gnu_cxx::__numeric_traits<short>::__max;
171 __throw_exception_again;
181 template<
typename _CharT,
typename _Traits>
182 basic_istream<_CharT, _Traits>&
195#ifndef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
205 if (
__l < __gnu_cxx::__numeric_traits<int>::__min)
208 __n = __gnu_cxx::__numeric_traits<int>::__min;
210 else if (
__l > __gnu_cxx::__numeric_traits<int>::__max)
213 __n = __gnu_cxx::__numeric_traits<int>::__max;
221 __throw_exception_again;
231 template<
typename _CharT,
typename _Traits>
243 if (!__copy_streambufs_eof(this->
rdbuf(), __sbout,
__ineof))
251 __throw_exception_again;
263 template<
typename _CharT,
typename _Traits>
264 typename basic_istream<_CharT, _Traits>::int_type
268 const int_type
__eof = traits_type::eof();
269 int_type __c =
__eof;
277 __c = this->
rdbuf()->sbumpc();
279 if (!traits_type::eq_int_type(__c,
__eof))
287 __throw_exception_again;
299 template<
typename _CharT,
typename _Traits>
311 const int_type
__cb = this->
rdbuf()->sbumpc();
313 if (!traits_type::eq_int_type(
__cb, traits_type::eof()))
316 __c = traits_type::to_char_type(
__cb);
324 __throw_exception_again;
336 template<
typename _CharT,
typename _Traits>
349 const int_type
__eof = traits_type::eof();
351 int_type __c =
__sb->sgetc();
354 && !traits_type::eq_int_type(__c,
__eof)
355 && !traits_type::eq_int_type(__c,
__idelim))
357 *
__s++ = traits_type::to_char_type(__c);
359 __c =
__sb->snextc();
361 if (traits_type::eq_int_type(__c,
__eof))
367 __throw_exception_again;
383 template<
typename _CharT,
typename _Traits>
384 basic_istream<_CharT, _Traits>&
396 const int_type
__eof = traits_type::eof();
399 char_type __c2 = traits_type::to_char_type(__c);
400#pragma GCC diagnostic push
401#pragma GCC diagnostic ignored "-Wlong-long"
403#pragma GCC diagnostic pop
405 while (!traits_type::eq_int_type(__c,
__eof)
406 && !traits_type::eq_int_type(__c,
__idelim)
407 && !traits_type::eq_int_type(
__sb.sputc(__c2),
__eof))
411 __c2 = traits_type::to_char_type(__c);
413 if (traits_type::eq_int_type(__c,
__eof))
417 if (
__gcount <= __gnu_cxx::__numeric_traits<streamsize>::__max)
420 _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
425 __throw_exception_again;
437 template<
typename _CharT,
typename _Traits>
450 const int_type
__eof = traits_type::eof();
452 int_type __c =
__sb->sgetc();
455 && !traits_type::eq_int_type(__c,
__eof)
456 && !traits_type::eq_int_type(__c,
__idelim))
458 *
__s++ = traits_type::to_char_type(__c);
459 __c =
__sb->snextc();
462 if (traits_type::eq_int_type(__c,
__eof))
466 if (traits_type::eq_int_type(__c,
__idelim))
478 __throw_exception_again;
497 template<
typename _CharT,
typename _Traits>
498 basic_istream<_CharT, _Traits>&
509 const int_type
__eof = traits_type::eof();
512 if (traits_type::eq_int_type(
__sb->sbumpc(),
__eof))
520 __throw_exception_again;
530 template<
typename _CharT,
typename _Traits>
531 basic_istream<_CharT, _Traits>&
542 const int_type
__eof = traits_type::eof();
544 int_type __c =
__sb->sgetc();
557 && !traits_type::eq_int_type(__c,
__eof))
560 __c =
__sb->snextc();
562 if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
563 && !traits_type::eq_int_type(__c,
__eof))
566 __gnu_cxx::__numeric_traits<streamsize>::__min;
573 if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max)
576 _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
578 if (traits_type::eq_int_type(__c, __eof))
583 if (traits_type::eq_int_type(__c,
__eof))
590 __throw_exception_again;
600 template<
typename _CharT,
typename _Traits>
612 const int_type
__eof = traits_type::eof();
614 int_type __c =
__sb->sgetc();
621 && !traits_type::eq_int_type(__c,
__eof)
622 && !traits_type::eq_int_type(__c,
__delim))
625 __c =
__sb->snextc();
627 if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
628 && !traits_type::eq_int_type(__c,
__eof)
629 && !traits_type::eq_int_type(__c,
__delim))
632 __gnu_cxx::__numeric_traits<streamsize>::__min;
639 if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max)
642 _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
644 if (traits_type::eq_int_type(__c, __eof))
655 if (traits_type::eq_int_type(__c, __eof))
667 __throw_exception_again;
677 template<
typename _CharT,
typename _Traits>
678 typename basic_istream<_CharT, _Traits>::int_type
682 int_type __c = traits_type::eof();
684 sentry
__cerb(*
this,
true);
690 __c = this->
rdbuf()->sgetc();
691 if (traits_type::eq_int_type(__c, traits_type::eof()))
697 __throw_exception_again;
707 template<
typename _CharT,
typename _Traits>
708 basic_istream<_CharT, _Traits>&
726 __throw_exception_again;
736 template<
typename _CharT,
typename _Traits>
752 else if (
__num == -1)
758 __throw_exception_again;
768 template<
typename _CharT,
typename _Traits>
784 const int_type
__eof = traits_type::eof();
787 || traits_type::eq_int_type(
__sb->sputbackc(__c),
__eof))
793 __throw_exception_again;
803 template<
typename _CharT,
typename _Traits>
819 const int_type
__eof = traits_type::eof();
822 || traits_type::eq_int_type(
__sb->sungetc(),
__eof))
828 __throw_exception_again;
838 template<
typename _CharT,
typename _Traits>
855 if (
__sb->pubsync() == -1)
864 __throw_exception_again;
874 template<
typename _CharT,
typename _Traits>
875 typename basic_istream<_CharT, _Traits>::pos_type
881 pos_type
__ret = pos_type(-1);
894 __throw_exception_again;
902 template<
typename _CharT,
typename _Traits>
920 const pos_type __p = this->
rdbuf()->pubseekpos(__pos,
924 if (__p == pos_type(off_type(-1)))
931 __throw_exception_again;
941 template<
typename _CharT,
typename _Traits>
959 const pos_type __p = this->
rdbuf()->pubseekoff(__off,
__dir,
963 if (__p == pos_type(off_type(-1)))
970 __throw_exception_again;
981 template<
typename _CharT,
typename _Traits>
986 typedef typename __istream_type::int_type __int_type;
988 typename __istream_type::sentry
__cerb(
__in,
false);
994 const __int_type
__cb =
__in.rdbuf()->sbumpc();
995 if (!_Traits::eq_int_type(
__cb, _Traits::eof()))
996 __c = _Traits::to_char_type(
__cb);
1003 __throw_exception_again;
1013 template<
typename _CharT,
typename _Traits>
1015 __istream_extract(basic_istream<_CharT, _Traits>& __in, _CharT* __s,
1018 typedef basic_istream<_CharT, _Traits> __istream_type;
1019 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
1020 typedef typename _Traits::int_type int_type;
1021 typedef _CharT char_type;
1022 typedef ctype<_CharT> __ctype_type;
1026 typename __istream_type::sentry __cerb(__in,
false);
1033 if (0 < __width && __width < __num)
1036 const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
1038 const int_type __eof = _Traits::eof();
1039 __streambuf_type* __sb = __in.rdbuf();
1040 int_type __c = __sb->
sgetc();
1042 while (__extracted < __num - 1
1043 && !_Traits::eq_int_type(__c, __eof)
1044 && !__ct.is(ctype_base::space,
1045 _Traits::to_char_type(__c)))
1047 *__s++ = _Traits::to_char_type(__c);
1049 __c = __sb->snextc();
1052 if (__extracted < __num - 1
1053 && _Traits::eq_int_type(__c, __eof))
1064 __throw_exception_again;
1072 __in.setstate(__err);
1076 template<
typename _CharT,
typename _Traits>
1077 basic_istream<_CharT, _Traits>&
1082 typedef typename __istream_type::int_type __int_type;
1087 typename __istream_type::sentry
__cerb(
__in,
true);
1094 const __int_type
__eof = _Traits::eof();
1095 __streambuf_type*
__sb =
__in.rdbuf();
1096 __int_type __c =
__sb->sgetc();
1100 if (_Traits::eq_int_type(__c,
__eof))
1105 if (!
__ct.is(ctype_base::space, _Traits::to_char_type(__c)))
1107 __c =
__sb->snextc();
1113 __throw_exception_again;
1127#if _GLIBCXX_EXTERN_TEMPLATE
1128#pragma GCC diagnostic push
1129#pragma GCC diagnostic ignored "-Wc++11-extensions"
1130#pragma GCC diagnostic ignored "-Wlong-long"
1131 extern template class basic_istream<char>;
1137 extern template istream& istream::_M_extract(
unsigned short&);
1138 extern template istream& istream::_M_extract(
unsigned int&);
1139 extern template istream& istream::_M_extract(
long&);
1140 extern template istream& istream::_M_extract(
unsigned long&);
1141 extern template istream& istream::_M_extract(
bool&);
1142#ifdef _GLIBCXX_USE_LONG_LONG
1143#pragma GCC diagnostic push
1144#pragma GCC diagnostic ignored "-Wlong-long"
1145 extern template istream& istream::_M_extract(
long long&);
1146 extern template istream& istream::_M_extract(
unsigned long long&);
1147#pragma GCC diagnostic pop
1149 extern template istream& istream::_M_extract(
float&);
1150 extern template istream& istream::_M_extract(
double&);
1151 extern template istream& istream::_M_extract(
long double&);
1152 extern template istream& istream::_M_extract(
void*&);
1154 extern template class basic_iostream<char>;
1156#ifdef _GLIBCXX_USE_WCHAR_T
1157 extern template class basic_istream<wchar_t>;
1162 extern template wistream& wistream::_M_extract(
unsigned short&);
1163 extern template wistream& wistream::_M_extract(
unsigned int&);
1164 extern template wistream& wistream::_M_extract(
long&);
1165 extern template wistream& wistream::_M_extract(
unsigned long&);
1166 extern template wistream& wistream::_M_extract(
bool&);
1167#ifdef _GLIBCXX_USE_LONG_LONG
1168 extern template wistream& wistream::_M_extract(
long long&);
1169 extern template wistream& wistream::_M_extract(
unsigned long long&);
1171 extern template wistream& wistream::_M_extract(
float&);
1172 extern template wistream& wistream::_M_extract(
double&);
1173 extern template wistream& wistream::_M_extract(
long double&);
1174 extern template wistream& wistream::_M_extract(
void*&);
1176 extern template class basic_iostream<wchar_t>;
1178#pragma GCC diagnostic pop
1181_GLIBCXX_END_NAMESPACE_VERSION
1184#pragma GCC diagnostic pop
basic_istream< char > istream
Base class for char input streams.
basic_istream< wchar_t > wistream
Base class for wchar_t input streams.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
ISO C++ entities toplevel namespace is std.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
basic_istream< _CharT, _Traits > & ws(basic_istream< _CharT, _Traits > &__is)
Quick and easy way to eat whitespace.
void clear(iostate __state=goodbit)
[Re]sets the error state.
void setstate(iostate __state)
Sets additional flags in the error state.
iostate rdstate() const
Returns the error state of the stream buffer.
bool fail() const
Fast error checking.
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
The actual work of input and output (interface).
int_type sbumpc()
Getting the next character.
int_type sgetc()
Getting the next character.
Template class basic_istream.
__istream_type & seekg(pos_type)
Changing the current read position.
int_type get()
Simple extraction.
streamsize readsome(char_type *__s, streamsize __n)
Extraction until the buffer is exhausted, but no more.
int_type peek()
Looking ahead in the stream.
__istream_type & unget()
Unextracting the previous character.
pos_type tellg()
Getting the current read position.
__istream_type & ignore()
Simple extraction.
__istream_type & read(char_type *__s, streamsize __n)
Extraction without delimiters.
__istream_type & putback(char_type __c)
Unextracting a single character.
__istream_type & getline(char_type *__s, streamsize __n, char_type __delim)
String extraction.
__istream_type & operator>>(__istream_type &(*__pf)(__istream_type &))
Interface for manipulators.
int sync()
Synchronizing the stream buffer.
Performs setup work for input streams.
sentry(basic_istream< _CharT, _Traits > &__is, bool __noskipws=false)
The constructor performs all the work.
Thrown as part of forced unwinding.
static const fmtflags skipws
Skips leading white space before certain input operations.
_Ios_Iostate iostate
This is a bitmask type.
static const seekdir cur
Request a seek relative to the current position within the sequence.
static const openmode in
Open for input. Default for ifstream and fstream.
static const iostate eofbit
Indicates that an input operation reached the end of an input sequence.
static const iostate goodbit
Indicates all is well.
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...
static const iostate failbit
Indicates that an input operation failed to read the expected characters, or that an output operation...