Classdesc 3.44
xml_unpack_t Class Reference

#include <xml_unpack_base.h>

Collaboration diagram for xml_unpack_t:
Collaboration graph

Public Types

typedef std::map< std::string, std::string > ContentMap

Public Member Functions

 CLASSDESC_ACCESS (xml_unpack_t)
 xml_unpack_t (const char *fname)
template<class Stream>
 xml_unpack_t (Stream &i)
template<class Stream>
void process_attribute (XMLtoken< Stream > &i, const std::string &scope)
template<class Stream>
void parse (Stream &i)
template<class Stream>
void parse (XMLtoken< Stream > &stream, const std::string &scope)
ContentMap::const_iterator firstToken (const std::string &prefix) const
 first token starting with prefix
ContentMap::const_iterator endToken (const std::string &prefix) const
void printContentMap () const
 dump XML contents for debugging
template<class T>
void istoT (const std::string &s, T &x)
template<class T>
void stoT (const std::string &s, T &x)
template<class T>
void unpack (std::string key, T &var)
 simple data type deserialisation
void unpack (std::string key, bool &var)
void unpack (std::string key, std::string &var)
 string deserialisation
void unpack (std::string key, CDATA &a)
bool exists (const std::string &key)
 checks for existence of token unpacked from XML stream
size_t count (std::string key)
 returns number of array elements with prefix key
void clear ()

Public Attributes

bool missingException

Friends

struct classdesc_access::access_pack< xml_unpack_t >
struct classdesc_access::access_unpack< xml_unpack_t >

Detailed Description

XML deserialisation object

Member Function Documentation

◆ parse()

template<class Stream>
void parse ( Stream & i)

parse an input XML file, into the database Stream is either std::istream or a FILE*

References parse().

Referenced by parse().

◆ process_attribute()

template<class Stream>
void process_attribute ( XMLtoken< Stream > & stream,
const std::string & scope )

parse XML attribute string from XML stream

Member Data Documentation

◆ missingException

bool missingException

set this to true if you wish an exception to be thrown if data is missing from the XML stream


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