Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
IOstream Library
manipulators
classes:
filebuf
fstream
ifstream
ios
iostream
ios_base
istream
istringstream
ofstream
ostream
ostringstream
streambuf
stringbuf
stringstream
objects:
cerr
cin
clog
cout
types:
fpos
streamoff
streampos
streamsize
ios
ios::ios
ios::~ios
member functions:
ios::bad
ios::clear
ios::copyfmt
ios::eof
ios::exceptions
ios::fail
ios::fill
ios::good
ios::imbue
ios::init
ios::narrow
ios::operator!
ios::operator void*
ios::rdbuf
ios::rdstate
ios::setstate
ios::tie
ios::widen


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 valueindicates
eofbitEnd-Of-File reached while performing an extracting operation on an input stream.
failbitThe last input operation failed because of an error related to the internal logic of the operation itself.
badbitError due to the failure of an input/output operation on the stream buffer.
goodbitNo 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