-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathxmlnode.h
More file actions
70 lines (53 loc) · 1.66 KB
/
Copy pathxmlnode.h
File metadata and controls
70 lines (53 loc) · 1.66 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#include "xmlattribute.h"
#include "xmlnodeiterator.h"
namespace shelllet {
namespace common {
template <typename It> class XmlNodeRange
{
public:
typedef It const_iterator;
typedef It iterator;
XmlNodeRange(It b, It e) : _begin(b), _end(e)
{
}
It begin() const { return _begin; }
It end() const { return _end; }
private:
It _begin, _end;
};
class XmlNodePrivate;
class XmlNode : public Object {
Q_DECLARE_PRIVATE(XmlNode)
friend std::ostream& operator<< (std::ostream& out, const XmlNode& node);
friend class XmlNodeIterator;
public:
XmlNode(Object* parent = nullptr);
XmlNode(const XmlNode& node, Object* parent = nullptr);
XmlNode appendChild(XmlNodeType type = XmlNodeType::Element);
XmlNode appendChild(const String& name);
void setValue(const String& value);
bool setName(const String& name);
XmlNode appendCopy(const XmlNode& proto);
XmlAttribute appendAttribute(const String& name);
XmlAttribute attribute(const String& name) const;
XmlNode parent() const;
XmlNodeRange<XmlNodeIterator> children() const;
String name() const;
XmlNodeType type() const;
XmlNodeIterator begin() const;
XmlNodeIterator end() const;
XmlNode& operator= (const XmlNode& node);
/*bool operator==(const XmlNode& r) const;
bool operator!=(const XmlNode& r) const;
bool operator<(const XmlNode& r) const;
bool operator>(const XmlNode& r) const;
bool operator<=(const XmlNode& r) const;
bool operator>=(const XmlNode& r) const;*/
protected:
XmlNode(XmlNodePrivate& d, Object* parent = nullptr);
public:
static XmlNode from(const pugi::xml_node* n);
};
}
}