Basic facilities
- slide 38 : 46
Stream State
The C++ Progr. Lang. (3. edition)
: Page 616
Streams in C++ have state associated that represents
error conditions
and
formatting details
Error condition or non-standard condition - class
basis_ios
strm.good()
strm.eof()
strm.fail()
strm.bad()
In boolean contexts, a stream is converted to a value of type
void*
Using an
implicit conversion operator
in class
basis_ios
The value is zero (false) if the stream is in failing state
Formatting flags - class
ios_base
For white space skipping, ajustment, padding, integer base, floating point formatting, etc.
The formatting flags can be read and written together (p. 626)
Illustration of implicit stream conversion to a boolean value.
At a higher level of abstraction, the formatting flags are changed by so-called
manipulators
- see next page