28 #include <OpenFOAM/gzstream.h>
37 Foam::IFstreamAllocator::IFstreamAllocator(
const fileName& pathname)
40 compression_(IOstream::UNCOMPRESSED)
46 Info<<
"IFstreamAllocator::IFstreamAllocator(const fileName&) : "
47 "cannot open null file " <<
endl;
51 ifPtr_ =
new ifstream(pathname.c_str());
54 if (!ifPtr_->good() &&
isFile(pathname +
".gz",
false))
58 Info<<
"IFstreamAllocator::IFstreamAllocator(const fileName&) : "
59 "decompressing " << pathname +
".gz" <<
endl;
64 ifPtr_ =
new igzstream((pathname +
".gz").c_str());
74 Foam::IFstreamAllocator::~IFstreamAllocator()
104 "IFstream.sourceFile_",
107 IFstreamAllocator::compression_
113 setState(ifPtr_->rdstate());
119 Info<<
"IFstream::IFstream(const fileName&,"
120 "streamFormat=ASCII,"
121 "versionNumber=currentVersion) : "
122 "could not open file for input"
160 if (
isFile(pathname_,
true))
162 check(
"IFstream::operator()");
168 <<
"file " << pathname_ <<
" does not exist"
173 return const_cast<IFstream&
>(*this);