Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ifstreamPointer Class Reference

A wrapped std::ifstream with possible compression handling (igzstream) that behaves much like a std::unique_ptr. More...

Inheritance diagram for ifstreamPointer:
Inheritance graph
[legend]

Public Member Functions

 ifstreamPointer () noexcept=default
 
 ifstreamPointer (const ifstreamPointer &)=delete
 
 ifstreamPointer (ifstreamPointer &&)=default
 
void operator= (const ifstreamPointer &)=delete
 
ifstreamPointeroperator= (ifstreamPointer &&)=default
 
 ~ifstreamPointer ()=default
 
 ifstreamPointer (const fileName &pathname)
 
std::istream * get () noexcept
 
const std::istream * get () const noexcept
 
IOstreamOption::compressionType whichCompression () const
 
std::istream * release () noexcept
 
void reset (std::istream *ptr) noexcept
 
std::istream & operator* ()
 
const std::istream & operator* () const
 
std::istream * operator-> () noexcept
 
const std::istream * operator-> () const noexcept
 

Static Public Member Functions

static bool supports_gz ()
 

Protected Member Functions

void reopen_gz (const std::string &pathname_gz)
 

Detailed Description

A wrapped std::ifstream with possible compression handling (igzstream) that behaves much like a std::unique_ptr.

Note
No operator bool to avoid inheritance ambiguity with std::ios::operator bool.
Source files

Definition at line 70 of file fstreamPointer.H.

Constructor & Destructor Documentation

◆ ifstreamPointer() [1/4]

ifstreamPointer ( )
defaultnoexcept

◆ ifstreamPointer() [2/4]

ifstreamPointer ( const ifstreamPointer )
delete

◆ ifstreamPointer() [3/4]

ifstreamPointer ( ifstreamPointer &&  )
default

◆ ~ifstreamPointer()

~ifstreamPointer ( )
default

◆ ifstreamPointer() [4/4]

ifstreamPointer ( const fileName pathname)
explicit

Definition at line 89 of file fstreamPointers.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, Foam::isFile(), Foam::mode(), and Foam::nl.

Here is the call graph for this function:

Member Function Documentation

◆ reopen_gz()

void reopen_gz ( const std::string &  pathname_gz)
protected

Definition at line 187 of file fstreamPointers.C.

Referenced by IFstream::rewind().

Here is the caller graph for this function:

◆ operator=() [1/2]

void operator= ( const ifstreamPointer )
delete

◆ operator=() [2/2]

ifstreamPointer& operator= ( ifstreamPointer &&  )
default

◆ supports_gz()

bool supports_gz ( )
static

Definition at line 66 of file fstreamPointers.C.

◆ get() [1/2]

std::istream* get ( )
inlinenoexcept

Definition at line 122 of file fstreamPointer.H.

Referenced by IFstream::rewind(), and IFstream::stdStream().

Here is the caller graph for this function:

◆ get() [2/2]

const std::istream* get ( ) const
inlinenoexcept

Definition at line 125 of file fstreamPointer.H.

◆ whichCompression()

Foam::IOstreamOption::compressionType whichCompression ( ) const

Definition at line 236 of file fstreamPointers.C.

Referenced by STLCore::detectBinaryHeader(), STLCore::readBinaryHeader(), and IFstream::rewind().

Here is the caller graph for this function:

◆ release()

std::istream* release ( )
inlinenoexcept

Definition at line 134 of file fstreamPointer.H.

Referenced by STLCore::readBinaryHeader().

Here is the caller graph for this function:

◆ reset()

void reset ( std::istream *  ptr)
inlinenoexcept

Definition at line 137 of file fstreamPointer.H.

◆ operator*() [1/2]

std::istream& operator* ( )
inline

Definition at line 143 of file fstreamPointer.H.

◆ operator*() [2/2]

const std::istream& operator* ( ) const
inline

Definition at line 146 of file fstreamPointer.H.

◆ operator->() [1/2]

std::istream* operator-> ( )
inlinenoexcept

Definition at line 149 of file fstreamPointer.H.

◆ operator->() [2/2]

const std::istream* operator-> ( ) const
inlinenoexcept

Definition at line 152 of file fstreamPointer.H.


The documentation for this class was generated from the following files: