libstdc++
|
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.
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.
Controlling input.
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.
typedef ctype<_CharT> std::basic_istream::__ctype_type |
These are non-standard types.
Reimplemented from std::basic_ios< _CharT, _Traits >.
typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > std::basic_istream::__num_get_type |
These are non-standard types.
Reimplemented from std::basic_ios< _CharT, _Traits >.
typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > std::basic_ios::__num_put_type [inherited] |
These are non-standard types.
Reimplemented in std::basic_ostream.
Definition at line 86 of file basic_ios.h.
typedef _CharT std::basic_istream::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 >.
typedef _Traits::int_type std::basic_istream::int_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 >.
typedef _Traits::off_type std::basic_istream::off_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 >.
typedef _Traits::pos_type std::basic_istream::pos_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 >.
typedef _Traits std::basic_istream::traits_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 >.
std::basic_istream::basic_istream | ( | __streambuf_type * | __sb | ) | [inline, explicit] |
virtual std::basic_istream::~basic_istream | ( | ) | [inline, virtual] |
bool std::basic_ios::bad | ( | ) | const [inline, inherited] |
Fast error checking.
Note that other iostate flags may also be set.
Definition at line 203 of file basic_ios.h.
References std::basic_ios::rdstate(), and std::ios_base::badbit.
void std::basic_ios::clear | ( | iostate | __state = goodbit | ) | [inherited] |
[Re]sets the error state.
state | The new state flag(s) to set. |
See std::ios_base::iostate for the possible bit values. Most users will not need to pass an argument.
Copies fields of __rhs into this.
__rhs | The source values for the copies. |
All fields of __rhs are copied into this object except that rdbuf() and rdstate() remain unchanged. All values in the pword and iword arrays are copied. Before copying, each callback is invoked with erase_event. After copying, each (new) callback is invoked with copyfmt_event. The final step is to copy exceptions().
bool std::basic_ios::eof | ( | ) | const [inline, inherited] |
Fast error checking.
Note that other iostate flags may also be set.
Definition at line 182 of file basic_ios.h.
References std::basic_ios::rdstate(), and std::ios_base::eofbit.
Referenced by std::basic_istream::sentry::sentry(), get(), getline(), ignore(), peek(), putback(), unget(), std::operator>>(), and std::ws().
iostate std::basic_ios::exceptions | ( | ) | const [inline, inherited] |
Throwing exceptions on errors.
This changes nothing in the stream. See the one-argument version of exceptions(iostate) for the meaning of the return value.
Definition at line 214 of file basic_ios.h.
void std::basic_ios::exceptions | ( | iostate | __except | ) | [inline, inherited] |
Throwing exceptions on errors.
except | The new exceptions mask. |
By default, error flags are set silently. You can set an exceptions mask for each stream; if a bit in the mask becomes set in the error flags, then an exception of type std::ios_base::failure is thrown.
If the error flag is already set when the exceptions mask is added, the exception is immediately thrown. Try running the following under GCC 3.1 or later:
#include <iostream> #include <fstream> #include <exception> int main() { std::set_terminate (__gnu_cxx::__verbose_terminate_handler); std::ifstream f ("/etc/motd"); std::cerr << "Setting badbit\n"; f.setstate (std::ios_base::badbit); std::cerr << "Setting exception mask\n"; f.exceptions (std::ios_base::badbit); }
Definition at line 249 of file basic_ios.h.
References std::basic_ios::clear().
bool std::basic_ios::fail | ( | ) | const [inline, inherited] |
Fast error checking.
Checking the badbit in fail() is historical practice. Note that other iostate flags may also be set.
Definition at line 193 of file basic_ios.h.
References std::basic_ios::rdstate(), std::ios_base::badbit, and std::ios_base::failbit.
Referenced by tellg(), seekg(), std::basic_ostream::tellp(), and std::basic_ostream::seekp().
char_type std::basic_ios::fill | ( | ) | const [inline, inherited] |
Retrieves the empty character.
It defaults to a space (' ') in the current locale.
Definition at line 362 of file basic_ios.h.
References std::basic_ios::widen().
Sets a new empty character.
ch | The new character. |
The fill character is used to fill out space when P+ characters have been requested (e.g., via setw), Q characters are actually used, and Q<P. It defaults to a space (' ') in the current locale.
Definition at line 382 of file basic_ios.h.
References std::basic_ios::fill().
streamsize std::basic_istream::gcount | ( | ) | const [inline] |
basic_istream< _CharT, _Traits >::int_type std::basic_istream::get | ( | void | ) |
Simple extraction.
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
Definition at line 238 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::eof(), _M_gcount, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sbumpc(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream::get | ( | char_type & | __c | ) |
Simple extraction.
c | The character in which to store data. |
Tries to extract a character and store it in c. If none are available, sets failbit and returns traits::eof().
Definition at line 274 of file istream.tcc.
References _M_gcount, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sbumpc(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream::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. |
Characters are extracted and stored into s until one of the following happens:
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 311 of file istream.tcc.
References _M_gcount, std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sgetc(), std::basic_streambuf::snextc(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
__istream_type& std::basic_istream::get | ( | char_type * | __s, |
streamsize | __n | ||
) | [inline] |
basic_istream< _CharT, _Traits > & std::basic_istream::get | ( | __streambuf_type & | __sb, |
char_type | __delim | ||
) |
Extraction into another streambuf.
sb | A streambuf in which to store data. |
delim | A "stop" character. |
Characters are extracted and inserted into sb until one of the following happens:
If no characters are stored, failbit is set in the stream's error state.
Definition at line 358 of file istream.tcc.
References _M_gcount, std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sgetc(), std::basic_streambuf::sputc(), std::basic_streambuf::snextc(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
__istream_type& std::basic_istream::get | ( | __streambuf_type & | __sb | ) | [inline] |
basic_istream< _CharT, _Traits > & std::basic_istream::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. |
Extracts and stores characters into s until one of the following happens. Note that these criteria are required to be tested in the order listed here, to allow an input line to exactly fill the s array without setting failbit.
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 402 of file istream.tcc.
References _M_gcount, std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sgetc(), std::basic_streambuf::snextc(), std::basic_streambuf::sbumpc(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
__istream_type& std::basic_istream::getline | ( | char_type * | __s, |
streamsize | __n | ||
) | [inline] |
String extraction.
s | A character array in which to store the data. |
n | Maximum number of characters to extract. |
Returns getline
(s,n,widen('\n')).
Definition at line 408 of file istream.
Referenced by std::basic_istream< char >::getline().
bool std::basic_ios::good | ( | ) | const [inline, inherited] |
Fast error checking.
A wrapper around rdstate.
Definition at line 172 of file basic_ios.h.
References std::basic_ios::rdstate().
basic_istream< _CharT, _Traits > & std::basic_istream::ignore | ( | void | ) |
Discarding characters.
n | Number of characters to discard. |
delim | A "stop" character. |
Extracts characters and throws them away until one of the following happens:
!=
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 462 of file istream.tcc.
References _M_gcount, std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sbumpc(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream::ignore | ( | streamsize | __n | ) |
Simple extraction.
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
Definition at line 495 of file istream.tcc.
References _M_gcount, std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sgetc(), std::basic_streambuf::snextc(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream::ignore | ( | streamsize | __n, |
int_type | __delim | ||
) |
Simple extraction.
Tries to extract a character. If none are available, sets failbit and returns traits::eof().
Definition at line 557 of file istream.tcc.
References _M_gcount, std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sgetc(), std::basic_streambuf::snextc(), std::basic_streambuf::sbumpc(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
Moves to a new locale.
loc | The new locale. |
Calls ios_base::imbue(loc)
, and if a stream buffer is associated with this stream, calls that buffer's pubimbue(loc)
.
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
void std::basic_ios::init | ( | basic_streambuf< _CharT, _Traits > * | __sb | ) | [protected, inherited] |
All setup is performed here.
This is called from the public constructor. It is not virtual and cannot be redefined.
Referenced by std::basic_istream< char >::basic_istream(), and std::basic_ostream< char >::basic_ostream().
char std::basic_ios::narrow | ( | char_type | __c, |
char | __dfault | ||
) | const [inline, inherited] |
Squeezes characters.
c | The character to narrow. |
dfault | The character to narrow. |
Maps a character of char_type
to a character of char
, if possible.
Returns the result of
std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
Definition at line 422 of file basic_ios.h.
std::basic_ios::operator void * | ( | ) | const [inline, inherited] |
The quick-and-easy status check.
This allows you to write constructs such as if (!a_stream) ...
and while (a_stream) ...
Definition at line 113 of file basic_ios.h.
References std::basic_ios::fail().
bool std::basic_ios::operator! | ( | ) | const [inline, inherited] |
The quick-and-easy status check.
This allows you to write constructs such as if (!a_stream) ...
and while (a_stream) ...
Definition at line 117 of file basic_ios.h.
References std::basic_ios::fail().
__istream_type& std::basic_istream::operator>> | ( | __istream_type &(*)(__istream_type &) | __pf | ) | [inline] |
__istream_type& std::basic_istream::operator>> | ( | __ios_type &(*)(__ios_type &) | __pf | ) | [inline] |
__istream_type& std::basic_istream::operator>> | ( | ios_base &(*)(ios_base &) | __pf | ) | [inline] |
__istream_type& std::basic_istream::operator>> | ( | bool & | __n | ) | [inline] |
basic_istream< _CharT, _Traits > & std::basic_istream::operator>> | ( | short & | __n | ) |
Basic arithmetic extractors.
A | variable of builtin type. |
*this
if successfulThese functions use the stream's current locale (specifically, the num_get
facet) to parse the input data.
Definition at line 116 of file istream.tcc.
References std::num_get::get(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
__istream_type& std::basic_istream::operator>> | ( | unsigned short & | __n | ) | [inline] |
basic_istream< _CharT, _Traits > & std::basic_istream::operator>> | ( | int & | __n | ) |
Basic arithmetic extractors.
A | variable of builtin type. |
*this
if successfulThese functions use the stream's current locale (specifically, the num_get
facet) to parse the input data.
Definition at line 161 of file istream.tcc.
References std::num_get::get(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
__istream_type& std::basic_istream::operator>> | ( | unsigned int & | __n | ) | [inline] |
__istream_type& std::basic_istream::operator>> | ( | long & | __n | ) | [inline] |
__istream_type& std::basic_istream::operator>> | ( | unsigned long & | __n | ) | [inline] |
__istream_type& std::basic_istream::operator>> | ( | long long & | __n | ) | [inline] |
__istream_type& std::basic_istream::operator>> | ( | unsigned long long & | __n | ) | [inline] |
__istream_type& std::basic_istream::operator>> | ( | float & | __f | ) | [inline] |
__istream_type& std::basic_istream::operator>> | ( | double & | __f | ) | [inline] |
__istream_type& std::basic_istream::operator>> | ( | long double & | __f | ) | [inline] |
__istream_type& std::basic_istream::operator>> | ( | void *& | __p | ) | [inline] |
basic_istream< _CharT, _Traits > & std::basic_istream::operator>> | ( | __streambuf_type * | __sb | ) |
Extracting into another streambuf.
sb | A pointer to a streambuf |
This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.
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 206 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::rdbuf(), std::ios_base::failbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits >::int_type std::basic_istream::peek | ( | void | ) |
Looking ahead in the stream.
If, after constructing the sentry object, good()
is false, returns traits::eof()
. Otherwise reads but does not extract the next input character.
Definition at line 622 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::eof(), _M_gcount, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sgetc(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream::putback | ( | char_type | __c | ) |
Unextracting a single character.
c | The character to push back into the input stream. |
If 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 713 of file istream.tcc.
References _M_gcount, std::basic_ios< _CharT, _Traits >::clear(), std::basic_ios< _CharT, _Traits >::rdstate(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sputbackc(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
Referenced by std::operator>>().
basic_streambuf<_CharT, _Traits>* std::basic_ios::rdbuf | ( | ) | const [inline, inherited] |
Accessing the underlying buffer.
This does not change the state of the stream.
Definition at line 313 of file basic_ios.h.
Referenced by operator>>(), get(), getline(), ignore(), peek(), read(), readsome(), putback(), unget(), sync(), tellg(), seekg(), std::basic_ostream< char >::_M_write(), std::basic_ostream::operator<<(), std::basic_ostream::put(), std::basic_ostream::flush(), std::basic_ostream::tellp(), and std::basic_ostream::seekp().
basic_streambuf<_CharT, _Traits>* std::basic_ios::rdbuf | ( | basic_streambuf< _CharT, _Traits > * | __sb | ) | [inherited] |
Changing the underlying buffer.
sb | The new stream buffer. |
Associates a new buffer with the current stream, and clears the error state.
Due to historical accidents which the LWG refuses to correct, the I/O library suffers from a design error: this function is hidden in derived classes by overrides of the zero-argument rdbuf()
, which is non-virtual for hysterical raisins. As a result, you must use explicit qualifications to access this function via any derived class. For example:
std::fstream foo; // or some other derived type std::streambuf* p = .....; foo.ios::rdbuf(p); // ios == basic_ios<char>
iostate std::basic_ios::rdstate | ( | ) | const [inline, inherited] |
Returns the error state of the stream buffer.
See std::ios_base::iostate for the possible bit values. Most users will call one of the interpreting wrappers, e.g., good().
Definition at line 129 of file basic_ios.h.
basic_istream< _CharT, _Traits > & std::basic_istream::read | ( | char_type * | __s, |
streamsize | __n | ||
) |
Extraction without delimiters.
s | A character array. |
n | Maximum number of characters to store. |
If the stream state is good()
, extracts characters and stores them into s until one of the following happens:
failbit|eofbit
.Definition at line 652 of file istream.tcc.
References _M_gcount, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sgetn(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
streamsize std::basic_istream::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. |
Extracts characters and stores them into s depending on the number of characters remaining in the streambuf's buffer, 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 681 of file istream.tcc.
References _M_gcount, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::in_avail(), std::basic_streambuf::sgetn(), std::min(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream::seekg | ( | pos_type | __pos | ) |
Changing the current read position.
pos | A file position object. |
If fail()
is not true, calls rdbuf()->pubseekpos(pos)
. If that function fails, sets failbit.
gcount()
. Definition at line 847 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::clear(), std::basic_ios< _CharT, _Traits >::rdstate(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::pubseekpos(), std::ios_base::in, std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits > & std::basic_istream::seekg | ( | off_type | __off, |
ios_base::seekdir | __dir | ||
) |
Changing the current read position.
off | A file offset object. |
dir | The direction in which to seek. |
If fail()
is not true, calls rdbuf()->pubseekoff(off,dir)
. If that function fails, sets failbit.
gcount()
. Definition at line 886 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::clear(), std::basic_ios< _CharT, _Traits >::rdstate(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::pubseekoff(), std::ios_base::in, std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
void std::basic_ios::setstate | ( | iostate | __state | ) | [inline, inherited] |
Sets additional flags in the error state.
state | The additional state flag(s) to set. |
See std::ios_base::iostate for the possible bit values.
Definition at line 149 of file basic_ios.h.
References std::basic_ios::clear(), and std::basic_ios::rdstate().
Referenced by operator>>(), get(), getline(), ignore(), peek(), read(), readsome(), putback(), unget(), sync(), seekg(), std::basic_ostream< char >::_M_write(), std::basic_ostream::operator<<(), std::basic_ostream::put(), std::basic_ostream::flush(), and std::basic_ostream::seekp().
int std::basic_istream::sync | ( | void | ) |
Synchronizing the stream buffer.
If 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 783 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::pubsync(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
basic_istream< _CharT, _Traits >::pos_type std::basic_istream::tellg | ( | void | ) |
Getting the current read position.
If fail()
is not false, returns pos_type
(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in)
.
gcount()
. At variance with putback, unget and seekg, eofbit is not cleared first. Definition at line 819 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::fail(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::pubseekoff(), std::ios_base::cur, std::ios_base::in, and std::ios_base::badbit.
basic_ostream<_CharT, _Traits>* std::basic_ios::tie | ( | ) | const [inline, inherited] |
Fetches the current tied stream.
A stream may be tied (or synchronized) to a second output stream. When this stream performs any I/O, the tied stream is first flushed. For example, std::cin
is tied to std::cout
.
Definition at line 287 of file basic_ios.h.
basic_ostream<_CharT, _Traits>* std::basic_ios::tie | ( | basic_ostream< _CharT, _Traits > * | __tiestr | ) | [inline, inherited] |
Ties this stream to an output stream.
tiestr | The output stream. |
This sets up a new tie; see tie() for more.
Definition at line 299 of file basic_ios.h.
basic_istream< _CharT, _Traits > & std::basic_istream::unget | ( | void | ) |
Unextracting the previous character.
If 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 748 of file istream.tcc.
References _M_gcount, std::basic_ios< _CharT, _Traits >::clear(), std::basic_ios< _CharT, _Traits >::rdstate(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf::sungetc(), std::ios_base::badbit, and std::basic_ios< _CharT, _Traits >::setstate().
char_type std::basic_ios::widen | ( | char | __c | ) | const [inline, inherited] |
Widens characters.
c | The character to widen. |
Maps a character of char
to a character of char_type
.
Returns the result of
std::use_facet<ctype<char_type> >(getloc()).widen(c)
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
Definition at line 441 of file basic_ios.h.
Referenced by std::basic_istream< char >::get(), and std::basic_istream< char >::getline().
streamsize std::basic_istream::_M_gcount [protected] |
The number of characters extracted in the previous unformatted function; see gcount().
Definition at line 81 of file istream.
Referenced by std::basic_istream< char >::~basic_istream(), std::basic_istream< char >::gcount(), get(), getline(), ignore(), peek(), read(), readsome(), putback(), and unget().