Go to the documentation of this file.
56 #ifndef fstreamPointer_H
57 #define fstreamPointer_H
78 std::unique_ptr<std::istream> ptr_;
85 void reopen_gz(
const std::string& pathname_gz);
125 std::istream*
get() noexcept {
return ptr_.get(); }
128 const std::istream*
get() const noexcept {
return ptr_.get(); }
137 std::istream*
release() noexcept {
return ptr_.release(); }
140 void reset(std::istream* ptr) noexcept { ptr_.reset(ptr); }
146 std::istream&
operator*() {
return *ptr_; }
149 const std::istream&
operator*()
const {
return *ptr_; }
152 std::istream*
operator->() noexcept {
return ptr_.get(); }
155 const std::istream*
operator->() const noexcept {
return ptr_.get(); }
168 std::unique_ptr<std::ostream> ptr_;
175 void reopen_gz(
const std::string& pathname_gz);
178 void reopen(
const std::string& pathname);
233 std::ostream*
get() noexcept {
return ptr_.get(); }
236 const std::ostream*
get() const noexcept {
return ptr_.get(); }
245 std::ostream*
release() noexcept {
return ptr_.release(); }
248 void reset(std::ostream* ptr) noexcept { ptr_.reset(ptr); }
254 std::ostream&
operator*() {
return *ptr_; }
257 const std::ostream&
operator*()
const {
return *ptr_; }
260 std::ostream*
operator->() noexcept {
return ptr_.get(); }
263 const std::ostream*
operator->() const noexcept {
return ptr_.get(); }
static bool supports_gz()
True if compiled with libz support.
std::ostream * operator->() noexcept
Pointer dereference.
static bool supports_gz()
True if compiled with libz support.
const std::ostream * get() const noexcept
The stream pointer (ofstream or ogzstream)
A class for handling file names.
std::ostream & operator*()
Reference to the stream (no nullptr checking)
~ofstreamPointer()=default
Destructor.
const std::istream & operator*() const
Const-reference to the stream (no nullptr checking)
void reset(std::ostream *ptr) noexcept
Replace the managed pointer.
void reset(std::istream *ptr) noexcept
Replace the managed pointer.
const std::istream * get() const noexcept
The stream pointer (ifstream or igzstream)
std::istream * release() noexcept
Return managed pointer and release ownership.
const std::ostream * operator->() const noexcept
Pointer dereference.
~ifstreamPointer()=default
Destructor.
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
IOstreamOption::compressionType whichCompression() const
Which compression type?
std::ostream * get() noexcept
The stream pointer (ofstream or ogzstream)
void reopen_gz(const std::string &pathname_gz)
Special 'rewind' method for compressed stream.
std::istream & operator*()
Reference to the stream (no nullptr checking)
void reopen(const std::string &pathname)
General 'rewind' method (non-compressed)
The IOstreamOption is a simple container for options an IOstream can normally have.
void reopen_gz(const std::string &pathname_gz)
Special 'rewind' method for compressed stream.
std::istream * get() noexcept
The stream pointer (ifstream or igzstream)
ofstreamPointer() noexcept=default
Default construct (empty)
std::ostream * release() noexcept
Return managed pointer and release ownership.
ofstreamPointer(const fileName &pathname, const bool append)
Construct from pathname, with specified append option.
A wrapped std::ifstream with possible compression handling (igzstream) that behaves much like a std::...
std::istream * operator->() noexcept
Pointer dereference.
ifstreamPointer() noexcept=default
Default construct (empty)
A wrapped std::ofstream with possible compression handling (ogzstream) that behaves much like a std::...
const std::ostream & operator*() const
Const-reference to the stream (no nullptr checking)
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
void operator=(const ofstreamPointer &)=delete
No copy assignment.
const std::istream * operator->() const noexcept
Pointer dereference.
void operator=(const ifstreamPointer &)=delete
No copy assignment.
IOstreamOption::compressionType whichCompression() const
Which compression type?