namespace xsil class Xwriter

XML writer class.

Public Methods

Xwriter(std::ostream& ostr)
XML writer constructor.
~Xwriter(void)
destructor.
void text(const std::string& data)
Write text string.
void endLine(void)
End of an output line
void Tag(const char* tagname, int nattr=0, const char** attr=0, const char** value=0)
Write a tag.
void TagNData(const char* tagname, int nattr=0, const char** attr=0, const char** value=0)
Write a dataless tag.
void Integer(int N)
Write an integer.
void endTag(const char* tagname)
write a close tag.
void sync(void)
Flush output data.
void setDocType(const std::string& doc)
Set the document type text.
void writeHeader(void)
Write the document header.
void defineLigoLW(void)
Copy in the ligo_lw definition.

Documentation

The Xwriter class formats data for XML output. It provides checks of the XML syntax.
Xwriter(std::ostream& ostr)
Construct an XML file writer to format data to an output stream.
Parameters:
ostr - Output stream to receive formatted XML.

~Xwriter(void)
XML writer destructor.

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

void endLine(void)
End of an output line

void Tag(const char* tagname, int nattr=0, const char** attr=0, const char** value=0)
Write an xsil 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 Xwiter 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 TagNData(const char* tagname, int nattr=0, const char** attr=0, const char** value=0)
Write a dataless xsil 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 Integer(int N)
Write an integer value to the output stream.
Parameters:
N - value to be written.

void endTag(const char* 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 sync(void)
Synchronize the buffer to the output file by flushing buffered data to the output stream.

void setDocType(const std::string& doc)
Set the document type text to a specified string.

void writeHeader(void)
Write the XML document header.

void defineLigoLW(void)
Copy in the ligo_lw definition.


This class has no child classes.
Author:
J. Zweizig
Version:
1.1; Modified 22-Feb-2000.

alphabetic index hierarchy of classes


generated by doc++