Input from file stream. More...
#include <OpenFOAM/IFstream.H>
Public Member Functions | |
ClassName ("IFstream") | |
IFstream (const fileName &pathname, streamFormat format=ASCII, versionNumber version=currentVersion) | |
Construct from pathname. | |
~IFstream () | |
const fileName & | name () const |
Return the name of the stream. | |
fileName & | name () |
Return non-const access to the name of the stream. | |
virtual void | print (Ostream &) const |
Print description of IOstream to Ostream. | |
IFstream & | operator() () const |
Return a non-const reference to const IFstream. | |
![]() | |
istream & | stdStream () |
Access to underlying std::istream (for e.g. lexer) | |
![]() | |
ISstream (istream &is, const string &name, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED) | |
Construct as wrapper around istream. | |
virtual | ~ISstream () |
virtual ios_base::fmtflags | flags () const |
Return flags of output stream. | |
ISstream & | get (char &) |
Raw, low-level get character function. | |
ISstream & | getLine (string &) |
Raw, low-level getline into a string function. | |
ISstream & | putback (const char &) |
Raw, low-level putback character function. | |
virtual Istream & | read (token &) |
Return next token from stream. | |
virtual Istream & | read (char &) |
Read a character. | |
virtual Istream & | read (word &) |
Read a word. | |
virtual Istream & | read (string &) |
Read a string (including enclosing double-quotes). | |
virtual Istream & | read (label &) |
Read a label. | |
virtual Istream & | read (floatScalar &) |
Read a floatScalar. | |
virtual Istream & | read (doubleScalar &) |
Read a doubleScalar. | |
virtual Istream & | read (char *, std::streamsize) |
Read binary block. | |
virtual Istream & | rewind () |
Rewind and return the stream so that it may be read again. | |
virtual ios_base::fmtflags | flags (const ios_base::fmtflags flags) |
Set flags of output stream. | |
![]() | |
Istream (streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED) | |
Set stream status. | |
virtual | ~Istream () |
void | putBack (const token &) |
Put back token. | |
bool | getBack (token &) |
Get the put back token. | |
Istream & | readBegin (const char *funcName) |
Istream & | readEnd (const char *funcName) |
Istream & | readEndBegin (const char *funcName) |
char | readBeginList (const char *funcName) |
char | readEndList (const char *funcName) |
![]() | |
IOstream (streamFormat format, versionNumber version, compressionType compression=UNCOMPRESSED) | |
Construct setting format and version. | |
virtual | ~IOstream () |
virtual bool | check (const char *operation) const |
Check IOstream status for given operation. | |
void | fatalCheck (const char *operation) const |
Check IOstream status for given operation. | |
bool | opened () const |
Return true if stream has been opened. | |
bool | closed () const |
Return true if stream is closed. | |
bool | good () const |
Return true if next operation might succeed. | |
bool | eof () const |
Return true if end of input seen. | |
bool | fail () const |
Return true if next operation will fail. | |
bool | bad () const |
Return true if stream is corrupted. | |
operator void * () const | |
Return non-zero if the stream has not failed. | |
bool | operator! () const |
Return true if the stream has failed. | |
streamFormat | format () const |
Return current stream format. | |
streamFormat | format (const streamFormat fmt) |
Set the stream format. | |
streamFormat | format (const word &fmt) |
Set the stream format from word. | |
versionNumber | version () const |
Return the stream version. | |
versionNumber | version (const versionNumber ver) |
Set the stream version. | |
compressionType | compression () const |
Return the stream compression. | |
compressionType | compression (const compressionType cmp) |
Set the stream compression. | |
compressionType | compression (const word &cmp) |
Set the stream compression from word. | |
label | lineNumber () const |
Return current stream line number. | |
label & | lineNumber () |
Return current stream line number. | |
label | lineNumber (const label ln) |
Set the stream line number. | |
void | setEof () |
Set stream to have reached eof. | |
void | setFail () |
Set stream to have failed. | |
void | setBad () |
Set stream to be bad. | |
virtual ios::fmtflags | flags (const ios::fmtflags f)=0 |
Set flags of stream. | |
ios::fmtflags | setf (const ios::fmtflags f) |
Set flags of stream. | |
ios::fmtflags | setf (const ios::fmtflags f, const ios::fmtflags mask) |
Set flags of given field of stream. | |
void | unsetf (const ios::fmtflags uf) |
Unset flags of stream. | |
void | print (Ostream &, const int streamState) const |
Check given stream state bits. | |
InfoProxy< IOstream > | info () const |
Return info proxy. |
Additional Inherited Members | |
![]() | |
istream & | stream () |
Return the stream reference. | |
const istream & | stream () const |
Return the const stream reference. |
IFstream | ( | const fileName & | pathname, |
streamFormat | format = ASCII , |
||
versionNumber | version = currentVersion |
||
) |
Construct from pathname.
Definition at line 94 of file IFstream.C.
References Foam::endl(), and Foam::Info.
~IFstream | ( | ) |
Definition at line 139 of file IFstream.C.
ClassName | ( | "IFstream" | ) |
|
inlinevirtual |
Return the name of the stream.
Reimplemented from ISstream.
Definition at line 127 of file IFstream.H.
Referenced by argList::argList(), includeEntry::execute(), NASsurfaceFormat< Face >::read(), STARCDsurfaceFormat< Face >::read(), STARCDsurfaceFormatCore::readHeader(), STARCD::readHeader(), and STARCDsurfaceFormatCore::readPoints().
|
inlinevirtual |
Return non-const access to the name of the stream.
Reimplemented from ISstream.
Definition at line 133 of file IFstream.H.
|
virtual |
Print description of IOstream to Ostream.
Reimplemented from ISstream.
Definition at line 145 of file IFstream.C.
References ISstream::print().
Foam::IFstream & operator() | ( | ) | const |
Return a non-const reference to const IFstream.
Needed for read-constructors where the stream argument is temporary: e.g. thing thisThing(IFstream("thingFileName")());
Reimplemented from Istream.
Definition at line 155 of file IFstream.C.
References Foam::exit(), IOerror::exit(), Foam::FatalIOError, FatalIOErrorIn, and Foam::isFile().