40 Foam::OFstreamAllocator::OFstreamAllocator
42 const fileName& filePath,
56 ofstream::openmode
mode(ofstream::out);
59 mode |= ofstream::app;
70 fileName gzfilePath(filePath +
".gz");
79 ofPtr_ =
new ogzstream(gzfilePath.c_str(),
mode);
84 fileName gzfilePath(filePath +
".gz");
101 ofPtr_ =
new ofstream(filePath.c_str(),
mode);
106 Foam::OFstreamAllocator::~OFstreamAllocator()
124 OSstream(*ofPtr_,
"OFstream.sinkFile_", format, version, compression),
135 <<
"Could not open file " << filePath
mode_t mode(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file mode.
A class for handling file names.
void setClosed()
Set stream closed.
OFstream(const fileName &filePath, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED, const bool append=false)
Construct from filePath.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void endl()
Add newline and flush stream.
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.
bool good() const
Return true if next operation might succeed.
void print(Ostream &) const
Print description of IOstream to Ostream.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
void setBad()
Set stream to be bad.
streamFormat
Enumeration for the format of data in the stream.
fileType
Enumeration of file types.
errorManip< error > abort(error &err)
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.
virtual void print(Ostream &) const
Print description of IOstream to Ostream.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
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.
InfoProxy< IOstream > info() const
Return info proxy.
#define InfoInFunction
Report an information message using Foam::Info.