Grid 0.7.0
Grid::XmlReader Class Reference

#include <XmlIO.h>

Inheritance diagram for Grid::XmlReader:
Grid::Reader< XmlReader >

Public Member Functions

 XmlReader (const std::string &fileName, const bool isBuffer=false, std::string toplev=std::string("grid"))
virtual ~XmlReader (void)=default
bool push (const std::string &s="")
void pop (void)
bool nextElement (const std::string &s="")
template<typename U>
void readDefault (const std::string &s, U &output)
template<typename U>
void readDefault (const std::string &s, std::vector< U > &output)
template<typename U>
void readMultiDim (const std::string &s, std::vector< U > &buf, std::vector< size_t > &dim)
void readCurrentSubtree (std::string &s)
template<>
void readDefault (const std::string &s, std::string &output)
template<>
void readDefault (const std::string &s, std::string &output)
std::enable_if< std::is_base_of< Serializable, U >::value, void >::type read (const std::string &s, U &output)
std::enable_if< EigenIO::is_tensor_fixed< ETensor >::value, void >::type Reshape (ETensor &t, const std::array< typename ETensor::Index, ETensor::NumDimensions > &dims)
std::enable_if< EigenIO::is_scalar< S >::value, void >::type copyScalars (S &Dest, const S *&pSource)

Protected Member Functions

void fromString (U &output, const std::string &s)

Private Member Functions

void checkParse (const pugi::xml_parse_result &result, const std::string name)

Private Attributes

const std::string indent_
pugi::xml_document doc_
pugi::xml_node node_
std::string fileName_
XmlReaderupcast

Detailed Description

Definition at line 71 of file XmlIO.h.

Constructor & Destructor Documentation

◆ XmlReader()

XmlReader::XmlReader ( const std::string & fileName,
const bool isBuffer = false,
std::string toplev = std::string("grid") )

Definition at line 100 of file XmlIO.cc.

References doc_, fileName_, node_, and Grid::xmlCheckParse().

◆ ~XmlReader()

virtual Grid::XmlReader::~XmlReader ( void )
virtualdefault

References U.

Member Function Documentation

◆ push()

bool XmlReader::push ( const std::string & s = "")

Definition at line 135 of file XmlIO.cc.

References node_, and XML_SAFE_NODE.

Referenced by readDefault(), and readMultiDim().

◆ pop()

void XmlReader::pop ( void )

Definition at line 147 of file XmlIO.cc.

References node_.

Referenced by readDefault(), and readMultiDim().

◆ nextElement()

bool XmlReader::nextElement ( const std::string & s = "")

Definition at line 152 of file XmlIO.cc.

References node_, and XML_SAFE_NODE.

◆ readDefault() [1/4]

template<typename U>
void Grid::XmlReader::readDefault ( const std::string & s,
U & output )

Definition at line 171 of file XmlIO.h.

References Grid::Reader< XmlReader >::fromString(), readDefault(), and U.

Referenced by readDefault().

◆ readDefault() [2/4]

template<typename U>
void Grid::XmlReader::readDefault ( const std::string & s,
std::vector< U > & output )

Definition at line 180 of file XmlIO.h.

References GridLogWarning, node_, pop(), push(), and Grid::Reader< XmlReader >::read().

◆ readMultiDim()

template<typename U>
void Grid::XmlReader::readMultiDim ( const std::string & s,
std::vector< U > & buf,
std::vector< size_t > & dim )

Definition at line 198 of file XmlIO.h.

References GridLogWarning, node_, pop(), push(), and Grid::Reader< XmlReader >::read().

◆ readCurrentSubtree()

void XmlReader::readCurrentSubtree ( std::string & s)

Definition at line 164 of file XmlIO.cc.

References indent_, and node_.

◆ checkParse()

void Grid::XmlReader::checkParse ( const pugi::xml_parse_result & result,
const std::string name )
private

◆ readDefault() [3/4]

template<>
void Grid::XmlReader::readDefault ( const std::string & s,
std::string & output )

Definition at line 175 of file XmlIO.cc.

References GridLogWarning, and node_.

◆ readDefault() [4/4]

template<>
void Grid::XmlReader::readDefault ( const std::string & s,
std::string & output )

◆ read()

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

Definition at line 186 of file BaseIO.h.

Referenced by Grid::XmlReader::readDefault(), and Grid::XmlReader::readMultiDim().

◆ Reshape()

std::enable_if< EigenIO::is_tensor_variable< ETensor >::value, void >::type Reader::Reshape ( ETensor & t,
const std::array< typename ETensor::Index, ETensor::NumDimensions > & dims )
inherited

Definition at line 202 of file BaseIO.h.

◆ copyScalars()

std::enable_if< EigenIO::is_scalar< S >::value, void >::type Grid::Reader< XmlReader >::copyScalars ( S & Dest,
const S *& pSource )
inlineinherited

Definition at line 210 of file BaseIO.h.

◆ fromString()

void Reader::fromString ( U & output,
const std::string & s )
protectedinherited

Definition at line 225 of file BaseIO.h.

Referenced by Grid::XmlReader::readDefault().

Field Documentation

◆ indent_

const std::string Grid::XmlReader::indent_
private

Definition at line 90 of file XmlIO.h.

Referenced by readCurrentSubtree().

◆ doc_

pugi::xml_document Grid::XmlReader::doc_
private

Definition at line 91 of file XmlIO.h.

Referenced by XmlReader().

◆ node_

pugi::xml_node Grid::XmlReader::node_
private

◆ fileName_

std::string Grid::XmlReader::fileName_
private

Definition at line 93 of file XmlIO.h.

Referenced by XmlReader().

◆ upcast

XmlReader* Grid::Reader< XmlReader >::upcast
privateinherited

Definition at line 227 of file BaseIO.h.


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