56 #ifndef Foam_fstreamPointer_H 57 #define Foam_fstreamPointer_H 78 std::unique_ptr<std::istream> ptr_;
86 void reopen_gz(
const std::string& pathname);
129 std::istream*
get()
noexcept {
return ptr_.get(); }
132 const std::istream*
get()
const noexcept {
return ptr_.get(); }
150 std::istream&
operator*() {
return *ptr_; }
153 const std::istream&
operator*()
const {
return *ptr_; }
172 std::unique_ptr<std::ostream> ptr_;
183 void reopen(
const std::string& pathname);
186 void close(
const std::string& pathname);
228 const
bool append = false,
229 const
bool atomic = false
245 const std::ostream*
get()
const noexcept {
return ptr_.get(); }
263 std::ostream&
operator*() {
return *ptr_; }
266 const std::ostream&
operator*()
const {
return *ptr_; }
A wrapped std::ifstream with possible compression handling (igzstream) that behaves much like a std::...
std::istream * operator->() noexcept
Pointer dereference.
A wrapped std::ofstream with possible compression handling (ogzstream) that behaves much like a std::...
A class for handling file names.
std::ostream * get() noexcept
The stream pointer (ofstream or ogzstream)
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
IOstreamOption::compressionType whichCompression() const
Which compression type?
static bool supports_gz()
True if compiled with libz support.
ofstreamPointer() noexcept
Default construct (empty)
static bool supports_gz()
True if compiled with libz support.
void reopen_gz(const std::string &pathname)
Special 'rewind' method for compressed stream.
A simple container for options an IOstream can normally have.
std::ostream * operator->() noexcept
Pointer dereference.
void reset(std::istream *ptr) noexcept
Replace the managed pointer.
std::istream * release() noexcept
Return managed pointer and release ownership.
std::ostream & operator*()
Reference to the stream (no nullptr checking)
~ifstreamPointer()=default
Destructor.
std::ostream * release() noexcept
Return managed pointer and release ownership.
void reopen(const std::string &pathname)
Reopen for compressed/non-compressed.
void operator=(const ofstreamPointer &)=delete
No copy assignment.
ifstreamPointer() noexcept=default
Default construct (empty)
void close(const std::string &pathname)
Close stream and rename file.
std::istream & operator*()
Reference to the stream (no nullptr checking)
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
void operator=(const ifstreamPointer &)=delete
No copy assignment.
IOstreamOption::compressionType whichCompression() const
Which compression type?
~ofstreamPointer()=default
Destructor.
void reset(std::ostream *ptr) noexcept
Replace the managed pointer.