/
Node.h
executable file
·43 lines (32 loc) · 958 Bytes
/
Node.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
43
#ifndef __NODE_H__
#define __NODE_H__
#include <string>
#include <list>
#include <vector>
#include <memory>
namespace tinyXMLpp{
class Attribute;
class Node {
int numberOfChildren;
Node* parentNode;
std::vector<Node*> childNodes;
Node* nextSibling, *previousSibling;
public:
Node();
virtual ~Node();
/*retrieve parent-child-siblings*/
const std::vector<Node*>& getChildren() const;
Node* getParentNode () const;
Node* getNextSibling() const;
Node* getPreviousSibling() const;
/*Methods which allow addition and
removal of children*/
virtual void addChildNode (Node* child);
virtual void addChildNode (Node* child, int index);
virtual void removeChildNode (Node* child);
virtual void removeChildNode (int index);
/*write contents of the node to ostream*/
virtual void write(std::ostream& os) const = 0 ;
};
}
#endif