html::writer Class Reference
[Html Document preparation]

#include <writer.hh>

List of all members.

Public Member Functions

 writer (std::ostream &ostr)
 ~writer (void)
void text (const std::string &data)
void endLine (void)
void tag (const char *tagname, int nattr=0, const char **attr=0, const char **value=0)
void tag (const char *tagname, const attList &attr)
void tagNData (const char *tagname, int nattr=0, const char **attr=0, const char **value=0)
void tagNData (const char *tagname, const attList &attr)
void meta (const char *name, const char *value)
void meta (const char *name, double value)
void Integer (int N)
void endTag (const std::string &tagname)
void pushDefault (const attList &x)
const attListrefDefault (void) const
attListrefDefault (void)
void popDefault (void)
void sync (void)


Detailed Description

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. brief HTML writer class.
Author:
J. Zweizig
Version:
1.1; Modified 5-May-2001.

Constructor & Destructor Documentation

html::writer::writer ( std::ostream &  ostr  ) 

Construct an XML file writer to format data to an output stream. brief HTML writer constructor.

Parameters:
ostr Output stream to receive formatted XML.

html::writer::~writer ( void   ) 

Destroy an HTML writer. brief Writer destructor.


Member Function Documentation

void html::writer::text ( const std::string &  data  ) 

Output specified HTML text to the stream. brief Write text.

Parameters:
data Text to be written to the output stream.

void html::writer::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 brief End an output line.

void html::writer::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. brief Write a tag.

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 html::writer::tag ( const char *  tagname,
const attList attr 
)

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. brief Write a tag.

Parameters:
tagname Pointer to the tag name.
attr List of attributes.

void html::writer::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. brief Write a dataless tag.

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 html::writer::tagNData ( const char *  tagname,
const attList attr 
)

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. brief Write a tag.

Parameters:
tagname Pointer to the tag name.
attr List of attributes.

void html::writer::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'>. brief Write HTML meta-data.

Parameters:
name HTML meta-data name.
value HTML meta-data value.

void html::writer::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'>. brief Write HTML meta-data.

Parameters:
name HTML meta-data name.
value Numberic HTML meta-data value.

void html::writer::Integer ( int  N  ) 

Write an integer value to the output stream. brief Write an integer.

Parameters:
N value to be written.

void html::writer::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. brief write a close tag.

Parameters:
tagname Name f tag to be closed.

void html::writer::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. brief Push the specified attributes onto the default attribute stack.

Parameters:
x attribute list.

const html::attList & html::writer::refDefault ( void   )  const [inline]

Get a constant reference to the current default attribute list. brief Get the current default attribute list.

Returns:
Constant reference to the curent default attribute list.

html::attList & html::writer::refDefault ( void   )  [inline]

Get a reference to the current default attribute list. brief Get the current default attribute list.

Returns:
Reference to the curent default attribute list.

void html::writer::popDefault ( void   ) 

Remove the current attribute list from the default attribute stack. brief Remove the current list from the default attribute stack.

void html::writer::sync ( void   ) 

Synchronize the buffer to the output file by flushing buffered data to the output stream. brief Flush output data.


The documentation for this class was generated from the following file:
Generated on Sun Mar 8 19:21:32 2009 for dmt by  doxygen 1.5.4