![]() |
The Simons
|
#include <Output.h>
Inheritance diagram for Output:
The Output class provides the ANSII standard C++ implementation of an output filesystem. It implements the FileStream protocol for opening and closing a filesystem. It implements the Stream protocol for detecting the state of a Stream. Operations that connect to the filesystem may raise a NotFound exception if the filesystem cannot be found and a NoResponse exception if the filesystem fails, or is already in use. The parent of TextOutput and ByteOutput, the Output class defines the abstract protocol for writing values of all the basic types Boolean, Character, Natural, Integer and Decimal. It also defines the protocol for writing Character[] array and String objects.
Public Member Functions | |
Output () | |
Construct a standard Output stream. | |
virtual | ~Output () |
Release an unused Output stream. | |
Output (StringID) | |
Construct an Output file stream. | |
virtual Void | open () |
Open this Output stream for writing. | |
virtual Void | close () |
Close this Output stream. | |
virtual Void | openLog () |
Open this Output stream for appending. | |
virtual Boolean | exists () const |
Test if this Output stream exists. | |
virtual Boolean | log () const |
Test if this Output stream is a log. | |
virtual Boolean | ready () const |
Test if this Output stream is ready. | |
virtual Boolean | failed () const |
Test if this Output stream has failed. | |
virtual Boolean | sink () const |
Test if this Output is a sink. | |
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 | |
Output (const Output &) | |
Copy another Output stream. | |
Protected Attributes | |
std::ostream * | filesystem |
The output stream pathname. |
|
Copy another Output stream. Required by C++ to ensure that copying an Output faithfully copies a FileStream. Constructs a shallow copy of the other Output.
|
|
Construct a standard Output stream. Constructs an Output stream onto the standard output (display monitor). By default, the pathname is null.
|
|
Release an unused Output stream. Performs all closing actions to disconnect from the underlying filesystem. |
|
Construct an Output file stream. Constructs an Output stream onto the given path name. When opened, this Output stream will connect to the named file.
|
|
Close this Output stream. Provided this Output is open, closes the connection to the underlying filesystem. Otherwise, has no effect, since this Output is not connected. Reimplemented from Stream. Reimplemented in WebOutput. |
|
Test if this Output stream exists. Use this method to test if the connection with the underlying filesystem was successfully opened.
Reimplemented from Stream. |
|
Test if this Output stream has failed. Use this method to test if this Output stream failed to complete the previous output operation.
Reimplemented from Stream. |
|
Write a newline Character on the output. May raise a WriteFailure exception if writing fails. This method is abstract in Output. Reimplemented in TextOutput, and WebOutput. |
|
Test if this Output stream is a log. Use this method to test for the bitmask that indicates that this file was opened for appending.
Reimplemented from FileStream. |
|
Open this Output stream for writing. Provided this Output is not already in use, opens a connection to the underlying filesystem. Otherwise, raises a DeviceBusy exception indicating that the connection was refused. If a successful connection opens an existing file, the previous file contents will be overwritten by the new data. If no file pathname was supplied, opens a connection to standard output. Reimplemented from Stream. Reimplemented in WebOutput. |
|
Open this Output stream for appending. Provided this Output is not already in use, opens a connection to the underlying filesystem. Otherwise, raises a DeviceBusy exception indicating that the connection was refused. If a successful connection opens an existing file, the previous file contents will be preserved and new data will be appended to the end. If no file pathname was supplied, opens a connection to standard error. Reimplemented from FileStream. Reimplemented in WebOutput. |
|
Write out a literal Character array. The Character array must be a null-byte terminated string. This method is abstract in Output.
Reimplemented in TextOutput. |
|
Write out a String. May raise a WriteFailure exception if writing fails. This method is abstract in Output.
Reimplemented in TextOutput. |
|
Write out a Decimal value. Attempts to write the given value to this Output stream. May raise a WriteFailure exception if writing fails. This method is abstract in Output.
Reimplemented in TextOutput. |
|
Write out an Integer value. Attempts to write the given value to this Output stream. May raise a WriteFailure exception if writing fails. This method is abstract in Output.
Reimplemented in TextOutput. |
|
Write out a Natural value. Attempts to write the given value to this Output stream. May raise a WriteFailure exception if writing fails. This method is abstract in Output.
Reimplemented in TextOutput. |
|
Write out a Character value. Attempts to write the given value to this Output stream. May raise a WriteFailure exception if writing fails. This method is abstract in Output.
Reimplemented in TextOutput. |
|
Write out a Boolean value. Attempts to write the given value to this Output stream. May raise a WriteFailure exception if writing fails. This method is abstract in Output.
Reimplemented in TextOutput. |
|
Test if this Output stream is ready. Use this method to test if the Output stream is ready for the next output operation.
Reimplemented from Stream. |
|
Test if this Output is a sink. Trivially returns true for Output streams.
Reimplemented from Stream. |
|
Write a space Character on the output. May raise a WriteFailure exception if writing fails. This method is abstract in Output. Reimplemented in TextOutput, and WebOutput. |
|
Write a tab Character on the output. May raise a WriteFailure exception if writing fails. This method is abstract in Output. Reimplemented in TextOutput, and WebOutput. |
|
The output stream pathname.
|