73 <<
"Cannot open empty file name" 85 <<
"Could not open file " << pathname
98 if (!ptr || this->
name().empty())
100 return std::streamsize(-1);
126 return std::streamsize(fileLen);
129 return std::streamsize(-1);
140 <<
"No stream allocated\n" 155 <<
"No stream allocated\n" 200 <<
"file " << this->
name() <<
" does not exist" 205 return const_cast<IFstream&
>(*this);
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
label lineNumber_
The file line.
A wrapped std::ifstream with possible compression handling (igzstream) that behaves much like a std::...
bool opened() const noexcept
True if stream has been opened.
IFstream(const fileName &pathname, IOstreamOption streamOpt=IOstreamOption())
Construct from pathname, default or specified stream options.
A class for handling file names.
virtual void rewind() override
Rewind the stream so that it may be read again.
off_t fileSize(const fileName &name, const bool followLink=true)
Return size of file or -1 on failure (normally follows symbolic links).
void setClosed() noexcept
Set stream closed.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void setState(std::ios_base::iostate state) noexcept
Set stream state.
IOstreamOption::compressionType whichCompression() const
Which compression type?
Ostream & endl(Ostream &os)
Add newline and flush stream.
InfoProxy< IOstream > info() const noexcept
Return info proxy, used to print IOstream information to a stream.
void reopen_gz(const std::string &pathname)
Special 'rewind' method for compressed stream.
A simple container for options an IOstream can normally have.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
void setBad()
Set stream state to be 'bad'.
virtual void rewind() override
Rewind the stream so that it may be read again.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
std::istream * get() noexcept
The stream pointer (ifstream or igzstream)
virtual const fileName & name() const override
The name of the input serial stream. (eg, the name of the Fstream file name)
errorManip< error > abort(error &err)
virtual std::istream & stdStream() override
Access to underlying std::istream.
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
compressionType compression() const noexcept
Get the stream compression.
Input from file stream, using an ISstream.
static void check(const int retVal, const char *what)
std::streamsize fileSize() const
Return the size of the underlying file (-1 on error). This corresponds to Foam::fileSize() but with e...
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
Generic input stream using a standard (STL) stream.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
bool good() const noexcept
True if next operation might succeed.
IFstream & operator()() const
Return a non-const reference to const IFstream.
void setOpened() noexcept
Set stream opened.
virtual void print(Ostream &os) const override
Print stream description.
virtual void print(Ostream &os) const override
Print stream description to Ostream.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
#define InfoInFunction
Report an information message using Foam::Info.