University of Sheffield   

    The Simons
    Component Library

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

TextOutput Class Reference

#include <TextOutput.h>

Inheritance diagram for TextOutput:

Output FileStream Stream Object WebOutput List of all members.

Detailed Description

TextOutput: an output stream for writing data in text format.

TextOutput is a kind of Output stream for writing data encoded in plain text format. It contrasts with ByteOutput, the stream for writing data encoded in binary format. Text data is written by converting each value into its textual representation and appending the text to the output stream. No additional white space is inserted between items. The output will be buffered and physically written to file storage when the buffer is flushed. All the simple types Boolean, Character, Natural, Integer and Decimal may be written. String objects and raw Character[] arrays may be written, preserving internal white space.


Public Member Functions

 TextOutput ()
 Construct a standard TextOutput stream.

virtual ~TextOutput ()
 Release an unused TextOutput stream.

 TextOutput (StringID)
 Construct a TextOutput file stream.

virtual ObjectID clone () const
 Clone a copy of this TextOutput.

virtual OutputID put (Boolean)
 Write out a Boolean value.

virtual OutputID put (Character)
 Write out a Character value.

virtual OutputID put (Natural)
 Write out a Natural value.

virtual OutputID put (Integer)
 Write out an Integer value.

virtual OutputID put (Decimal)
 Write out a Decimal value.

virtual OutputID put (StringID)
 Write out a String.

virtual OutputID put (Character[])
 Write out a literal Character array.

virtual OutputID line ()
 Write a newline Character on the output.

virtual OutputID space ()
 Write a space Character on the output.

virtual OutputID tab ()
 Write a tab Character on the output.


Protected Member Functions

 TextOutput (const TextOutput &)
 Copy another TextOutput stream.


Constructor & Destructor Documentation

TextOutput::TextOutput const TextOutput &  output  )  [protected]
 

Copy another TextOutput stream.

Required by C++ to ensure that copying an TextOutput faithfully copies an Output. Constructs a shallow copy of the other TextOutput.

Parameters:
output - the TextOutput to copy.
Returns:
the copied TextOutput stream.

TextOutput::TextOutput  ) 
 

Construct a standard TextOutput stream.

Constructs a TextOutput stream onto the standard output (display monitor). By default, the pathname is null and the filesystem is closed.

Returns:
a standard TextOutput stream.

TextOutput::~TextOutput  )  [virtual]
 

Release an unused TextOutput stream.

Performs all closing actions to disconnect from the underlying filesystem.

TextOutput::TextOutput StringID  name  ) 
 

Construct a TextOutput file stream.

Constructs a TextOutput stream onto the named file.

Parameters:
name - a file pathname.
Returns:
a file TextOutput stream.


Member Function Documentation

ObjectID TextOutput::clone  )  const [virtual]
 

Clone a copy of this TextOutput.

Creates a shallow copy, which shares the file path name, if any, but does not initialise any filesystem.

Reimplemented from Object.

Reimplemented in WebOutput.

OutputID TextOutput::line  )  [virtual]
 

Write a newline Character on the output.

May raise a WriteFailure exception if writing fails.

Reimplemented from Output.

Reimplemented in WebOutput.

OutputID TextOutput::put Character  array[]  )  [virtual]
 

Write out a literal Character array.

Attempts to write out the Character contents of the array, up to but not including the terminating null byte. The array must contain the null byte, otherwise this method will fail in unchecked ways.

Parameters:
array - the array to write out.
Returns:
this TextOutput stream.

Reimplemented from Output.

OutputID TextOutput::put StringID  string  )  [virtual]
 

Write out a String.

Attempts to write out the Character contents of the String, up to but not including the terminating null byte. May raise a WriteFailure exception if writing fails.

Parameters:
string - the String to write out.
Returns:
this TextOutput stream.

Reimplemented from Output.

OutputID TextOutput::put Decimal  value  )  [virtual]
 

Write out a Decimal value.

Attempts to write the given value to this TextOutput stream. May raise a WriteFailure exception if writing fails.

Parameters:
value - the value to write out.
Returns:
this TextOutput stream.

Reimplemented from Output.

OutputID TextOutput::put Integer  value  )  [virtual]
 

Write out an Integer value.

Attempts to write the given value to this TextOutput stream. May raise a WriteFailure exception if writing fails.

Parameters:
value - the value to write out.
Returns:
this TextOutput stream.

Reimplemented from Output.

OutputID TextOutput::put Natural  value  )  [virtual]
 

Write out a Natural value.

Attempts to write the given value to this TextOutput stream. May raise a WriteFailure exception if writing fails.

Parameters:
value - the value to write out.
Returns:
this TextOutput stream.

Reimplemented from Output.

OutputID TextOutput::put Character  value  )  [virtual]
 

Write out a Character value.

Attempts to write the given value to this TextOutput stream. May raise a WriteFailure exception if writing fails.

Parameters:
value - the value to write out.
Returns:
this TextOutput stream.

Reimplemented from Output.

OutputID TextOutput::put Boolean  value  )  [virtual]
 

Write out a Boolean value.

Attempts to write the given value to this TextOutput stream. May raise a WriteFailure exception if writing fails.

Parameters:
value - the value to write out.
Returns:
this TextOutput stream.

Reimplemented from Output.

OutputID TextOutput::space  )  [virtual]
 

Write a space Character on the output.

May raise a WriteFailure exception if writing fails.

Reimplemented from Output.

Reimplemented in WebOutput.

OutputID TextOutput::tab  )  [virtual]
 

Write a tab Character on the output.

May raise a WriteFailure exception if writing fails.

Reimplemented from Output.

Reimplemented in WebOutput.


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