University of Sheffield   

    The Simons
    Component Library

Introduction   Class Hierarchy   Class Listing   Index of Classes   Index of Methods   Header Files  

FormatStream Class Reference

#include <FormatStream.h>

Inheritance diagram for FormatStream:

Stream Object Reader Writer CGIReader XMLReader XMLWriter List of all members.

Detailed Description

FormatStream: the abstract superclass of all formatting streams.

The FormatStream class is an intermediate class in the streams hierarchy and the superclass of all streams that perform data encoding or decoding. The descendants of FormatStream are Reader and Writer, which define the abstract protocols for reading and writing Object data. Different serial Object encodings are possible, with the default being XML 1.0 (ISO-8859-1), which is encoded by XMLWriter and decoded by XMLReader. This is the standard format for serialising and restoring Object data. Other anticipated data formats include CSV (comma separated value) format for tabular data, which is used by several spreadsheet and database programs; and GGI (computer gateway interface) format, which is the encoding in which web-browsers submit the contents of web forms. FormatStream forwards requests to open, close and inspect its state to an abstract FileStream, defined in descendant classes, which handles the actual input or output of formatted data.


Public Member Functions

 FormatStream ()
 Construct a default FormatStream.

virtual ~FormatStream ()
 Release a FormatStream.

virtual Void openOn (StringID)
 Open this FormatStream on a new path name.

virtual Void open ()
 Open this FormatStream.

virtual Void close ()
 Close this FormatStream.

virtual StringID name () const
 Return the name of this FormatStream.

virtual Boolean exists () const
 Test if this FormatStream exists.

virtual Boolean empty () const
 Test if this FormatStream is empty.

virtual Boolean ready () const
 Test if this FormatStream is ready.

virtual Boolean failed () const
 Test if this FormatStream has failed.

virtual Boolean source () const
 Test if this FormatStream is a source.

virtual Boolean sink () const
 Test if this FormatStream is a sink.


Protected Member Functions

 FormatStream (const FormatStream &)
 Copy another FormatStream.

virtual FileStreamID fileStream () const
 Return the wrapped FileStream. This method is abstract.


Constructor & Destructor Documentation

FormatStream::FormatStream const FormatStream &  stream  )  [protected]
 

Copy another FormatStream.

Required by C++ to ensure that copying a FormatStream faithfully copies a Stream.

Parameters:
stream - the FormatStream to copy.
Returns:
the copied FormatStream.

FormatStream::FormatStream  ) 
 

Construct a default FormatStream.

Returns:
an empty FormatStream.

FormatStream::~FormatStream  )  [virtual]
 

Release a FormatStream.


Member Function Documentation

Void FormatStream::close  )  [virtual]
 

Close this FormatStream.

Closes the wrapped FileStream, which disconnects from the filesystem.

Reimplemented from Stream.

Boolean FormatStream::empty  )  const [virtual]
 

Test if this FormatStream is empty.

Tests whether the wrapped FileStream is empty.

Returns:
true if this FormatStream is empty, otherwise false.

Reimplemented from Stream.

Boolean FormatStream::exists  )  const [virtual]
 

Test if this FormatStream exists.

Tests whether the wrapped FileStream has an open connection to the underlying filesystem.

Returns:
true if this FormatStream is connected, otherwise false.

Reimplemented from Stream.

Boolean FormatStream::failed  )  const [virtual]
 

Test if this FormatStream has failed.

Tests whether the wrapped FileStream has failed.

Returns:
true if this FormatStream has failed, otherwise false.

Reimplemented from Stream.

FileStreamID FormatStream::fileStream  )  const [protected, virtual]
 

Return the wrapped FileStream. This method is abstract.

Reimplemented in Reader, and Writer.

StringID FormatStream::name  )  const [virtual]
 

Return the name of this FormatStream.

Return the name of the underlying FileStream.

Returns:
the name of this FormatStream.

Reimplemented from Stream.

Void FormatStream::open  )  [virtual]
 

Open this FormatStream.

Opens the wrapped FileStream on the current path name and connects to the filesystem.

Reimplemented from Stream.

Void FormatStream::openOn StringID  name  )  [virtual]
 

Open this FormatStream on a new path name.

Opens the wrapped FileStream on the the supplied path name and connects to the filesystem.

Parameters:
name - a file path name.

Reimplemented from Stream.

Reimplemented in CGIReader.

Boolean FormatStream::ready  )  const [virtual]
 

Test if this FormatStream is ready.

Tests whether the wrapped FileStream is ready.

Returns:
true if this FormatStream is ready, otherwise false.

Reimplemented from Stream.

Boolean FormatStream::sink  )  const [virtual]
 

Test if this FormatStream is a sink.

Tests whether the wrapped FileStream is an Output stream.

Returns:
true if this FormatStream is a sink, otherwise false.

Reimplemented from Stream.

Boolean FormatStream::source  )  const [virtual]
 

Test if this FormatStream is a source.

Tests whether the wrapped FileStream is an Input stream.

Returns:
true if this FormatStream is a source, otherwise false.

Reimplemented from Stream.


The documentation for this class was generated from the following files:
Generated on Fri May 5 17:17:17 2006 for The Simons Component Library by doxygen1.3