Public Types | |
enum | streamAccess : char { CLOSED = 0, OPENED } |
enum | writeFormat : char { ASCII = 0, BINARY } |
Public Member Functions | |
IOstream () | |
Default. More... | |
IOstream (writeFormat wF) | |
Construct and set write format. More... | |
IOstream (const IOstream &)=default | |
Copy. More... | |
virtual | ~IOstream ()=default |
Destructor. More... | |
virtual const word & | name () const |
Return the name of the stream. More... | |
virtual word & | name () |
Return non-const access to the name of the stream. More... | |
virtual bool | check (const char *operation) const |
Check IOstream status for given operation. More... | |
bool | fatalCheck (const char *operation) const |
Check IOstream status for given operation. More... | |
bool | opened () const |
Return true if stream has been opened. More... | |
bool | closed () const |
Return true if stream is closed. More... | |
bool | isBinary () const |
Return true if stream format is binray. More... | |
bool | good () const |
Return true if next operation might succeed. More... | |
bool | eof () const |
Return true if end of input seen. More... | |
bool | fail () const |
Return true if next operation will fail. More... | |
bool | bad () const |
Return true if stream is corrupted. More... | |
operator bool () const | |
Return true if the stream has not failed. More... | |
bool | operator! () const |
Return true if the stream has failed. More... | |
int32 | lineNumber () const |
Const access to the current stream line number. More... | |
int32 & | lineNumber () |
Non-const access to the current stream line number. More... | |
int32 | lineNumber (const int32 num) |
Set the stream line number return the previous value. More... | |
virtual ios_base::fmtflags | flags () const =0 |
Return flags of stream. More... | |
void | setEof () |
Set stream to have reached eof. More... | |
void | setFail () |
Set stream to have failed. More... | |
void | setBad () |
Set stream to be bad. More... | |
virtual ios_base::fmtflags | flags (const ios_base::fmtflags f)=0 |
Set flags of stream. More... | |
ios_base::fmtflags | setf (const ios_base::fmtflags f) |
Set flags of stream. More... | |
ios_base::fmtflags | setf (const ios_base::fmtflags f, const ios_base::fmtflags mask) |
Set flags of given field of stream. More... | |
void | unsetf (const ios_base::fmtflags f) |
Unset flags of stream. More... | |
Static Public Member Functions | |
static unsigned int | defaultPrecision () |
Return the default precision. More... | |
static unsigned int | defaultPrecision (unsigned int prec) |
Reset the default precision return the previous value. More... | |
Static Public Attributes | |
static unsigned int | precision_ = 6 |
Default precision, only works for ASCII. More... | |
Protected Member Functions | |
void | setOpened () |
Set stream opened. More... | |
void | setClosed () |
Set stream closed. More... | |
void | setState (ios_base::iostate state) |
Set stream state. More... | |
void | setWriteFormat (writeFormat wF) |
void | setGood () |
Set stream to be good. More... | |
Protected Attributes | |
streamAccess | openClosed_ |
Is stream open or closed. More... | |
writeFormat | writeFormat_ = ASCII |
write format More... | |
ios_base::iostate | ioState_ |
state More... | |
int32 | lineNumber_ |
The file line. More... | |
Static Protected Attributes | |
static word | staticName_ |
Name for any generic stream - normally treat as readonly. More... | |
Definition at line 45 of file IOstream.hpp.
enum streamAccess : char |
Enumerator | |
---|---|
CLOSED | |
OPENED | stream is not open stream is open |
Definition at line 51 of file IOstream.hpp.
enum writeFormat : char |
Enumerator | |
---|---|
ASCII | |
BINARY |
Definition at line 57 of file IOstream.hpp.
|
inlineexplicit |
Default.
Definition at line 121 of file IOstream.hpp.
References IOstream::setBad().
|
inlineexplicit |
Construct and set write format.
Definition at line 131 of file IOstream.hpp.
References IOstream::setBad().
|
virtualdefault |
Destructor.
|
inlineprotected |
Set stream opened.
Definition at line 88 of file IOstream.hpp.
References IOstream::openClosed_, and IOstream::OPENED.
|
inlineprotected |
Set stream closed.
Definition at line 94 of file IOstream.hpp.
References IOstream::CLOSED, and IOstream::openClosed_.
|
inlineprotected |
|
inlineprotected |
Definition at line 105 of file IOstream.hpp.
References IOstream::writeFormat_.
|
inlineprotected |
|
virtual |
Return the name of the stream.
Reimplemented in iTstream, Istream, and Ostream.
Definition at line 31 of file IOstream.cpp.
References IOstream::staticName_.
Referenced by box::box(), iEntry< Key, T * >::createEntry(), cylinder::cylinder(), dataEntry::dataEntry(), dictionary::dictionary(), iBox< intType >::iBox(), pFlow::operator<<(), pFlow::operator>>(), iIstream::putBack(), Insertion< ShapeType >::read(), timeInterval::read(), Logical::read(), line::read(), rotatingAxis::read(), dataEntry::read(), sphereShape::read(), fixedWall::read(), rotatingAxisMotion::read(), vibratingMotion::read(), multiRotatingAxisMotion::read(), dictionary::read(), dataEntry::readDataEntry(), dictionary::readDictionary(), Field< VectorDual, int8 >::readField(), IOfileHeader::readHeader(), List< word >::readList(), Field< VectorDual, int8 >::readNonUniform(), pointStructure::readPointStructure(), triSurface::readTriSurface(), Field< VectorDual, int8 >::readUniform(), sphere::sphere(), Insertion< ShapeType >::write(), dataEntry::write(), sphereShape::write(), fixedWall::write(), rotatingAxisMotion::write(), vibratingMotion::write(), multiRotatingAxisMotion::write(), dictionary::write(), and pointStructure::writePointStructure().
|
virtual |
|
virtual |
Check IOstream status for given operation.
Print IOstream state or generate a FatalIOError when an error has occurred. The base implementation is a fatalCheck
Definition at line 42 of file IOstream.cpp.
Referenced by pFlow::operator<<(), pFlow::operator>>(), line::read(), rotatingAxis::read(), timeInterval::write(), iBox< intType >::write(), Logical::write(), box::write(), sphere::write(), line::write(), rotatingAxis::write(), vibrating::write(), cylinder::write(), List< word >::writeList(), multiTriSurface::writeMultiTriSurface(), triSurface::writeTriSurface(), and Vector< word, vecAllocator< word > >::writeVector().
bool fatalCheck | ( | const char * | operation | ) | const |
Check IOstream status for given operation.
Generate a FatalIOError when an error has occurred.
Definition at line 48 of file IOstream.cpp.
References fatalErrorInFunction, and fatalExit.
Referenced by iEntry< Key, T * >::createEntry(), dataEntry::readDataEntry(), List< word >::readList(), triSurface::readTriSurface(), Vector< word, vecAllocator< word > >::readVector(), IOfileHeader::writeHeader(), and iEntry< Key, T * >::writeKeyword().
|
inline |
Return true if stream has been opened.
Definition at line 166 of file IOstream.hpp.
References IOstream::openClosed_, and IOstream::OPENED.
|
inline |
Return true if stream is closed.
Definition at line 172 of file IOstream.hpp.
References IOstream::CLOSED, and IOstream::openClosed_.
|
inline |
Return true if stream format is binray.
Definition at line 178 of file IOstream.hpp.
References IOstream::BINARY, and IOstream::writeFormat_.
Referenced by triSurface::readTriSurface(), Vector< word, vecAllocator< word > >::readVector(), and Vector< word, vecAllocator< word > >::writeVector().
|
inline |
Return true if next operation might succeed.
Definition at line 184 of file IOstream.hpp.
References IOstream::ioState_.
Referenced by Istream::nextValid(), and dictionary::readDictionary().
|
inline |
Return true if end of input seen.
Definition at line 190 of file IOstream.hpp.
References IOstream::ioState_.
Referenced by pFlow::checkNumberToken(), pFlow::checkWordToken(), iEntry< Key, T * >::createEntry(), stlFile::read(), dictionary::readDictionary(), Field< VectorDual, int8 >::readField(), iEntry< Key, T * >::readKeyword(), Field< VectorDual, int8 >::readNonUniform(), Field< VectorDual, int8 >::readUniform(), and twoPartEntry::twoPartEntry().
|
inline |
Return true if next operation will fail.
Definition at line 196 of file IOstream.hpp.
References IOstream::ioState_.
Referenced by IOstream::operator bool(), and IOstream::operator!().
|
inline |
Return true if stream is corrupted.
Definition at line 202 of file IOstream.hpp.
References IOstream::ioState_.
Referenced by pFlow::badInput(), iEntry< Key, T * >::createEntry(), Istream::nextValid(), iIstream::putBack(), dataEntry::readDataEntry(), Field< VectorDual, int8 >::readField(), iEntry< Key, T * >::readKeyword(), Field< VectorDual, int8 >::readNonUniform(), and Field< VectorDual, int8 >::readUniform().
|
inlineexplicit |
Return true if the stream has not failed.
Definition at line 208 of file IOstream.hpp.
References IOstream::fail().
|
inline |
Return true if the stream has failed.
Definition at line 214 of file IOstream.hpp.
References IOstream::fail().
|
inline |
Const access to the current stream line number.
Definition at line 221 of file IOstream.hpp.
References IOstream::lineNumber_.
Referenced by box::box(), iEntry< Key, T * >::createEntry(), cylinder::cylinder(), dataEntry::dataEntry(), dictionary::dictionary(), iBox< intType >::iBox(), pFlow::operator<<(), pFlow::operator>>(), property::property(), iIstream::putBack(), Insertion< ShapeType >::read(), timeInterval::read(), stlFile::read(), Logical::read(), line::read(), rotatingAxis::read(), dataEntry::read(), sphereShape::read(), fixedWall::read(), rotatingAxisMotion::read(), vibratingMotion::read(), multiRotatingAxisMotion::read(), dictionary::read(), dataEntry::readDataEntry(), dictionary::readDictionary(), Field< VectorDual, int8 >::readField(), List< word >::readList(), Field< VectorDual, int8 >::readNonUniform(), pointStructure::readPointStructure(), triSurface::readTriSurface(), Field< VectorDual, int8 >::readUniform(), sphere::sphere(), Insertion< ShapeType >::write(), dataEntry::write(), sphereShape::write(), fixedWall::write(), rotatingAxisMotion::write(), vibratingMotion::write(), multiRotatingAxisMotion::write(), dictionary::write(), and pointStructure::writePointStructure().
|
inline |
Non-const access to the current stream line number.
Definition at line 227 of file IOstream.hpp.
References IOstream::lineNumber_.
Set the stream line number return the previous value.
Definition at line 234 of file IOstream.hpp.
References IOstream::lineNumber_.
|
pure virtual |
Return flags of stream.
Implemented in oTstream, iTstream, Istream, and Ostream.
Referenced by IOstream::setf(), and IOstream::unsetf().
|
inlinestatic |
Return the default precision.
Definition at line 245 of file IOstream.hpp.
References IOstream::precision_.
|
inlinestatic |
Reset the default precision return the previous value.
Definition at line 252 of file IOstream.hpp.
References IOstream::precision_.
|
inline |
Set stream to have reached eof.
Definition at line 260 of file IOstream.hpp.
References IOstream::ioState_.
|
inline |
Set stream to have failed.
Definition at line 266 of file IOstream.hpp.
References IOstream::ioState_.
|
inline |
Set stream to be bad.
Definition at line 272 of file IOstream.hpp.
References IOstream::ioState_.
Referenced by IOstream::IOstream(), pFlow::operator>>(), and Logical::read().
|
pure virtual |
|
inline |
Set flags of stream.
Definition at line 281 of file IOstream.hpp.
References IOstream::flags().
Referenced by pFlow::dec(), pFlow::fixed(), pFlow::hex(), pFlow::oct(), and pFlow::scientific().
|
inline |
Set flags of given field of stream.
Definition at line 288 of file IOstream.hpp.
References IOstream::flags().
|
inline |
Unset flags of stream.
Definition at line 297 of file IOstream.hpp.
References IOstream::flags().
|
static |
Default precision, only works for ASCII.
Definition at line 64 of file IOstream.hpp.
Referenced by IOstream::defaultPrecision().
|
staticprotected |
Name for any generic stream - normally treat as readonly.
Definition at line 69 of file IOstream.hpp.
Referenced by IOstream::name().
|
protected |
Is stream open or closed.
Definition at line 72 of file IOstream.hpp.
Referenced by IOstream::closed(), IOstream::opened(), IOstream::setClosed(), and IOstream::setOpened().
|
protected |
write format
Definition at line 75 of file IOstream.hpp.
Referenced by IOstream::isBinary(), and IOstream::setWriteFormat().
|
protected |
state
Definition at line 78 of file IOstream.hpp.
Referenced by IOstream::bad(), IOstream::eof(), IOstream::fail(), IOstream::good(), IOstream::setBad(), IOstream::setEof(), IOstream::setFail(), IOstream::setGood(), and IOstream::setState().
|
protected |