Go to the documentation of this file.
49 allocatedPtr_(
nullptr)
59 std::ios_base::openmode
mode(std::ios_base::out|std::ios_base::binary);
62 mode |= std::ios_base::app;
65 if (compression == IOstream::COMPRESSED)
69 if (pathType == fileName::FILE || pathType == fileName::LINK)
73 fileName gzPathName(pathname +
".gz");
82 allocatedPtr_ =
new ogzstream(gzPathName.c_str(),
mode);
87 fileName gzPathName(pathname +
".gz");
89 if (gzType == fileName::FILE || gzType == fileName::LINK)
100 allocatedPtr_ =
new std::ofstream(pathname,
mode);
115 delete allocatedPtr_;
116 allocatedPtr_ =
nullptr;
143 setState(allocatedPtr_->rdstate());
150 <<
"Could not open file " << pathname
174 return *allocatedPtr_;
185 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.
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.
void print(Ostream &os) const
Print description of IOstream to Ostream.
word format(conversionProperties.get< word >("format"))
~OFstreamAllocator()
Destructor.
Representation of a major/minor version number.
OFstream(const fileName &pathname, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED, const bool append=false)
Construct from pathname.
streamFormat
Data format (ascii | binary)
void deallocate()
Delete the stream pointer.
errorManip< error > abort(error &err)
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
OFstreamAllocator(const fileName &pathname, IOstream::compressionType compression=IOstream::UNCOMPRESSED, const bool append=false)
Construct from pathname.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual std::ostream & stdStream()
Access to underlying std::ostream.
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 description of IOstream 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,...
defineTypeNameAndDebug(combustionModel, 0)