-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoXMLParser.h
42 lines (34 loc) · 944 Bytes
/
RoXMLParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include <memory>
#include "pugixml-1.9/src/pugixml.hpp"
class CRoXMLNode
{
public:
virtual std::wstring getName() = 0;
virtual bool getAttribute(const std::wstring& wsAttr, std::wstring& wsValue) = 0;
virtual std::shared_ptr<CRoXMLNode> getFirstChild() = 0;
virtual bool hasChildNodes() = 0;
virtual std::shared_ptr<CRoXMLNode> getNextSibling() = 0;
protected:
CRoXMLNode() {}
virtual ~CRoXMLNode() {}
};
class CRoXMLParser
{
public:
virtual bool parse(const std::wstring& wsXmlText) = 0;
virtual std::shared_ptr<CRoXMLNode> getFirstChild() = 0;
protected:
CRoXMLParser() {};
virtual ~CRoXMLParser() {};
};
class CRoPugiXMLParser : public CRoXMLParser
{
public:
CRoPugiXMLParser();
~CRoPugiXMLParser();
virtual bool parse(const std::wstring& wsXmlText);
virtual std::shared_ptr<CRoXMLNode> getFirstChild();
protected:
pugi::xml_document m_doc;
};