Grid 0.7.0
Grid::XmlWriter Class Reference

#include <XmlIO.h>

Inheritance diagram for Grid::XmlWriter:
Grid::Writer< XmlWriter >

Public Member Functions

 XmlWriter (const std::string &fileName, std::string toplev=std::string("grid"))
virtual ~XmlWriter (void)
void push (const std::string &s)
void pushXmlString (const std::string &s)
void pop (void)
template<typename U>
void writeDefault (const std::string &s, const U &x)
template<typename U>
void writeDefault (const std::string &s, const std::vector< U > &x)
template<typename U>
void writeMultiDim (const std::string &s, const std::vector< size_t > &Dimensions, const U *pDataRowMajor, size_t NumElements)
std::string docString (void)
std::string string (void)
std::enable_if< std::is_base_of< Serializable, U >::value >::type write (const std::string &s, const U &output)
std::enable_if< EigenIO::is_scalar< S >::value, void >::type copyScalars (S *&pCopy, const S &Source)
void scientificFormat (const bool set)
bool isScientific (void)
void setPrecision (const unsigned int prec)
unsigned int getPrecision (void)

Private Attributes

const std::string indent_
pugi::xml_document doc_
pugi::xml_node node_
std::string fileName_
XmlWriterupcast
bool scientific_
unsigned int prec_

Detailed Description

Definition at line 48 of file XmlIO.h.

Constructor & Destructor Documentation

◆ XmlWriter()

XmlWriter::XmlWriter ( const std::string & fileName,
std::string toplev = std::string("grid") )

Definition at line 45 of file XmlIO.cc.

References doc_, fileName_, node_, and XmlWriter().

Referenced by XmlWriter().

◆ ~XmlWriter()

XmlWriter::~XmlWriter ( void )
virtual

Definition at line 55 of file XmlIO.cc.

References doc_, fileName_, and indent_.

Member Function Documentation

◆ push()

void XmlWriter::push ( const std::string & s)

Definition at line 62 of file XmlIO.cc.

References node_.

Referenced by writeDefault(), and writeMultiDim().

◆ pushXmlString()

void XmlWriter::pushXmlString ( const std::string & s)

Definition at line 67 of file XmlIO.cc.

References node_, pop(), and Grid::xmlCheckParse().

◆ pop()

void XmlWriter::pop ( void )

Definition at line 80 of file XmlIO.cc.

References node_.

Referenced by pushXmlString(), writeDefault(), and writeMultiDim().

◆ writeDefault() [1/2]

template<typename U>
void Grid::XmlWriter::writeDefault ( const std::string & s,
const U & x )

◆ writeDefault() [2/2]

template<typename U>
void Grid::XmlWriter::writeDefault ( const std::string & s,
const std::vector< U > & x )

Definition at line 126 of file XmlIO.h.

References pop(), push(), and Grid::Writer< XmlWriter >::write().

◆ writeMultiDim()

template<typename U>
void Grid::XmlWriter::writeMultiDim ( const std::string & s,
const std::vector< size_t > & Dimensions,
const U * pDataRowMajor,
size_t NumElements )

Definition at line 137 of file XmlIO.h.

References pop(), push(), U, and Grid::Writer< XmlWriter >::write().

◆ docString()

std::string XmlWriter::docString ( void )

Definition at line 85 of file XmlIO.cc.

References doc_, and indent_.

◆ string()

std::string XmlWriter::string ( void )

Definition at line 92 of file XmlIO.cc.

References doc_, and indent_.

◆ write()

std::enable_if<!std::is_base_of< Serializable, U >::value &&!EigenIO::is_tensor< U >::value, void >::type Writer::write ( const std::string & s,
const U & output )
inherited

Definition at line 136 of file BaseIO.h.

Referenced by Grid::XmlWriter::writeDefault(), and Grid::XmlWriter::writeMultiDim().

◆ copyScalars()

std::enable_if< EigenIO::is_scalar< S >::value, void >::type Grid::Writer< XmlWriter >::copyScalars ( S *& pCopy,
const S & Source )
inlineinherited

Definition at line 152 of file BaseIO.h.

◆ scientificFormat()

void Writer::scientificFormat ( const bool set)
inherited

Definition at line 165 of file BaseIO.h.

◆ isScientific()

bool Writer::isScientific ( void )
inherited

Definition at line 166 of file BaseIO.h.

Referenced by Grid::XmlWriter::writeDefault().

◆ setPrecision()

void Writer::setPrecision ( const unsigned int prec)
inherited

Definition at line 167 of file BaseIO.h.

◆ getPrecision()

unsigned int Writer::getPrecision ( void )
inherited

Definition at line 168 of file BaseIO.h.

Referenced by Grid::XmlWriter::writeDefault().

Field Documentation

◆ indent_

const std::string Grid::XmlWriter::indent_
private

Definition at line 65 of file XmlIO.h.

Referenced by docString(), string(), and ~XmlWriter().

◆ doc_

pugi::xml_document Grid::XmlWriter::doc_
private

Definition at line 66 of file XmlIO.h.

Referenced by docString(), string(), XmlWriter(), and ~XmlWriter().

◆ node_

pugi::xml_node Grid::XmlWriter::node_
private

Definition at line 67 of file XmlIO.h.

Referenced by pop(), push(), pushXmlString(), writeDefault(), and XmlWriter().

◆ fileName_

std::string Grid::XmlWriter::fileName_
private

Definition at line 68 of file XmlIO.h.

Referenced by XmlWriter(), and ~XmlWriter().

◆ upcast

XmlWriter* Grid::Writer< XmlWriter >::upcast
privateinherited

Definition at line 170 of file BaseIO.h.

◆ scientific_

bool Grid::Writer< XmlWriter >::scientific_
privateinherited

Definition at line 171 of file BaseIO.h.

◆ prec_

unsigned int Grid::Writer< XmlWriter >::prec_
privateinherited

Definition at line 172 of file BaseIO.h.


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