QDP++
QDP::XMLArrayWriter Class Reference

Writes metadata to an array which serves as a handle for another XML object. More...

#include <qdp_xmlio.h>

Inheritance diagram for QDP::XMLArrayWriter:
QDP::XMLWriter

Public Member Functions

 XMLArrayWriter (XMLWriter &xml_out, int size=-1)
 ~XMLArrayWriter ()
void close ()
 Closes the array writer.
int size () const
 Returns the size of the array.
void openArray (const std::string &tagname)
void closeArray ()
void openStruct (const std::string &tagname)
 Writes an opening XML tag.
void closeStruct ()
Public Member Functions inherited from QDP::XMLWriter
 XMLWriter ()
virtual ~XMLWriter ()
virtual void openSimple (const std::string &tagname)
 Writes an opening XML tag.
virtual void closeSimple ()
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)

Detailed Description

Writes metadata to an array which serves as a handle for another XML object.

Definition at line 1117 of file qdp_xmlio.h.

Constructor & Destructor Documentation

◆ XMLArrayWriter()

QDP::XMLArrayWriter::XMLArrayWriter ( XMLWriter & xml_out,
int size = -1 )
inlineexplicit

No prologue written

Parameters
xml_outprevious XMLWriter object - used for handle source
sizesize of array - default unbounded

Definition at line 1125 of file qdp_xmlio.h.

References size(), and QDP::XMLWriter::XMLWriter().

◆ ~XMLArrayWriter()

QDP::XMLArrayWriter::~XMLArrayWriter ( )

Definition at line 1396 of file qdp_xmlio.cc.

References closeArray().

Member Function Documentation

◆ close()

void QDP::XMLArrayWriter::close ( )

Closes the array writer.

It is an error to close before all data is written, unless unbounded

◆ closeArray()

void QDP::XMLArrayWriter::closeArray ( )

Definition at line 1426 of file qdp_xmlio.cc.

References QDP::XMLWriter::closeTag(), and QDP::QDP_error_exit().

Referenced by closeStruct(), and ~XMLArrayWriter().

◆ closeStruct()

void QDP::XMLArrayWriter::closeStruct ( )
virtual

Reimplemented from QDP::XMLWriter.

Definition at line 1487 of file qdp_xmlio.cc.

References closeArray(), QDP::XMLWriter::closeTag(), and QDP::QDP_error_exit().

Referenced by QDP::pop().

◆ openArray()

void QDP::XMLArrayWriter::openArray ( const std::string & tagname)

Definition at line 1402 of file qdp_xmlio.cc.

References QDP::XMLWriter::openTag(), and QDP::QDP_error_exit().

Referenced by openStruct().

◆ openStruct()

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

Writes an opening XML tag.

Parameters
tagnameThe name of the tag

Reimplemented from QDP::XMLWriter.

Definition at line 1448 of file qdp_xmlio.cc.

References openArray(), QDP::XMLWriter::openTag(), and QDP::QDP_error_exit().

Referenced by QDP::push().

◆ size()

int QDP::XMLArrayWriter::size ( ) const
inline

Returns the size of the array.

Definition at line 1145 of file qdp_xmlio.h.

Referenced by XMLArrayWriter().


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