40 Foam::OFstreamAllocator::OFstreamAllocator
42 const fileName& pathname,
59 if (
isFile(pathname,
false))
64 ofPtr_ =
new ogzstream((pathname +
".gz").c_str());
69 if (
isFile(pathname +
".gz",
false))
74 ofPtr_ =
new ofstream(pathname.c_str());
79 Foam::OFstreamAllocator::~OFstreamAllocator()
96 OSstream(*ofPtr_,
"OFstream.sinkFile_", format, version, compression),
107 <<
"Could not open file " << pathname
A class for handling file names.
void setClosed()
Set stream closed.
InfoProxy< IOstream > info() const
Return info proxy.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void endl()
Add newline and flush stream.
bool good() const
Return true if next operation might succeed.
bool isFile(const fileName &, const bool checkGzip=true)
Does the name exist as a FILE in the file system?
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ostream & stdStream()
Access to underlying std::ostream.
OSstream(ostream &os, const string &name, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
Set stream status.
OFstream(const fileName &pathname, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
Construct from pathname.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
void setBad()
Set stream to be bad.
virtual void print(Ostream &) const
Print description of IOstream to Ostream.
streamFormat
Enumeration for the format of data in the stream.
errorManip< error > abort(error &err)
void print(Ostream &) const
Print description of IOstream to Ostream.
compressionType
Enumeration for the format of data in the stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
defineTypeNameAndDebug(combustionModel, 0)
void setOpened()
Set stream opened.
A std::ostream with ability to handle compressed files.
void setState(ios_base::iostate state)
Set stream state.
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
#define InfoInFunction
Report an information message using Foam::Info.