Go to the documentation of this file.
50 allocatedPtr_(
nullptr)
60 std::ios_base::openmode
mode(std::ios_base::out|std::ios_base::binary);
63 mode |= std::ios_base::app;
66 if (comp == IOstream::COMPRESSED)
69 fileName gzPathName(pathname +
".gz");
72 if (pathType == fileName::FILE || pathType == fileName::LINK)
84 allocatedPtr_.reset(
new ogzstream(gzPathName.c_str(),
mode));
89 fileName gzPathName(pathname +
".gz");
92 if (gzType == fileName::FILE || gzType == fileName::LINK)
104 allocatedPtr_.reset(
new std::ofstream(pathname,
mode));
119 OSstream(*allocatedPtr_, pathname, streamOpt)
122 setState(allocatedPtr_->rdstate());
129 <<
"Could not open file " << pathname
164 return *allocatedPtr_;
int debug
Static debugging option.
#define InfoInFunction
Report an information message using Foam::Info.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A class for handling file names.
A std::ostream with the ability to handle compressed files.
OFstream(const fileName &pathname, IOstreamOption streamOpt=IOstreamOption(), const bool append=false)
Construct from pathname.
Type
Enumerations to handle directory entry types.
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.
Ostream & endl(Ostream &os)
Add newline and flush stream.
mode_t mode(const fileName &name, const bool followLink=true)
Return the file mode, normally following symbolic links.
OFstreamAllocator(const fileName &pathname, IOstream::compressionType comp=IOstream::UNCOMPRESSED, const bool append=false)
Construct from pathname.
void print(Ostream &os) const
Print stream description to Ostream.
The IOstreamOption is a simple container for options an IOstream can normally have.
Generic output stream using a standard (STL) stream.
errorManip< error > abort(error &err)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual std::ostream & stdStream()
Access to underlying std::ostream.
std::unique_ptr< std::ostream > allocatedPtr_
The allocated stream pointer (ofstream or ogzstream).
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual void print(Ostream &os) const
Print stream description to Ostream.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
compressionType compression() const noexcept
Get the stream compression.
defineTypeNameAndDebug(combustionModel, 0)