QDP++
QDP::XMLWriter Class Reference

Metadata output class. More...

#include <qdp_xmlio.h>

Inheritance diagram for QDP::XMLWriter:
QDP::XMLArrayWriter QDP::XMLBufferWriter QDP::XMLFileWriter

Public Member Functions

 XMLWriter ()
virtual ~XMLWriter ()
virtual void openSimple (const std::string &tagname)
 Writes an opening XML tag.
virtual void closeSimple ()
virtual void openStruct (const std::string &tagname)
 Writes an opening XML tag.
virtual void closeStruct ()
void openTag (const std::string &tagname)
 Writes an opening XML tag.
void openTag (const std::string &nsprefix, const std::string &tagname)
 Writes an opening XML tag.
void openTag (const std::string &tagname, XMLWriterAPI::AttributeList &al)
 Writes an opening XML tag.
void openTag (const std::string &nsprefix, const std::string &tagname, XMLWriterAPI::AttributeList &al)
 Writes an opening XML tag.
void closeTag ()
 Closes a tag.
void emptyTag (const std::string &tagname)
 Writes an empty tag.
void emptyTag (const std::string &nsprefix, const std::string &tagname)
 Writes an empty tag.
void emptyTag (const std::string &tagname, XMLWriterAPI::AttributeList &al)
 Writes an empty tag.
void emptyTag (const std::string &nsprefix, const std::string &tagname, XMLWriterAPI::AttributeList &al)
 Writes an empty tag.
void write (const std::string &output)
 Write tag contents.
void write (const int &output)
 Write tag contents.
void write (const unsigned int &output)
 Write tag contents.
void write (const short int &output)
 Write tag contents.
void write (const unsigned short int &output)
 Write tag contents.
void write (const long int &output)
 Write tag contents.
void write (const unsigned long int &output)
 Write tag contents.
void write (const float &output)
 Write tag contents.
void write (const double &output)
 Write tag contents.
void write (const bool &output)
 Write tag contents.
void writeXML (const std::string &output)

Friends

class XMLArrayWriter

Detailed Description

Metadata output class.

Use this to write XML.When closing tags, you do not have to specify which tag to close since this class will remember the order in which you opened the tags and close them in reverse order to ensure well-formed XML.

Note that only the primary node writes XML.

Definition at line 505 of file qdp_xmlio.h.

Constructor & Destructor Documentation

◆ XMLWriter()

QDP::XMLWriter::XMLWriter ( )

Definition at line 608 of file qdp_xmlio.cc.

Referenced by QDP::XMLArrayWriter::XMLArrayWriter().

◆ ~XMLWriter()

QDP::XMLWriter::~XMLWriter ( )
virtual

Definition at line 612 of file qdp_xmlio.cc.

Member Function Documentation

◆ closeSimple()

void QDP::XMLWriter::closeSimple ( )
virtual

Definition at line 621 of file qdp_xmlio.cc.

References closeTag().

◆ closeStruct()

void QDP::XMLWriter::closeStruct ( )
virtual

Reimplemented in QDP::XMLArrayWriter.

Definition at line 631 of file qdp_xmlio.cc.

References closeTag().

Referenced by QDP::pop().

◆ closeTag()

◆ emptyTag() [1/4]

void QDP::XMLWriter::emptyTag ( const std::string & nsprefix,
const std::string & tagname )

Writes an empty tag.

Parameters
nsprefixA namespace prefix for the tag
tagnameThe name of the tag

◆ emptyTag() [2/4]

void QDP::XMLWriter::emptyTag ( const std::string & nsprefix,
const std::string & tagname,
XMLWriterAPI::AttributeList & al )

Writes an empty tag.

Parameters
nsprefixA namespace prefix for the tag
tagnameThe name of the tag
alA list of attributes for this tag

Definition at line 679 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ emptyTag() [3/4]

void QDP::XMLWriter::emptyTag ( const std::string & tagname)

Writes an empty tag.

Parameters
tagnameThe name of the tag

Definition at line 668 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ emptyTag() [4/4]

void QDP::XMLWriter::emptyTag ( const std::string & tagname,
XMLWriterAPI::AttributeList & al )

Writes an empty tag.

Parameters
tagnameThe name of the tag
alA list of attributes for this tag

Definition at line 673 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ openSimple()

void QDP::XMLWriter::openSimple ( const std::string & tagname)
virtual

Writes an opening XML tag.

Parameters
tagnameThe name of the tag

Definition at line 616 of file qdp_xmlio.cc.

References openTag().

◆ openStruct()

void QDP::XMLWriter::openStruct ( const std::string & tagname)
virtual

Writes an opening XML tag.

Parameters
tagnameThe name of the tag

Reimplemented in QDP::XMLArrayWriter.

Definition at line 626 of file qdp_xmlio.cc.

References openTag().

Referenced by QDP::push().

◆ openTag() [1/4]

void QDP::XMLWriter::openTag ( const std::string & nsprefix,
const std::string & tagname )

Writes an opening XML tag.

Parameters
nsprefixA namespace prefix for the tag
tagnameThe name of the tag

Definition at line 642 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ openTag() [2/4]

void QDP::XMLWriter::openTag ( const std::string & nsprefix,
const std::string & tagname,
XMLWriterAPI::AttributeList & al )

Writes an opening XML tag.

Parameters
nsprefixA namespace prefix for the tag
tagnameThe name of the tag
alA list of attributes for this tag

Definition at line 654 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ openTag() [3/4]

◆ openTag() [4/4]

void QDP::XMLWriter::openTag ( const std::string & tagname,
XMLWriterAPI::AttributeList & al )

Writes an opening XML tag.

Parameters
tagnameThe name of the tag
alA list of attributes for this tag

Definition at line 648 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ write() [1/10]

void QDP::XMLWriter::write ( const bool & output)

Write tag contents.

Definition at line 734 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ write() [2/10]

void QDP::XMLWriter::write ( const double & output)

Write tag contents.

Definition at line 729 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ write() [3/10]

void QDP::XMLWriter::write ( const float & output)

Write tag contents.

Definition at line 724 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ write() [4/10]

void QDP::XMLWriter::write ( const int & output)

Write tag contents.

Definition at line 694 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ write() [5/10]

void QDP::XMLWriter::write ( const long int & output)

Write tag contents.

Definition at line 714 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ write() [6/10]

void QDP::XMLWriter::write ( const short int & output)

Write tag contents.

Definition at line 704 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ write() [7/10]

◆ write() [8/10]

void QDP::XMLWriter::write ( const unsigned int & output)

Write tag contents.

Definition at line 699 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ write() [9/10]

void QDP::XMLWriter::write ( const unsigned long int & output)

Write tag contents.

Definition at line 719 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ write() [10/10]

void QDP::XMLWriter::write ( const unsigned short int & output)

Write tag contents.

Definition at line 709 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

◆ writeXML()

void QDP::XMLWriter::writeXML ( const std::string & output)

Definition at line 741 of file qdp_xmlio.cc.

References QDP::Layout::primaryNode().

Referenced by QDP::operator<<(), and QDP::operator<<().

◆ XMLArrayWriter

friend class XMLArrayWriter
friend

Definition at line 617 of file qdp_xmlio.h.

References XMLArrayWriter.

Referenced by XMLArrayWriter.


The documentation for this class was generated from the following files: