OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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...

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.

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 53 of file Istream.H.


Constructor & Destructor Documentation

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

Set stream status.

Definition at line 72 of file Istream.H.

virtual ~Istream (  )  [inline, virtual]

Definition at line 85 of file Istream.H.


Member Function Documentation

void putBack ( const token &  t  ) 

Put back token.

Definition at line 48 of file Istream.C.

Referenced by PtrList< T >::read(), and dictionary::read().

Here is the caller graph for this function:

bool getBack ( token &  t  ) 

Get the put back token.

Definition at line 26 of file Istream.C.

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

Here is the call graph for this function:

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 & readBegin ( const char *  funcName  ) 

Definition at line 72 of file Istream.C.

Referenced by Istream::readBeginList(), and VectorSpace< Form, Cmpt, nCmpt >::VectorSpace().

Here is the caller graph for this function:

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

Definition at line 106 of file Istream.C.

char readBeginList ( const char *  funcName  ) 

Definition at line 115 of file Istream.C.

References Istream::readBegin(), and Istream::readEnd().

Referenced by PtrList< T >::read().

Here is the call graph for this function:

Here is the caller graph for this function:

char readEndList ( const char *  funcName  ) 

Definition at line 136 of file Istream.C.

Referenced by PtrList< T >::read().

Here is the caller graph for this function:

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 157 of file Istream.C.


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
Copyright © 2000-2009 OpenCFD Ltd