FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Istream Class Reference

An Istream is an abstract base class for all input systems (streams, files, token lists etc). The basic operations are construct, close, read token, read primitive and read binary block. More...

#include <OpenFOAM/Istream.H>


Detailed Description

An Istream is an abstract base class for all input systems (streams, files, token lists etc). The basic operations are construct, close, read token, read primitive and read binary block.

In addition, version control and line number counting is incorporated. Usually one would use the read primitive member functions, but if one were reading a stream on unknown data sequence one can read token by token, and then analyse.

Source files

Definition at line 58 of file Istream.H.

Inheritance diagram for Istream:
Collaboration diagram for Istream:

List of all members.

Public Member Functions

 Istream (streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
 Set stream status.
virtual  ~Istream ()
void  putBack (const token &)
 Put back token.
bool  getBack (token &)
 Get the put back token.
virtual Istream &  read (token &)=0
 Return next token from stream.
virtual Istream &  read (char &)=0
 Read a character.
virtual Istream &  read (word &)=0
 Read a word.
virtual Istream &  read (string &)=0
virtual Istream &  read (label &)=0
 Read a label.
virtual Istream &  read (floatScalar &)=0
 Read a floatScalar.
virtual Istream &  read (doubleScalar &)=0
 Read a doubleScalar.
virtual Istream &  read (char *, std::streamsize)=0
 Read binary block.
virtual Istream &  rewind ()=0
 Rewind and return the stream so that it may be read again.
Istream &  readBegin (const char *funcName)
Istream &  readEnd (const char *funcName)
Istream &  readEndBegin (const char *funcName)
char  readBeginList (const char *funcName)
char  readEndList (const char *funcName)
Istream &  operator() () const
 Return a non-const reference to const Istream.

Constructor & Destructor Documentation

Istream ( streamFormat   format = ASCII,
versionNumber   version = currentVersion,
compressionType   compression = UNCOMPRESSED  
) [inline]

Set stream status.

Definition at line 77 of file Istream.H.

virtual ~Istream (  ) [inline, virtual]

Definition at line 90 of file Istream.H.


Member Function Documentation

bool getBack ( token &   t  )

Get the put back token.

Definition at line 34 of file Istream.C.

References IOstream::bad(), Foam::exit(), Foam::FatalIOError, and FatalIOErrorIn.

Referenced by ITstream::read(), ISstream::read(), and IPstream::read().

virtual Istream& read ( token &    ) [pure virtual]
virtual Istream& read ( char &    ) [pure virtual]

Read a character.

Implemented in IPstream, ISstream, and ITstream.

virtual Istream& read ( word &    ) [pure virtual]

Read a word.

Implemented in IPstream, ISstream, and ITstream.

virtual Istream& read ( string &    ) [pure virtual]

Implemented in IPstream, ISstream, and ITstream.

virtual Istream& read ( label &    ) [pure virtual]

Read a label.

Implemented in IPstream, ISstream, and ITstream.

virtual Istream& read ( floatScalar &    ) [pure virtual]

Read a floatScalar.

Implemented in IPstream, ISstream, and ITstream.

virtual Istream& read ( doubleScalar &    ) [pure virtual]

Read a doubleScalar.

Implemented in IPstream, ISstream, and ITstream.

virtual Istream& read ( char *   ,
std::streamsize    
) [pure virtual]

Read binary block.

Implemented in IPstream, ISstream, and ITstream.

virtual Istream& rewind (  ) [pure virtual]

Rewind and return the stream so that it may be read again.

Implemented in IPstream, ISstream, and ITstream.

Foam::Istream & readEndBegin ( const char *   funcName  )

Definition at line 114 of file Istream.C.

char readEndList ( const char *   funcName  )
Foam::Istream & operator() (  ) const

Return a non-const reference to const Istream.

Needed for read-constructors where the stream argument is temporary: e.g. thing thisThing(IFstream("thingFileName")());

Reimplemented in IFstream, and IStringStream.

Definition at line 165 of file Istream.C.

References IOerror::exit(), and Foam::FatalIOError.


The documentation for this class was generated from the following files:
  • src/OpenFOAM/db/IOstreams/IOstreams/Istream.H
  • src/OpenFOAM/db/IOstreams/IOstreams/Istream.C