Base class with template-independent members for the standard stream class hierarchy.
Standard hierarchy
Public member functions:
flags |
Get/set format flags. |
getloc |
Get current locale. |
imbue |
Imbue locale. |
iword |
Get reference to a long element of the internal extensible array. |
precision |
Get/set floating-point decimal presision. |
pword |
Get reference to a void* element of the internal extensible array. |
register_callback |
Register event callback function. |
setf |
Set some format flags. |
sync_with_stdio |
Activates / Deactivates synchronization with cstdio functions. [static] |
unsetf |
Clear format flag. |
width |
Get/set field width. |
xalloc |
Return a new index for the internal extensible array. [static] |
Note: Constructor is protected.
Member types / Nested classes:
event |
Event. |
failure |
Base class for stream exceptions. |
fmtflags |
Bitmask type for format flags. |
Init |
Embedded class that ensures the construction of stream objects. |
iostate |
Bitmask type for state flags. |
openmode |
Bitmask type for opening mode flags. |
seekdir |
Enumerated-like type to indicate seeking direction. |
Applicable Manipulators:
boolalpha |
insert/extract bool objects as names (true or false). |
dec |
insert/extract integer values in decimal format. |
fixed |
insert floating-point values in fixed format. |
hex |
insert/extract integer values in hexadecimal format. |
internal |
internal-justify. |
left |
left-justify. |
noboolalpha |
insert/extract bool objects as numeric values. |
noshowbase |
do not prefix value with its base. |
noshowpoint |
do not show decimal point if not necessary. |
noshowpos |
do not insert plus sign (+) if number is non-negative. |
noskipws |
do not skip initial white space on extracting. |
nounitbuf |
do not flush buffer after each insert operation. |
nouppercase |
do not replace lowercase letters by uppercase equivalents. |
oct |
insert/extract values in octal format. |
right |
right-justify. |
scientific |
insert floating-point values in scientific format. |
showbase |
prefix value with its base |
showpoint |
always show decimal point when inserting floating-point values |
showpos |
insert plus sign (+) before every non-negative value. |
skipws |
skip initial white space on extracting. |
unitbuf |
flush buffer after each insert operation |
uppercase |
replace lowercase letters by uppercase equivalents. |
Description
The class is designed to be a base class for all the stream classes hierarchy. It describes the most basic part of a stream which is common to all stream objects. It is not intended to be directly instantiated to objects.
Both the ios_base class and its derived ios class define the members of every stream that are independent of wether the stream object is an input or an output stream. ios_base describes the members that are template-independent (i.e. the part that is not dependent on the type of character used by the stream) while ios describes the members that are template-dependent.
The ios_base class is in charge of mantaining internally the following information of a stream:
- Formatting information:
-
- format flags: a set of flags describing how certain input/output operations shall be interpreted. It is an internal object of type ios_base::fmtflags that can be obtained/modified by calling members flags, setf and unsetf. The manipulators listed above modify individual format flags.
- field width: describes the width of the next element to be output. It is an integer of type streamsize and may be obtained/modified by calling member width.
- display precision: describes the decimal precision to be used to output floating-point values. It is an integer value of type streamsize and can be obtained/modified by calling member precision.
- locale object: describes localization properties to be considered when formatting i/o operations. It is an object of type locale that can be obtained calling member getloc and modified using imbue.
- State information:
-
- Other:
-
- event function stack: stack of pointers to callback functions that are called when certain events occur. Additional callback functions may be registered to be called when an even occurs, with member register_callback.
- two internal extensible arrays: internal arrays of long objects and void pointers. To extend the array call class member xalloc, and to get references to these objects call iword or pword