namespace html class writer

HTML writer class.

Public Methods

writer(std::ostream& ostr)
HTML writer constructor.
~writer(void)
Writer destructor.
void text(const std::string& data)
Write text.
void endLine(void)
End an output line.
void tag(const char* tagname, int nattr=0, const char** attr=0, const char** value=0)
Write a tag.
void tag(const char* tagname, const attList& atl)
Write a tag.
void tagNData(const char* tagname, int nattr=0, const char** attr=0, const char** value=0)
Write a dataless tag.
void tagNData(const char* tagname, const attList& atl)
Write a tag.
void meta(const char* name, const char* value)
Write HTML meta-data.
void meta(const char* name, double value)
Write HTML meta-data.
void Integer(int N)
Write an integer.
void endTag(const std::string& tagname)
write a close tag.
void pushDefault(const attList& x)
Push the specified attributes onto the default attribute stack.
const attList& refDefault(void) const
Get the current default attribute list.
attList& refDefault(void)
Get the current default attribute list.
void popDefault(void)
Remove the current list from the default attribute stack.
void sync(void)
Flush output data.

Documentation

The writer class formats data for HTML output. It provides checks of the HTML syntax. THe writer is typically constructed and then passed to the html::document::write method to receive he HTML document.
writer(std::ostream& ostr)
Construct an XML file writer to format data to an output stream.
Parameters:
ostr - Output stream to receive formatted XML.

~writer(void)
Destroy an HTML writer.

void text(const std::string& data)
Output specified HTML text to the stream.
Parameters:
data - Text to be written to the output stream.

void endLine(void)
Flush the current output line to the output stream followed by an end-of-line character. THe current line length is reset to zero

void tag(const char* tagname, int nattr=0, const char** attr=0, const char** value=0)
Write an html tag to the output file. A list of attribute names and associated values are written inside the tag block. Attribute names with null value pointers are not written. The tag name is added to the writer tag list for validation.
Parameters:
tagname - Pointer to the tag name.
nattr - Number of attributes to be included in the tag.
attr - List of pointers to attribute names.
value - List of pointers to attribute values.

void tag(const char* tagname, const attList& atl)
Write an html tag to the output file. A list of attributes is written inside the tag block. Attribute names with default values are not written. The tag name is added to the writer tag list for validation.
Parameters:
tagname - Pointer to the tag name.
attr - List of attributes.

void tagNData(const char* tagname, int nattr=0, const char** attr=0, const char** value=0)
Write a dataless html tag to the output file. A list of attribute names and associated values are written inside the tag block. Attribute names with null value pointers are not written. The <tag> syntax is used and no end tag block will be generated.
Parameters:
tagname - Pointer to the tag name.
nattr - Number of attributes to be included in the tag.
attr - List of pointers to attribute names.
value - List of pointers to attribute values.

void tagNData(const char* tagname, const attList& atl)
Write an html tag to the output file. A list of attributes is written inside the tag block. Attribute names with default values are not written. The tag name is added to the writer tag list for validation.
Parameters:
tagname - Pointer to the tag name.
attr - List of attributes.

void meta(const char* name, const char* value)
Write HTML meta-data word to the document. The HTML meta-data have the following form: <meta http-equiv="name" content="value">.
Parameters:
name - HTML meta-data name.
value - HTML meta-data value.

void meta(const char* name, double value)
Write HTML meta-data value to the document. The HTML meta-data have the following form: <meta http-equiv="name" content="value">.
Parameters:
name - HTML meta-data name.
value - Numberic HTML meta-data value.

void Integer(int N)
Write an integer value to the output stream.
Parameters:
N - value to be written.

void endTag(const std::string& tagname)
Write the </name> end tag to the output stream. The specified tag name must match that of the most recent unclosed tag.
Parameters:
tagname - Name f tag to be closed.

void pushDefault(const attList& x)
Push an attribute list onto the top of the writer's default attribute stack. The new attributes will replace any attributes with the same name.
Parameters:
x - attribute list.

const attList& refDefault(void) const
Get a constant reference to the current default attribute list.
Returns:
Constant reference to the curent default attribute list.

attList& refDefault(void)
Get a reference to the current default attribute list.
Returns:
Reference to the curent default attribute list.

void popDefault(void)
Remove the current attribute list from the default attribute stack.

void sync(void)
Synchronize the buffer to the output file by flushing buffered data to the output stream.


This class has no child classes.
Author:
J. Zweizig
Version:
1.1; Modified 5-May-2001.

alphabetic index hierarchy of classes


generated by doc++