FreeFOAM The Cross-Platform CFD Toolkit
ISstream Class Reference

Generic input stream. More...

#include <OpenFOAM/ISstream.H>


Detailed Description

Generic input stream.

Source files

Definition at line 53 of file ISstream.H.

+ Inheritance diagram for ISstream:
+ Collaboration diagram for ISstream:

List of all members.

Public Member Functions

 ISstream (istream &is, const string &name, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
 Construct as wrapper around istream.
virtual ~ISstream ()
virtual const fileNamename () const
 Return the name of the stream.
virtual fileNamename ()
 Return non-const access to the name of the stream.
virtual ios_base::fmtflags flags () const
 Return flags of output stream.
ISstreamget (char &)
 Raw, low-level get character function.
ISstreamgetLine (string &)
 Raw, low-level getline into a string function.
ISstreamputback (const char &)
 Raw, low-level putback character function.
virtual Istreamread (token &)
 Return next token from stream.
virtual Istreamread (char &)
 Read a character.
virtual Istreamread (word &)
 Read a word.
virtual Istreamread (string &)
 Read a string (including enclosing double-quotes).
virtual Istreamread (label &)
 Read a label.
virtual Istreamread (floatScalar &)
 Read a floatScalar.
virtual Istreamread (doubleScalar &)
 Read a doubleScalar.
virtual Istreamread (char *, std::streamsize)
 Read binary block.
virtual Istreamrewind ()
 Rewind and return the stream so that it may be read again.
virtual ios_base::fmtflags flags (const ios_base::fmtflags flags)
 Set flags of output stream.
virtual void print (Ostream &) const
 Print description of IOstream to Ostream.
- Public Member Functions inherited from Istream
 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.
IstreamreadBegin (const char *funcName)
IstreamreadEnd (const char *funcName)
IstreamreadEndBegin (const char *funcName)
char readBeginList (const char *funcName)
char readEndList (const char *funcName)
Istreamoperator() () const
 Return a non-const reference to const Istream.
- Public Member Functions inherited from IOstream
 IOstream (streamFormat format, versionNumber version, compressionType compression=UNCOMPRESSED)
 Construct setting format and version.
virtual ~IOstream ()
virtual bool check (const char *operation) const
 Check IOstream status for given operation.
void fatalCheck (const char *operation) const
 Check IOstream status for given operation.
bool opened () const
 Return true if stream has been opened.
bool closed () const
 Return true if stream is closed.
bool good () const
 Return true if next operation might succeed.
bool eof () const
 Return true if end of input seen.
bool fail () const
 Return true if next operation will fail.
bool bad () const
 Return true if stream is corrupted.
 operator void * () const
 Return non-zero if the stream has not failed.
bool operator! () const
 Return true if the stream has failed.
streamFormat format () const
 Return current stream format.
streamFormat format (const streamFormat fmt)
 Set the stream format.
streamFormat format (const word &fmt)
 Set the stream format from word.
versionNumber version () const
 Return the stream version.
versionNumber version (const versionNumber ver)
 Set the stream version.
compressionType compression () const
 Return the stream compression.
compressionType compression (const compressionType cmp)
 Set the stream compression.
compressionType compression (const word &cmp)
 Set the stream compression from word.
label lineNumber () const
 Return current stream line number.
label & lineNumber ()
 Return current stream line number.
label lineNumber (const label ln)
 Set the stream line number.
void setEof ()
 Set stream to have reached eof.
void setFail ()
 Set stream to have failed.
void setBad ()
 Set stream to be bad.
virtual ios::fmtflags flags (const ios::fmtflags f)=0
 Set flags of stream.
ios::fmtflags setf (const ios::fmtflags f)
 Set flags of stream.
ios::fmtflags setf (const ios::fmtflags f, const ios::fmtflags mask)
 Set flags of given field of stream.
void unsetf (const ios::fmtflags uf)
 Unset flags of stream.
void print (Ostream &, const int streamState) const
 Check given stream state bits.
InfoProxy< IOstreaminfo () const
 Return info proxy.

Protected Member Functions

istream & stream ()
 Return the stream reference.
const istream & stream () const
 Return the const stream reference.

Constructor & Destructor Documentation

ISstream ( istream &  is,
const string name,
streamFormat  format = ASCII,
versionNumber  version = currentVersion,
compressionType  compression = UNCOMPRESSED 
)
inline

Construct as wrapper around istream.

Definition at line 31 of file ISstreamI.H.

virtual ~ISstream ( )
inlinevirtual

Definition at line 108 of file ISstream.H.


Member Function Documentation

istream& stream ( )
inlineprotected

Return the stream reference.

Definition at line 79 of file ISstream.H.

Referenced by IStringStream::str(), and IStringStream::~IStringStream().

const istream& stream ( ) const
inlineprotected

Return the const stream reference.

Definition at line 85 of file ISstream.H.

virtual const fileName& name ( ) const
inlinevirtual

Return the name of the stream.

Useful for Fstream to return the filename

Reimplemented from IOstream.

Reimplemented in IFstream.

Definition at line 118 of file ISstream.H.

Referenced by IStringStream::print(), and ISstream::print().

virtual fileName& name ( )
inlinevirtual

Return non-const access to the name of the stream.

Useful to alter the stream name

Reimplemented from IOstream.

Reimplemented in IFstream.

Definition at line 125 of file ISstream.H.

std::ios_base::fmtflags flags ( ) const
virtual

Return flags of output stream.

Implements IOstream.

Definition at line 523 of file ISstream.C.

Foam::ISstream & get ( char &  c)
inline

Raw, low-level get character function.

Definition at line 57 of file ISstreamI.H.

References IOstream::lineNumber_, and IOstream::setState().

Referenced by Foam::readHexLabel().

Foam::ISstream & putback ( const char &  c)
inline

Raw, low-level putback character function.

Definition at line 81 of file ISstreamI.H.

Foam::Istream & read ( char &  c)
virtual

Read a character.

Implements Istream.

Definition at line 275 of file ISstream.C.

Foam::Istream & read ( word str)
virtual

Read a word.

Implements Istream.

Definition at line 282 of file ISstream.C.

References token::BEGIN_LIST, token::END_LIST, Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, and word::valid().

Foam::Istream & read ( string str)
virtual

Read a string (including enclosing double-quotes).

Backslashes are retained, except when escaping double-quotes and an embedded newline character.

Implements Istream.

Definition at line 358 of file ISstream.C.

References token::BEGIN_STRING, token::END_STRING, Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, and token::NL.

Foam::Istream & read ( label &  val)
virtual

Read a label.

Implements Istream.

Definition at line 468 of file ISstream.C.

Foam::Istream & read ( floatScalar val)
virtual

Read a floatScalar.

Implements Istream.

Definition at line 476 of file ISstream.C.

Foam::Istream & read ( doubleScalar val)
virtual

Read a doubleScalar.

Implements Istream.

Definition at line 484 of file ISstream.C.

Foam::Istream & read ( char *  buf,
std::streamsize  count 
)
virtual

Read binary block.

Implements Istream.

Definition at line 493 of file ISstream.C.

References Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, and format().

Foam::Istream & rewind ( )
virtual

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

Implements Istream.

Definition at line 512 of file ISstream.C.

std::ios_base::fmtflags flags ( const ios_base::fmtflags  flags)
virtual

Set flags of output stream.

Definition at line 529 of file ISstream.C.

void print ( Ostream os) const
virtual

Print description of IOstream to Ostream.

Reimplemented from IOstream.

Reimplemented in IFstream, and IStringStream.

Definition at line 34 of file SstreamsPrint.C.

References ISstream::name().

Referenced by IFstream::print().


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