public member type
Type for stream state flags
Bitmask type to represent stream error state flags.
All stream objects keep information on the state of the object internally. This information can be retrieved as an element of this type by calling member function basic_ios::rdstate or set by calling basic_ios::setstate.
The values passed and retrieved by these functions can be any valid combination (using the boolean
OR operator, "
|") of the following member constants:
|eofbit||End-Of-File reached while performing an extracting operation on an input stream.|
|failbit||The last input operation failed because of an error related to the internal logic of the operation itself.|
|badbit||Error due to the failure of an input/output operation on the stream buffer.|
|goodbit||No error. Represents the absence of all the above (the value zero).|
These constants are defined in the ios_base class as public members. Therefore, they can be referred to either directly by their name as ios_base members (like ios_base::badbit) or by using any of their inherited classes or instantiated objects, like for example
- Get error state flags (public member function
- Set error state flag (public member function
- Check whether state of stream is good (public member function
- Check whether badbit is set (public member function
- Check whether either failbit or badbit is set (public member function
- Check whether eofbit is set (public member function