![]() |
The Simons
|
#include <WebOutput.h>
Inheritance diagram for WebOutput:
WebOutput is a kind of TextOutput stream for generating web pages, that is used by CGI programs. It adapts TextOutput by redefining the open() and close() methods to print the header and footer text required by web browsers automatically. This ensures that the page is properly formatted even in the event of an Exception. The title of the web page may be supplied at construction or by openOn(), but output is always directed to the standard output stream. Each paired use of openOn() and close() writes to a separate web page. Text formatting and spacing methods are redefined to insert XHTML tags that achieve the same effect. All other methods are inherited from TextOutput.
Public Member Functions | |
WebOutput () | |
Construct a default WebOutput stream. | |
virtual | ~WebOutput () |
Release an unused WebOutput stream. | |
WebOutput (StringID) | |
Construct a standard WebOutput stream onto the named web page. | |
virtual ObjectID | clone () const |
Clone a copy of this WebOutput. | |
virtual Void | open () |
Open this WebOutput stream for writing. | |
virtual Void | close () |
Close this WebOutput stream. | |
virtual Void | openLog () |
Open this WebOutput stream for appending. | |
virtual Void | openOn (StringID) |
Open this WebOutput on a new web page. | |
virtual Void | openLogOn (StringID) |
Open this WebOutput on a new web page. | |
StringID | page () const |
Return this WebOutput's web page title. | |
virtual OutputID | line () |
Write an XHTML forced line break tag on the output. | |
virtual OutputID | space () |
Write an XHTML non-breaking space on the output. | |
virtual OutputID | tab () |
Write five XHTML non-breaking spaces on the output. | |
Protected Member Functions | |
WebOutput (const WebOutput &) | |
Copy another WebOutput stream. |
|
Copy another WebOutput stream. Required by C++ to ensure that copying a WebOutput faithfully copies a TextOutput. Constructs a shallow copy of the other WebOutput.
|
|
Construct a default WebOutput stream. Constructs a WebOutput stream onto the standard output. CGI programs are always expected to print results on standard output. By default the page name is set to "Generated Output" and the filesystem is closed.
|
|
Release an unused WebOutput stream. Performs all closing actions to print out the closing tags for the web page and then disconnect from the underlying filesystem. |
|
Construct a standard WebOutput stream onto the named web page. Constructs a WebOutput stream that will use the supplied name as the title of the web page, but which streams to standard output.
|
|
Clone a copy of this WebOutput. Creates a shallow copy, which shares the web page name, if any, but does not initialise any filesystem. Reimplemented from TextOutput. |
|
Close this WebOutput stream. Provided this WebOutput is open, prints the standard footer text for a web page and closes the connection to standard output. Otherwise, has no effect. The standard footer text includes a message "Generated on <date> by the Simons Component Library" inside address-tags and all closing XHTML tags. Reimplemented from Output. |
|
Write an XHTML forced line break tag on the output. May raise a WriteFailure exception if writing fails. Reimplemented from TextOutput. |
|
Open this WebOutput stream for writing. Provided this WebOutput is not already in use, opens a connection to the standard output stream and prints the standard header text for a web page. Otherwise, raises a NoResponse exception indicating that the connection was refused. Any String name that was supplied is used as the title of the web page. Upon opening, prints the standard MIME header required by web browsers and all information required inside the XHTML head-tags, including the page title, up to the opening body-tag. Thereafter, user data corresponding to the web page content may be streamed using the various put() methods. All content is appended to standard output. Reimplemented from Output. |
|
Open this WebOutput stream for appending. Equivalent to the standard open() method, since every opening action is expected to start a new web page and all data is appended to standard output in any case. This method is provided for compatibility only. See open() for full details. Reimplemented from Output. |
|
Open this WebOutput on a new web page. Equivalent to the standard openOn() method, since every opening action is expected to start a new web page and all data is appended to standard output in any case. This method is provided for compatibility only. See openOn() for full details.
Reimplemented from FileStream. |
|
Open this WebOutput on a new web page. Provided this WebOutput is closed, sets the new page name and opens a connection to standard output and prints the standard header text for a web page, using the supplied title as the web page title. Otherwise, raises a DeviceBusy exception, to indicate that this WebOutput is already writing to a web page. Use openOn() and close() alternately to write to a series of different web pages.
Reimplemented from FileStream. |
|
Return this WebOutput's web page title.
|
|
Write an XHTML non-breaking space on the output. May raise a WriteFailure exception if writing fails. Reimplemented from TextOutput. |
|
Write five XHTML non-breaking spaces on the output. May raise a WriteFailure exception if writing fails. Reimplemented from TextOutput. |