|
ios::setstate
public member function
void setstate ( iostate state );
Set error state flag
Modifies the current error state value by combining (like with a bitwise OR operation) the error state flags passed as argument with those currently set for the stream.
Any error bitflag already set is not cleared. If you want to modify the state flags without keeping the current value, use clear() instead.
The effect of this function is the same as a call to:
clear ( rdstate() | state );
Parameters
- state
- An object of type ios_base::iostate that can take as value any combination of the following member constants:
flag value | indicates |
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 values are declared as static member constants in the parent class ios_base. More than one state flag can be combined using the bitwise OR operator (|).
Return Value
none
Basic template member declaration
( basic_ios<charT,traits> )
|
void setstate ( iostate state );
|
See also
ios::fail | Check if either failbit or badbit is set (public member function) |
ios::good | Check if the state of the stream is good for i/o operations. (public member function) |
ios::bad | Check if badbit is set (public member function) |
ios::eof | Check if eofbit is set (public member function) |
ios::clear | Set error state flags (public member function) |
|