std::basic_istream::unget

basic_istream& unget(); Makes the most recently extracted character available again. First clears eofbit. (since C++11) Then the function behaves as UnformattedInputFunction. After constructing and checking the sentry object, if any ios_base::iostate flags are set, the function sets failbit and returns. Otherwise, calls rdbuf()->sungetc(). If rdbuf()->sungetc() returns Traits::eof(), calls setstate(badbit). In any case, sets the gcount() counter to zero. Parameters (non

std::basic_istream::tellg

pos_type tellg(); Returns input position indicator of the current associated streambuf object. Behaves as UnformattedInputFunction, except that gcount() is not affected. After constructing and checking the sentry object, if fail() == true, returns pos_type(-1). Otherwise, returns rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::in). Parameters (none). Return value The current position of the get pointer on success, pos_type(-1) on failure. Exceptions failure if an

std::basic_istream::sync

int sync(); Synchronizes the input buffer with the associated data source. Behaves as UnformattedInputFunction, except that gcount() is not affected. After constructing and checking the sentry object, if rdbuf() is a null pointer, returns -1. Otherwise, calls rdbuf()->pubsync(). If that function returns -1, calls setstate(badbit) and returns -1. Otherwise, returns ​0​. Parameters (none). Return value ​0​ on success, -1 on failure or if the stream does not support this operation

std::basic_istream::swap

protected: void swap(basic_istream& rhs); (since C++11) Calls basic_ios::swap(rhs) to swap all data members of the base class except for rdbuf(), and swaps the values of the gcount() counters between *this and rhs. This swap function is protected: it is called by the swap functions of the swappable input stream classes std::basic_ifstream and std::basic_istringstream, which know how to correctly swap the associated streambuffers. Parameters rhs - different basic_istream obje

std::basic_istream::sentry

class sentry; An object of class basic_istream::sentry is constructed in local scope at the beginning of each member function of std::basic_istream that performs input (both formatted and unformatted). Its constructor prepares the input stream: checks if the stream is already in a failed state, flushes the tie()'d output streams, skips leading whitespace unless noskipws flag is set, and performs other implementation-defined tasks if necessary. All cleanup, if necessary, is performed in

std::basic_istream::seekg

basic_istream& seekg( pos_type pos ); basic_istream& seekg( off_type off, std::ios_base::seekdir dir); Sets input position indicator of the current associated streambuf object. In case of failure, calls setstate(std::ios_base::failbit). Before doing anything else, seekg clears eofbit. (since C++11) seekg behaves as UnformattedInputFunction, except that gcount() is not affected. After constructing and checking the sentry object, 1) sets the input position indicator to ab

std::basic_istream::readsome

std::streamsize readsome( char_type* s, std::streamsize count ); Extracts up to count immediately available characters from the input stream. The extracted characters are stored into the character array pointed to by s. Behaves as UnformattedInputFunction. After constructing and checking the sentry object, If rdbuf()->in_avail() == -1, calls setstate(eofbit) and extracts no characters. If rdbuf()->in_avail() == 0, extracts no characters. If rdbuf()->in_avail() > 0, extr

std::basic_istream::read

basic_istream& read( char_type* s, std::streamsize count ); Extracts characters from stream. Behaves as UnformattedInputFunction. After constructing and checking the sentry object, extracts characters and stores them into successive locations of the character array whose first element is pointed to by s. Characters are extracted and stored until any of the following conditions occurs: count characters were extracted and stored end of file condition occurs on the input sequence (i

std::basic_istream::putback

basic_istream& putback( char_type ch ); Puts the character ch back to the input stream so the next extracted character will be ch. First clears eofbit, then behaves as UnformattedInputFunction. After constructing and checking the sentry object, if rdbuf() is not null, calls rdbuf()->sputbackc(ch), which calls rdbuf()->pbackfail(ch) if ch does not equal the most recently extracted character. If rdbuf() is null or if rdbuf->sputbackc(ch) returns Traits::eof(), calls setstate(

std::basic_istream::peek

int_type peek(); Behaves as UnformattedInputFunction. After constructing and testing the sentry object, reads the next character from the input stream without extracting it. Parameters (none). Return value If good() == true, returns the next character as obtained by rdbuf()->sgetc(). Otherwise, returns Traits::eof(). Exceptions failure if an error occurred (the error state flag is not goodbit) and exceptions() is set to throw for that state. If an internal operation throw