Inheritance diagram for std::basic_istream< _CharT, _Traits >:
Public Types | |
typedef _CharT | char_type |
typedef _Traits::int_type | int_type |
typedef _Traits::pos_type | pos_type |
typedef _Traits::off_type | off_type |
typedef _Traits | traits_type |
typedef basic_streambuf< _CharT, _Traits > | __streambuf_type |
typedef basic_ios< _CharT, _Traits > | __ios_type |
typedef basic_istream< _CharT, _Traits > | __istream_type |
typedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > | __num_get_type |
typedef ctype< _CharT > | __ctype_type |
Public Member Functions | |
basic_istream (__streambuf_type *__sb) | |
Base constructor. | |
virtual | ~basic_istream () |
Base destructor. | |
streamsize | gcount () const |
Character counting. | |
__istream_type & | operator>> (__istream_type &(*__pf)(__istream_type &)) |
Interface for manipulators. | |
__istream_type & | operator>> (__ios_type &(*__pf)(__ios_type &)) |
__istream_type & | operator>> (ios_base &(*__pf)(ios_base &)) |
Arithmetic Extractors | |
All the operator>> functions (aka formatted input functions) have some common behavior. Each starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to false. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more.If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument.
If an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state without causing an ios_base::failure to be thrown. The original exception will then be rethrown. | |
__istream_type & | operator>> (bool &__n) |
Basic arithmetic extractors. | |
__istream_type & | operator>> (short &__n) |
__istream_type & | operator>> (unsigned short &__n) |
__istream_type & | operator>> (int &__n) |
__istream_type & | operator>> (unsigned int &__n) |
__istream_type & | operator>> (long &__n) |
__istream_type & | operator>> (unsigned long &__n) |
__istream_type & | operator>> (float &__f) |
__istream_type & | operator>> (double &__f) |
__istream_type & | operator>> (long double &__f) |
__istream_type & | operator>> (void *&__p) |
__istream_type & | operator>> (__streambuf_type *__sb) |
Extracting into another streambuf. | |
Unformatted Input Functions | |
All the unformatted input functions have some common behavior. Each starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to true. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more. If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument. The number of characters extracted is stored for later retrieval by gcount().
If an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state without causing an ios_base::failure to be thrown. The original exception will then be rethrown. | |
int_type | get () |
Simple extraction. | |
__istream_type & | get (char_type &__c) |
Simple extraction. | |
__istream_type & | get (char_type *__s, streamsize __n, char_type __delim) |
Simple multiple-character extraction. | |
__istream_type & | get (char_type *__s, streamsize __n) |
Simple multiple-character extraction. | |
__istream_type & | get (__streambuf_type &__sb, char_type __delim) |
Extraction into another streambuf. | |
__istream_type & | get (__streambuf_type &__sb) |
Extraction into another streambuf. | |
__istream_type & | getline (char_type *__s, streamsize __n, char_type __delim) |
String extraction. | |
__istream_type & | getline (char_type *__s, streamsize __n) |
String extraction. | |
__istream_type & | ignore () |
Discarding characters. | |
__istream_type & | ignore (streamsize __n) |
__istream_type & | ignore (streamsize __n, int_type __delim) |
int_type | peek () |
Looking ahead in the stream. | |
__istream_type & | read (char_type *__s, streamsize __n) |
Extraction without delimiters. | |
streamsize | readsome (char_type *__s, streamsize __n) |
Extraction until the buffer is exhausted, but no more. | |
__istream_type & | putback (char_type __c) |
Unextracting a single character. | |
__istream_type & | unget () |
Unextracting the previous character. | |
int | sync () |
Synchronizing the stream buffer. | |
pos_type | tellg () |
Getting the current read position. | |
__istream_type & | seekg (pos_type) |
Changing the current read position. | |
__istream_type & | seekg (off_type, ios_base::seekdir) |
Changing the current read position. | |
Protected Member Functions | |
basic_istream () | |
Protected Attributes | |
streamsize | _M_gcount |
Friends | |
class | sentry |
template<typename _CharT2, typename _Traits2> | |
basic_istream< _CharT2, _Traits2 > & | operator>> (basic_istream< _CharT2, _Traits2 > &, _CharT2 &) |
template<typename _CharT2, typename _Traits2> | |
basic_istream< _CharT2, _Traits2 > & | operator>> (basic_istream< _CharT2, _Traits2 > &, _CharT2 *) |
Classes | |
class | sentry |
Performs setup work for input streams. More... |
This is the base class for all input streams. It provides text formatting of all builtin types, and communicates with any class derived from basic_streambuf to do the actual input.
Definition at line 58 of file istream.
typedef ctype<_CharT> std::basic_istream< _CharT, _Traits >::__ctype_type |
typedef basic_ios<_CharT, _Traits> std::basic_istream< _CharT, _Traits >::__ios_type |
typedef basic_istream<_CharT, _Traits> std::basic_istream< _CharT, _Traits >::__istream_type |
typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > std::basic_istream< _CharT, _Traits >::__num_get_type |
typedef basic_streambuf<_CharT, _Traits> std::basic_istream< _CharT, _Traits >::__streambuf_type |
typedef _CharT std::basic_istream< _CharT, _Traits >::char_type |
These are standard types. They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.
Reimplemented from std::basic_ios< _CharT, _Traits >.
Reimplemented in std::strstream, std::basic_ifstream< _CharT, _Traits >, std::basic_fstream< _CharT, _Traits >, std::basic_iostream< _CharT, _Traits >, std::basic_istringstream< _CharT, _Traits, _Alloc >, std::basic_stringstream< _CharT, _Traits, _Alloc >, and std::basic_iostream< char >.
typedef _Traits::int_type std::basic_istream< _CharT, _Traits >::int_type |
Reimplemented from std::basic_ios< _CharT, _Traits >.
Reimplemented in std::strstream, std::basic_ifstream< _CharT, _Traits >, std::basic_fstream< _CharT, _Traits >, std::basic_iostream< _CharT, _Traits >, std::basic_istringstream< _CharT, _Traits, _Alloc >, std::basic_stringstream< _CharT, _Traits, _Alloc >, and std::basic_iostream< char >.
typedef _Traits::off_type std::basic_istream< _CharT, _Traits >::off_type |
Reimplemented from std::basic_ios< _CharT, _Traits >.
Reimplemented in std::strstream, std::basic_ifstream< _CharT, _Traits >, std::basic_fstream< _CharT, _Traits >, std::basic_iostream< _CharT, _Traits >, std::basic_istringstream< _CharT, _Traits, _Alloc >, std::basic_stringstream< _CharT, _Traits, _Alloc >, and std::basic_iostream< char >.
typedef _Traits::pos_type std::basic_istream< _CharT, _Traits >::pos_type |
Reimplemented from std::basic_ios< _CharT, _Traits >.
Reimplemented in std::strstream, std::basic_ifstream< _CharT, _Traits >, std::basic_fstream< _CharT, _Traits >, std::basic_iostream< _CharT, _Traits >, std::basic_istringstream< _CharT, _Traits, _Alloc >, std::basic_stringstream< _CharT, _Traits, _Alloc >, and std::basic_iostream< char >.
typedef _Traits std::basic_istream< _CharT, _Traits >::traits_type |
Reimplemented from std::basic_ios< _CharT, _Traits >.
Reimplemented in std::basic_ifstream< _CharT, _Traits >, std::basic_fstream< _CharT, _Traits >, std::basic_iostream< _CharT, _Traits >, std::basic_istringstream< _CharT, _Traits, _Alloc >, std::basic_stringstream< _CharT, _Traits, _Alloc >, and std::basic_iostream< char >.
std::basic_istream< _CharT, _Traits >::basic_istream | ( | __streambuf_type * | __sb | ) | [inline, explicit] |
virtual std::basic_istream< _CharT, _Traits >::~basic_istream | ( | ) | [inline, virtual] |
std::basic_istream< _CharT, _Traits >::basic_istream | ( | ) | [inline, explicit, protected] |
streamsize std::basic_istream< _CharT, _Traits >::gcount | ( | ) | const [inline] |
__istream_type& std::basic_istream< _CharT, _Traits >::get | ( | __streambuf_type & | __sb | ) | [inline] |
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get | ( | __streambuf_type & | __sb, | |
char_type | __delim | |||
) |
Extraction into another streambuf.
sb | A streambuf in which to store data. | |
delim | A "stop" character. |
If no characters are stored, failbit is set in the stream's error state.
Definition at line 550 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_streambuf< _CharT, _Traits >::sgetc(), std::basic_streambuf< _CharT, _Traits >::snextc(), and std::basic_streambuf< _CharT, _Traits >::sputc().
__istream_type& std::basic_istream< _CharT, _Traits >::get | ( | char_type * | __s, | |
streamsize | __n | |||
) | [inline] |
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get | ( | char_type * | __s, | |
streamsize | __n, | |||
char_type | __delim | |||
) |
Simple multiple-character extraction.
s | Pointer to an array. | |
n | Maximum number of characters to store in s. | |
delim | A "stop" character. |
n-1
characters are storedIf no characters are stored, failbit is set in the stream's error state.
In any case, a null character is stored into the next location in the array.
Definition at line 508 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_streambuf< _CharT, _Traits >::sgetc(), and std::basic_streambuf< _CharT, _Traits >::snextc().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get | ( | char_type & | __c | ) |
Simple extraction.
c | The character in which to store data. |
Definition at line 476 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits >::int_type std::basic_istream< _CharT, _Traits >::get | ( | ) |
Simple extraction.
Definition at line 445 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by std::basic_istream< char >::get().
__istream_type& std::basic_istream< _CharT, _Traits >::getline | ( | char_type * | __s, | |
streamsize | __n | |||
) | [inline] |
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::getline | ( | char_type * | __s, | |
streamsize | __n, | |||
char_type | __delim | |||
) |
String extraction.
s | A character array in which to store the data. | |
n | Maximum number of characters to extract. | |
delim | A "stop" character. |
delim
, in which case the character is extracted (and therefore counted in gcount()
) but not storedn-1
characters are stored, in which case failbit is set in the stream error stateIf no characters are extracted, failbit is set. (An empty line of input should therefore not cause failbit to be set.)
In any case, a null character is stored in the next location in the array.
Definition at line 589 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf< _CharT, _Traits >::sbumpc(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_streambuf< _CharT, _Traits >::sgetc(), and std::basic_streambuf< _CharT, _Traits >::snextc().
Referenced by std::basic_istream< char >::getline().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore | ( | streamsize | __n, | |
int_type | __delim | |||
) |
Definition at line 728 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::max(), std::min(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf< _CharT, _Traits >::sbumpc(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_streambuf< _CharT, _Traits >::sgetc(), and std::basic_streambuf< _CharT, _Traits >::snextc().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore | ( | streamsize | __n | ) |
Definition at line 672 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::max(), std::min(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_streambuf< _CharT, _Traits >::sgetc(), and std::basic_streambuf< _CharT, _Traits >::snextc().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore | ( | ) |
Discarding characters.
n | Number of characters to discard. | |
delim | A "stop" character. |
!=
std::numeric_limits<int>::max()
, n characters are extractedtraits::eof()
.NB: Provide three overloads, instead of the single function (with defaults) mandated by the Standard: this leads to a better performing implementation, while still conforming to the Standard.
Definition at line 644 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf< _CharT, _Traits >::sbumpc(), and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | __streambuf_type * | __sb | ) |
Extracting into another streambuf.
sb | A pointer to a streambuf |
If sb is NULL, the stream will set failbit in its error state.
Characters are extracted from this stream and inserted into the sb streambuf until one of the following occurs:
If the function inserts no characters, failbit is set.
Definition at line 421 of file istream.tcc.
References std::__copy_streambufs(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::failbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | void *& | __p | ) |
Definition at line 399 of file istream.tcc.
References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | long double & | __f | ) |
Definition at line 377 of file istream.tcc.
References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | double & | __f | ) |
Definition at line 355 of file istream.tcc.
References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | float & | __f | ) |
Definition at line 333 of file istream.tcc.
References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | unsigned long & | __n | ) |
Definition at line 265 of file istream.tcc.
References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | long & | __n | ) |
Definition at line 243 of file istream.tcc.
References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | unsigned int & | __n | ) |
Definition at line 221 of file istream.tcc.
References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | int & | __n | ) |
Definition at line 190 of file istream.tcc.
References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::failbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | unsigned short & | __n | ) |
Definition at line 168 of file istream.tcc.
References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | short & | __n | ) |
Definition at line 137 of file istream.tcc.
References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::failbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | bool & | __n | ) |
Basic arithmetic extractors.
A | variable of builtin type. |
*this
if successfulnum_get
facet) to parse the input data.
Definition at line 115 of file istream.tcc.
References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | ios_base &(*)(ios_base &) | __pf | ) | [inline] |
Definition at line 106 of file istream.tcc.
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | __ios_type &(*)(__ios_type &) | __pf | ) | [inline] |
Definition at line 97 of file istream.tcc.
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> | ( | __istream_type &(*)(__istream_type &) | __pf | ) | [inline] |
Interface for manipulators.
Manuipulators such as std::ws
and std::dec
use these functions in constructs like "std::cin >> std::ws". For more information, see the iomanip header.
Definition at line 91 of file istream.tcc.
basic_istream< _CharT, _Traits >::int_type std::basic_istream< _CharT, _Traits >::peek | ( | ) |
Looking ahead in the stream.
good()
is false, returns traits::eof()
. Otherwise reads but does not extract the next input character.
Definition at line 786 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::putback | ( | char_type | __c | ) |
Unextracting a single character.
c | The character to push back into the input stream. |
rdbuf()
is not null, calls rdbuf()->sputbackc(c)
.
If rdbuf()
is null or if sputbackc()
fails, sets badbit in the error state.
gcount()
will return 0, as required by DR 60. Definition at line 862 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_streambuf< _CharT, _Traits >::sputbackc().
Referenced by std::operator>>().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::read | ( | char_type * | __s, | |
streamsize | __n | |||
) |
Extraction without delimiters.
s | A character array. | |
n | Maximum number of characters to store. |
good()
, extracts characters and stores them into s until one of the following happens:failbit|eofbit
.
Definition at line 811 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
streamsize std::basic_istream< _CharT, _Traits >::readsome | ( | char_type * | __s, | |
streamsize | __n | |||
) |
Extraction until the buffer is exhausted, but no more.
s | A character array. | |
n | Maximum number of characters to store. |
rdbuf()->in_avail()
, called A
here:A
==
-1
, sets eofbit and extracts no charactersA
==
0
, extracts no charactersA
>
0
, extracts min(A,n)
The goal is to empty the current buffer, and to not request any more from the external input sequence controlled by the streambuf.
Definition at line 835 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::min(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg | ( | off_type | , | |
ios_base::seekdir | ||||
) |
Changing the current read position.
off | A file offset object. | |
dir | The direction in which to seek. |
fail()
is not true, calls rdbuf()->pubseekoff(off,dir)
. If that function fails, sets failbit.
gcount()
. Definition at line 995 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg | ( | pos_type | ) |
Changing the current read position.
pos | A file position object. |
fail()
is not true, calls rdbuf()->pubseekpos(pos)
. If that function fails, sets failbit.
gcount()
. Definition at line 967 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, and std::basic_ios< _CharT, _Traits >::setstate().
int std::basic_istream< _CharT, _Traits >::sync | ( | ) |
Synchronizing the stream buffer.
rdbuf()
is a null pointer, returns -1.
Otherwise, calls rdbuf()->pubsync()
, and if that returns -1, sets badbit and returns -1.
Otherwise, returns 0.
gcount()
. Definition at line 918 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::goodbit, std::basic_streambuf< _CharT, _Traits >::pubsync(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits >::pos_type std::basic_istream< _CharT, _Traits >::tellg | ( | ) |
Getting the current read position.
fail()
is not false, returns pos_type
(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in)
.
gcount()
. Definition at line 949 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::cur, and std::ios_base::in.
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::unget | ( | ) |
Unextracting the previous character.
rdbuf()
is not null, calls rdbuf()->sungetc(c)
.
If rdbuf()
is null or if sungetc()
fails, sets badbit in the error state.
gcount()
will return 0, as required by DR 60. Definition at line 890 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_streambuf< _CharT, _Traits >::sungetc().
basic_istream<_CharT2, _Traits2>& operator>> | ( | basic_istream< _CharT2, _Traits2 > & | , | |
_CharT2 * | ||||
) | [friend] |
basic_istream<_CharT2, _Traits2>& operator>> | ( | basic_istream< _CharT2, _Traits2 > & | , | |
_CharT2 & | ||||
) | [friend] |
friend class sentry [friend] |
streamsize std::basic_istream< _CharT, _Traits >::_M_gcount [protected] |
Definition at line 92 of file istream.
Referenced by std::basic_istream< char >::gcount(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::getline(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::peek(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::unget(), and std::basic_istream< char >::~basic_istream().