OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

IOstream Class Reference

Inheritance diagram for IOstream:

Inheritance graph
[legend]
Collaboration diagram for IOstream:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 84 of file IOstream.H.


Public Types

enum  streamAccess { OPENED, CLOSED }
 Enumeration for whether the stream open or closed. More...
enum  streamFormat { ASCII, BINARY }
 Enumeration for the format of data in the stream. More...
enum  compressionType { UNCOMPRESSED, COMPRESSED }
 Enumeration for the format of data in the stream. More...

Public Member Functions

 IOstream (streamFormat format, versionNumber version, compressionType compression=UNCOMPRESSED)
 Construct setting format and version.
virtual ~IOstream ()
virtual const fileName & name () const
 Return the name of the stream.
virtual fileName & name ()
 Return non-const access to the name of the stream.
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.
versionNumber version () const
 Return current stream version.
compressionType compression () const
 Return current compression.
label lineNumber () const
 Return current stream line number.
virtual ios::fmtflags flags () const=0
 Return flags of stream.
label & lineNumber ()
 Return current stream line number.
void set (const streamFormat fmt)
 Set the stream format.
void setFormat (const word &fmt)
 Set the stream format from word.
void set (const versionNumber version)
 Reset stream version.
void setVersion (const versionNumber version)
 Reset stream version.
void setCompression (const compressionType compression)
 Reset stream compression.
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.
virtual void print (Ostream &) const
 Print description of IOstream to Ostream.
void print (Ostream &, const int streamState) const
 Check given stream state bits.
InfoProxy< IOstream > info () const
 Return info proxy.

Static Public Member Functions

static streamFormat format (const word &)
 Return stream format of given format name.
static compressionType compression (const word &)
 Return compression of given compression name.
static unsigned int defaultPrecision ()
 Return the default precision.
static unsigned int defaultPrecision (unsigned int p)
 Reset the default precision (and return old precision).

Static Public Attributes

static const versionNumber originalVersion
 Original version number.
static const versionNumber currentVersion
 Current version number.
static unsigned int precision_
 Default precision.

Protected Member Functions

void setOpened ()
 Set stream opened.
void setClosed ()
 Set stream closed.
void setState (ios::iostate state)
 Set stream state.
void setGood ()
 Set stream to be good.

Protected Attributes

label lineNumber_

Friends

Ostream & operator<< (Ostream &os, const streamFormat &sf)
 Ostream operator.

Classes

class  versionNumber
 Version number type. More...

Member Enumeration Documentation

Enumeration for whether the stream open or closed.

Enumerator:
OPENED 
CLOSED 

Definition at line 92 of file IOstream.H.

Enumeration for the format of data in the stream.

Enumerator:
ASCII 
BINARY 

Definition at line 99 of file IOstream.H.

Enumeration for the format of data in the stream.

Enumerator:
UNCOMPRESSED 
COMPRESSED 

Definition at line 206 of file IOstream.H.


Constructor & Destructor Documentation

IOstream ( streamFormat  format,
versionNumber  version,
compressionType  compression = UNCOMPRESSED 
) [inline]

Construct setting format and version.

Definition at line 282 of file IOstream.H.

References IOstream::setBad().

Here is the call graph for this function:

virtual ~IOstream (  )  [inline, virtual]

Definition at line 301 of file IOstream.H.


Member Function Documentation

void setOpened (  )  [inline, protected]

Set stream opened.

Definition at line 252 of file IOstream.H.

References IOstream::CLOSED.

Referenced by ISstream::ISstream(), ITstream::ITstream(), and OSstream::OSstream().

Here is the caller graph for this function:

void setClosed (  )  [inline, protected]

Set stream closed.

Definition at line 258 of file IOstream.H.

void setState ( ios::iostate  state  )  [inline, protected]

Set stream state.

Definition at line 264 of file IOstream.H.

Referenced by ISstream::ISstream(), and OSstream::OSstream().

Here is the caller graph for this function:

void setGood (  )  [inline, protected]

Set stream to be good.

Definition at line 270 of file IOstream.H.

Referenced by ISstream::ISstream(), ITstream::ITstream(), and OSstream::OSstream().

Here is the caller graph for this function:

virtual const fileName& name (  )  const [inline, virtual]

Return the name of the stream.

Useful for Fstream to return the filename

Reimplemented in primitiveEntry, IFstream, OFstream, ISstream, OSstream, and ITstream.

Definition at line 313 of file IOstream.H.

virtual fileName& name (  )  [inline, virtual]

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

Useful to alter the stream name

Reimplemented in primitiveEntry, IFstream, OFstream, ISstream, OSstream, and ITstream.

Definition at line 322 of file IOstream.H.

virtual bool check ( const char *  operation  )  const [virtual]

Check IOstream status for given operation.

print IOstream state if error has occured

Referenced by pyramid::pyramid().

Here is the caller graph for this function:

void fatalCheck ( const char *  operation  )  const

Check IOstream status for given operation.

print IOstream state if error has occured and exit

bool opened (  )  const [inline]

Return true if stream has been opened.

Definition at line 343 of file IOstream.H.

bool closed (  )  const [inline]

Return true if stream is closed.

Definition at line 349 of file IOstream.H.

bool good (  )  const [inline]

Return true if next operation might succeed.

Definition at line 355 of file IOstream.H.

bool eof (  )  const [inline]

Return true if end of input seen.

Definition at line 361 of file IOstream.H.

Referenced by gaussGrad::gaussGrad().

Here is the caller graph for this function:

bool fail (  )  const [inline]

Return true if next operation will fail.

Definition at line 367 of file IOstream.H.

Referenced by IOstream::bad().

Here is the caller graph for this function:

bool bad (  )  const [inline]

Return true if stream is corrupted.

Definition at line 373 of file IOstream.H.

References IOstream::fail().

Here is the call graph for this function:

operator void * (  )  const [inline]

Return non-zero if the stream has not failed.

Definition at line 379 of file IOstream.H.

bool operator! (  )  const [inline]

Return true if the stream has failed.

Definition at line 387 of file IOstream.H.

static streamFormat format ( const word &   )  [static]

Return stream format of given format name.

streamFormat format (  )  const [inline]

Return current stream format.

Definition at line 399 of file IOstream.H.

Referenced by IOstream::defaultPrecision().

Here is the caller graph for this function:

versionNumber version (  )  const [inline]

Return current stream version.

Definition at line 405 of file IOstream.H.

References IOstream::lineNumber_.

Referenced by face::prevLabel().

Here is the caller graph for this function:

static compressionType compression ( const word &   )  [static]

Return compression of given compression name.

compressionType compression (  )  const [inline]

Return current compression.

Definition at line 414 of file IOstream.H.

References IOstream::lineNumber_.

label lineNumber (  )  const [inline]

Return current stream line number.

Definition at line 420 of file IOstream.H.

virtual ios ::fmtflags flags (  )  const [pure virtual]

Return flags of stream.

Implemented in IPstream, OPstream, ISstream, OSstream, and ITstream.

Referenced by IOstream::setBad(), IOstream::setf(), and IOstream::setFail().

Here is the caller graph for this function:

label& lineNumber (  )  [inline]

Return current stream line number.

Definition at line 432 of file IOstream.H.

static unsigned int defaultPrecision (  )  [inline, static]

Return the default precision.

Definition at line 438 of file IOstream.H.

static unsigned int defaultPrecision ( unsigned int  p  )  [inline, static]

Reset the default precision (and return old precision).

Definition at line 444 of file IOstream.H.

References IOstream::format().

Here is the call graph for this function:

void set ( const streamFormat  fmt  )  [inline]

Set the stream format.

Definition at line 452 of file IOstream.H.

void setFormat ( const word &  fmt  )  [inline]

Set the stream format from word.

Definition at line 458 of file IOstream.H.

void set ( const versionNumber  version  )  [inline]

Reset stream version.

Definition at line 464 of file IOstream.H.

void setVersion ( const versionNumber  version  )  [inline]

Reset stream version.

Definition at line 470 of file IOstream.H.

void setCompression ( const compressionType  compression  )  [inline]

Reset stream compression.

Definition at line 476 of file IOstream.H.

void setEof (  )  [inline]

Set stream to have reached eof.

Definition at line 482 of file IOstream.H.

void setFail (  )  [inline]

Set stream to have failed.

Definition at line 488 of file IOstream.H.

References IOstream::flags().

Here is the call graph for this function:

void setBad (  )  [inline]

Set stream to be bad.

Definition at line 494 of file IOstream.H.

References IOstream::flags().

Referenced by IOstream::IOstream().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual ios ::fmtflags flags ( const ios::fmtflags  f  )  [pure virtual]

Set flags of stream.

ios ::fmtflags setf ( const ios::fmtflags  f  )  [inline]

Set flags of stream.

Definition at line 503 of file IOstream.H.

References IOstream::flags().

Referenced by Foam::operator<<().

Here is the call graph for this function:

Here is the caller graph for this function:

ios ::fmtflags setf ( const ios::fmtflags  f,
const ios::fmtflags  mask 
) [inline]

Set flags of given field of stream.

Definition at line 510 of file IOstream.H.

void unsetf ( const ios::fmtflags  uf  )  [inline]

Unset flags of stream.

Definition at line 519 of file IOstream.H.

virtual void print ( Ostream &   )  const [virtual]

void print ( Ostream &  ,
const int  streamState 
) const

Check given stream state bits.

InfoProxy<IOstream> info (  )  const [inline]

Return info proxy.

Used to print IOstream information to a stream

Reimplemented in primitiveEntry.

Definition at line 540 of file IOstream.H.


Friends And Related Function Documentation

Ostream& operator<< ( Ostream &  os,
const streamFormat &  sf 
) [friend]

Ostream operator.


Member Data Documentation

Original version number.

Definition at line 216 of file IOstream.H.

Referenced by face::prevLabel().

const versionNumber currentVersion [static]

Current version number.

Definition at line 219 of file IOstream.H.

unsigned int precision_ [static]

Default precision.

Definition at line 222 of file IOstream.H.

Referenced by OSstream::OSstream().

label lineNumber_ [protected]

Definition at line 244 of file IOstream.H.

Referenced by IOstream::compression(), ISstream::get(), and IOstream::version().


The documentation for this class was generated from the following file: Copyright © 2000-2007 OpenCFD Ltd