60#ifndef Foam_OFstream_H
61#define Foam_OFstream_H
158 virtual const std::ostream&
stdStream()
const override;
161 virtual std::ostream&
stdStream()
override;
190 #ifdef Foam_IOstream_extras
213extern OFstream
Snull;
Representation of a major/minor version number.
A simple container for options an IOstream can normally have.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression.
streamFormat
Data format (ascii | binary | coherent).
atomicType
Atomic operations (output).
@ NON_ATOMIC
atomic = false
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED).
@ UNCOMPRESSED
compression = false
appendType
File appending (NO_APPEND | APPEND_APP | APPEND_ATE).
@ NO_APPEND
no append (truncates existing)
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
bool is_appending() const noexcept
True if opened in append mode and file already existed.
void print(Ostream &os) const override
Print stream description.
OFstream(std::nullptr_t)
Construct a null output file stream that behaves like /dev/null.
ClassName("OFstream")
Declare type-name (with debug switch).
OFstream(const fileName &pathname, IOstreamOption streamOpt=IOstreamOption(), IOstreamOption::appendType append=IOstreamOption::NO_APPEND)
Construct from pathname and other specifications.
~OFstream()
Destructor. Possibly invokes an atomic rename (preference defined during construction).
OFstream(IOstreamOption::atomicType atomic, const fileName &pathname, IOstreamOption::streamFormat fmt, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED, IOstreamOption::appendType append=IOstreamOption::NO_APPEND)
Construct with specified atomic behaviour from pathname, format (uncompressed), optional append (see ...
virtual const std::ostream & stdStream() const override
Const access to underlying std::ostream.
virtual void rewind()
Rewind the stream so that it may be written again. Reopens the file (truncation).
OFstream(const fileName &pathname, IOstreamOption::streamFormat fmt, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED, IOstreamOption::appendType append=IOstreamOption::NO_APPEND)
Construct from pathname, format (uncompressed), optional append (see note), atomic behaviour as per s...
bool is_atomic() const noexcept
True if file creation behaves as atomic.
virtual const fileName & name() const override
Get the name of the output serial stream. (eg, the name of the Fstream file name).
OSstream(const OSstream &)=default
Copy construct.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream(const Ostream &)=default
Copy construct.
A class for handling file names.
A wrapped std::ofstream with possible compression handling (ogzstream) that behaves much like a std::...
bool is_appending() const noexcept
True if opened in append mode and file already existed.
bool is_atomic() const noexcept
True if file creation behaves as atomic.
Macro definitions for declaring ClassName(), NamespaceName(), etc.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
OBJstream os(runTime.globalPath()/outputName)
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
OFstream Snull
Global predefined null output stream "/dev/null".
#define FOAM_DEPRECATED_FOR(since, replacement)