summaryrefslogtreecommitdiff
path: root/plugins/Quotes/IXMLEngine.h
blob: 910c3efea0249dfdc6ffc05b22294f3d5e1821a3 (plain)
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
43
#ifndef __f88e20d7_5e65_40fb_a7b5_7c7af1ee1c78_IXMLEngine_h__
#define __f88e20d7_5e65_40fb_a7b5_7c7af1ee1c78_IXMLEngine_h__

class IXMLNode
{
public:
	typedef boost::shared_ptr<IXMLNode> TXMLNodePtr;

public:
	IXMLNode() {}
	virtual ~IXMLNode() {}

	virtual size_t GetChildCount()const = 0;
	virtual TXMLNodePtr GetChildNode(size_t nIndex)const = 0;
	
	virtual tstring GetText()const = 0;
	virtual tstring GetName()const = 0;

	virtual bool AddChild(const TXMLNodePtr& pNode) = 0;
	virtual bool AddAttribute(const tstring& rsName,const tstring& rsValue) = 0;
	virtual tstring GetAttributeValue(const tstring& rsAttrName) = 0;
	virtual void Write(tostream& o)const = 0;
};

inline tostream& operator<<(tostream& o,const IXMLNode& node) 
{
	node.Write(o);
	return o;
}

class IXMLEngine
{
public:
	IXMLEngine() {}

	virtual ~IXMLEngine() {}

	virtual IXMLNode::TXMLNodePtr LoadFile(const tstring& rsFileName)const = 0;
	virtual bool SaveFile(const tstring& rsFileName,const IXMLNode::TXMLNodePtr& pNode)const = 0;
	virtual IXMLNode::TXMLNodePtr CreateNode(const tstring& rsName,const tstring& rsText)const = 0;
};

#endif //__f88e20d7_5e65_40fb_a7b5_7c7af1ee1c78_IXMLEngine_h__