1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-16 14:57:05 +01:00

XML interface polish, XML fragments can be pushed into a writer

This commit is contained in:
2018-04-06 18:32:14 +01:00
parent eddf023b8a
commit 1569a374a9
3 changed files with 48 additions and 43 deletions

View File

@ -43,6 +43,7 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
namespace Grid
{
void xmlCheckParse(const pugi::xml_parse_result &result, const std::string name);
class XmlWriter: public Writer<XmlWriter>
{
@ -66,8 +67,8 @@ namespace Grid
class XmlReader: public Reader<XmlReader>
{
public:
XmlReader(const char *xmlstring, std::string toplev = std::string("grid") );
XmlReader(const std::string &fileName, std::string toplev = std::string("grid") );
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);
@ -77,7 +78,7 @@ namespace Grid
template <typename U>
void readDefault(const std::string &s, std::vector<U> &output);
private:
void initDoc(const std::string &toplev);
void checkParse(const pugi::xml_parse_result &result, const std::string name);
private:
pugi::xml_document doc_;
pugi::xml_node node_;