40 Foam::OFstreamAllocator::OFstreamAllocator
42 const fileName& filePath,
43 IOstream::compressionType compression,
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
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
streamFormat
Enumeration for the format of data in the stream.
void setBad()
Set stream to be bad.
void setState(ios_base::iostate state)
Set stream state.
void setClosed()
Set stream closed.
compressionType
Enumeration for the format of data in the stream.
void setOpened()
Set stream opened.
bool good() const
Return true if next operation might succeed.
InfoProxy< IOstream > info() const
Return info proxy.
A std::ostream with ability to handle compressed files.
virtual ostream & stdStream()
Access to underlying std::ostream.
void print(Ostream &) const
Print description of IOstream to Ostream.
virtual void print(Ostream &) const
Print description of IOstream to Ostream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A class for handling file names.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define InfoInFunction
Report an information message using Foam::Info.
mode_t mode(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file mode.
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
defineTypeNameAndDebug(combustionModel, 0)
fileType
Enumeration of file types.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
word format(conversionProperties.lookup("format"))