39 #ifndef Foam_IFstream_H 40 #define Foam_IFstream_H 120 virtual std::istream&
stdStream()
override;
123 virtual const std::istream&
stdStream()
const override;
127 virtual void rewind()
override;
A wrapped std::ifstream with possible compression handling (igzstream) that behaves much like a std::...
IFstream(const fileName &pathname, IOstreamOption streamOpt=IOstreamOption())
Construct from pathname, default or specified stream options.
~IFstream()=default
Destructor.
A class for handling file names.
A simple container for options an IOstream can normally have.
ClassName("IFstream")
Declare type-name (with debug switch)
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
virtual void rewind() override
Rewind the stream so that it may be read again.
virtual const fileName & name() const override
The name of the input serial stream. (eg, the name of the Fstream file name)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual std::istream & stdStream() override
Access to underlying std::istream.
OBJstream os(runTime.globalPath()/outputName)
Input from file stream as an ISstream, normally using std::ifstream for the actual input...
std::streamsize fileSize() const
Return the size of the underlying file (-1 on error). This corresponds to Foam::fileSize() but with e...
Generic input stream using a standard (STL) stream.
Macro definitions for declaring ClassName(), NamespaceName(), etc.
static DynamicList< char > readContents(const fileName &pathname)
Get file contents from specified file (compressed/uncompressed). Returns an empty list if the file ca...
IFstream & operator()() const
Return a non-const reference to const IFstream.
streamFormat
Data format (ascii | binary)
virtual void print(Ostream &os) const override
Print stream description.
ISstream & get(char &c)
Raw, low-level get character function.