std::ios_base (3) - Linux Manuals
std::ios_base: std::ios_base
NAME
Synopsis
Defined in header <ios>
class ios_base;
The class ios_base is a multipurpose class that serves as the base class for all I/O stream classes. It maintains several kinds of data:
1) state information: stream status flags
2) control information: flags that control formatting of both input and output sequences and the imbued locale
3) private storage: indexed extensible data structure that allows both long and void* members, which may be implemented as two arbitrary-length arrays or a single array of two-element structs or another container.
4) callbacks: arbitrary number of user-defined functions to be called from imbue(), copyfmt(), and ~ios_base()
Typical implementation holds member constants corresponding to all values of fmtflags, iostate, openmode, and seekdir 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 for xalloc().
Member functions
constructor (protected member function)
destructor destructs the object
[virtual]
Formatting
flags (public member function)
setf (public member function)
unsetf (public member function)
precision (public member function)
width (public member function)
Locales
imbue (public member function)
getloc (public member function)
Internal extensible array
xalloc returns a program-wide unique integer that is safe to use as index to pword() and iword()
[static]
iword (public member function)
pword (public member function)
Miscellaneous
register_callback (public member function)
sync_with_stdio sets whether C++ and C IO libraries are interoperable
[static]
Member classes
failure (public member class)
Init (public member class)
Member types and constants
Type Explanation
openmode in open for reading
fmtflags fixed generate floating point types using fixed notation, or hex notation if combined with scientific: see std::fixed
iostate badbit irrecoverable stream error
seekdir end the ending of a stream
event (enum)
event_callback (typedef)
Deprecated member types
Type Explanation
io_state(deprecated) integer type that may be used like iostate (until C++17)
open_mode(deprecated) integer type that may be used like openmode
seek_dir(deprecated) integer type that may be used like seekdir
streamoff(deprecated) unspecified type that may be used like off_type, not necessarily std::streamoff
streampos(deprecated) unspecified type that may be used like pos_type, not necessarily std::streampos