This is an internal header file, included by other library headers. More...
#include <bits/localefwd.h>
#include <bits/locale_classes.h>
#include <bits/locale_facets.h>
#include <bits/streambuf_iterator.h>
#include <bits/move.h>
#include <bits/basic_ios.tcc>
Functions | |
namespace std | _GLIBCXX_VISIBILITY (default) |
This is an internal header file, included by other library headers.
Do not attempt to use it directly. {ios}
namespace std _GLIBCXX_VISIBILITY | ( | default | ) |
Template class basic_ios, virtual base class for all stream classes.
_CharT | Type of character stream. |
_Traits | Traits for character type, defaults to char_traits<_CharT>. |
Most of the member functions called dispatched on stream objects (e.g., std::cout.foo(bar)
;) are consolidated in this class.
These are standard types. They permit a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation.
These are non-standard types.
The quick-and-easy status check.
This allows you to write constructs such as if (!a_stream) ...
and while (a_stream) ...
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().
[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.
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.
Fast error checking.
A wrapper around rdstate.
Fast error checking.
Note that other iostate flags may also be set.
Fast error checking.
Checking the badbit in fail() is historical practice. Note that other iostate flags may also be set.
Fast error checking.
Note that other iostate flags may also be set.
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.
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:
Constructor performs initialization.
The parameter is passed by derived streams.
Empty.
The destructor does nothing. More specifically, it does not destroy the streambuf held by rdbuf().
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
.
Ties this stream to an output stream.
__tiestr | The output stream. |
This sets up a new tie; see tie() for more.
Accessing the underlying buffer.
This does not change the state of the stream.
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:
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().
Retrieves the empty character.
It defaults to a space (' ') in the current locale.
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.
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
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
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
Widens characters.
__c | The character to widen. |
Maps a character of char
to a character of char_type
.
Returns the result of
Additional l10n notes are at http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
Empty.
The default constructor does nothing and is not normally accessible to users.
All setup is performed here.
This is called from the public constructor. It is not virtual and cannot be redefined.
References __throw_exception_again, and std::__exception_ptr::swap().