I/O manipulators | ||||
Print functions(C++23) | ||||
C-style I/O | ||||
Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
Streams | ||||
Abstractions | ||||
ios_base | ||||
File I/O | ||||
String I/O | ||||
Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
Synchronized Output | ||||
(C++20) | ||||
Types | ||||
Error category interface | ||||
(C++11) | ||||
(C++11) |
Member functions | ||||
Formatting | ||||
Locales | ||||
Internal extensible array | ||||
Miscellaneous | ||||
Member classes | ||||
Member types | ||||
Defined in header <ios> | ||
class ios_base; | ||
The classios_base
is a multipurpose class that serves as the base class for all I/O stream classes. It maintains several kinds of data:
Typical implementation holds member constants corresponding to all values offmtflags,iostate,openmode, andseekdir shown below, member variables to maintain current precision, width, and formatting flags, the exception mask, the buffer error state, a resizeable container holding the callbacks, the currently imbued locale, the private storage, and a static integer variable forxalloc().
Contents |
constructs the object (protected member function)[edit] | |
[virtual] | destructs the object (virtual public member function)[edit] |
assigns to the stream (public member function)[edit] | |
Formatting | |
manages format flags (public member function)[edit] | |
sets specific format flag (public member function)[edit] | |
clears specific format flag (public member function)[edit] | |
manages decimal precision of floating point operations (public member function)[edit] | |
manages field width (public member function)[edit] | |
Locales | |
sets locale (public member function)[edit] | |
returns current locale (public member function)[edit] | |
Internal extensible array | |
[static] | returns a program-wide unique integer that is safe to use as index topword() andiword() (public static member function)[edit] |
resizes the private storage if necessary and access to thelong element at the given index (public member function)[edit] | |
resizes the private storage if necessary and access to thevoid* element at the given index (public member function)[edit] | |
Miscellaneous | |
registers event callback function (public member function)[edit] | |
[static] | sets whether C++ and C I/O libraries are interoperable (public static member function)[edit] |
Member classes | |
stream exception (public member class)[edit] | |
initializes standard stream objects (public member class)[edit] |
Member types and constants | |||||||||||||||||||||||||||||||||||||||
Type | Explanation | ||||||||||||||||||||||||||||||||||||||
stream open mode type The following constants are also defined:
(typedef)[edit] | |||||||||||||||||||||||||||||||||||||||
formatting flags type The following constants are also defined:
(typedef)[edit] | |||||||||||||||||||||||||||||||||||||||
state of the stream type The following constants are also defined:
(typedef)[edit] | |||||||||||||||||||||||||||||||||||||||
seeking direction type The following constants are also defined:
(typedef)[edit] | |||||||||||||||||||||||||||||||||||||||
specifies event type (enum)[edit] | |||||||||||||||||||||||||||||||||||||||
callback function type (typedef)[edit] |
| (until C++17) |
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
LWG 1357 (N3110) | C++98 | std::ios_base definedoperator~,operator&andoperator| for types openmode ,fmtflags andiostate , violating the requirements ofBitmaskType[1] | removed these definitions |
manages an arbitrary stream buffer (class template)[edit] |