Go to the documentation of this file.
45 allocatedPtr_(nullptr),
56 const std::ios_base::openmode
mode(std::ios_base::in|std::ios_base::binary);
94 allocatedPtr_ =
nullptr;
120 setState(allocatedPtr_->rdstate());
127 <<
"Could not open file " << pathname
149 <<
"No stream allocated"
152 return *allocatedPtr_;
161 <<
"No stream allocated"
164 return *allocatedPtr_;
172 igzstream* gzPtr =
nullptr;
176 gzPtr =
dynamic_cast<igzstream*
>(allocatedPtr_);
178 catch (
const std::bad_cast&)
188 gzPtr->open((this->
name() +
".gz").c_str());
190 setState(gzPtr->rdstate());
221 <<
"file " << this->
name() <<
" does not exist"
226 return const_cast<IFstream&
>(*this);
int debug
Static debugging option.
virtual void print(Ostream &os) const
Print description of IOstream to Ostream.
#define InfoInFunction
Report an information message using Foam::Info.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A class for handling file names.
Input from file stream, using an ISstream.
~IFstreamAllocator()
Destructor.
virtual void print(Ostream &os) const
Print description of IOstream to Ostream.
An IOstream is an abstract base class for all input/output systems; be they streams,...
Generic input stream using standard (STL) streams.
IFstream & operator()() const
Return a non-const reference to const IFstream.
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void rewind()
Rewind the stream so that it may be read again.
mode_t mode(const fileName &name, const bool followLink=true)
Return the file mode, normally following symbolic links.
word format(conversionProperties.get< word >("format"))
std::istream * allocatedPtr_
The allocated stream pointer (ifstream or igzstream).
IFstream(const fileName &pathname, streamFormat format=ASCII, versionNumber version=currentVersion)
Construct from pathname.
Representation of a major/minor version number.
A std::istream with the ability to handle compressed files.
word name(const complex &c)
Return string representation of complex.
void deallocate()
Delete the stream pointer.
streamFormat
Data format (ascii | binary)
IFstreamAllocator(const fileName &pathname)
Construct from pathname.
errorManip< error > abort(error &err)
errorManipArg< error, int > exit(error &err, const int errNo=1)
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
virtual std::istream & stdStream()
Access to underlying std::istream.
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
IOstream::compressionType compression_
The requested compression type.
virtual void rewind()
Rewind the stream so that it may be read again.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
defineTypeNameAndDebug(combustionModel, 0)