XML Library
|
The base class for all nodes that are stored in an XML document. More...
#include <Node.hpp>
Public Member Functions | |
virtual NodeType | type () const =0 |
Get the real type of the node. | |
const tchar * | typeStr () const |
Get the type of the node as a string. | |
bool | hasParent () const |
Get if the node has a parent. | |
const NodePtr | parent () const |
Get the parent node. | |
NodePtr | parent () |
Get the parent node. | |
Static Public Member Functions | |
static const tchar * | formatNodeType (NodeType eType) |
Convert the node type to a string. | |
Protected Member Functions | |
Node () | |
Default constructor. | |
virtual | ~Node () |
Destructor. | |
void | setParent (Node *pParent) |
Set the parent node. | |
Private Member Functions | |
Node (const Node &) | |
Node & | operator= (const Node &) |
Private Attributes | |
Node * | m_pParent |
The parent node. | |
Friends | |
class | NodeContainer |
Allow container class to set the parent. |
The base class for all nodes that are stored in an XML document.
The node types use internal reference counting to make it more efficient and easier to deal with the back pointers. We store the parent node as a raw pointer to ensure we don't have any cyclic references.
XML::Node::Node | ( | ) | [protected] |
Default constructor.
XML::Node::~Node | ( | ) | [protected, virtual] |
Destructor.
XML::Node::Node | ( | const Node & | ) | [private] |
virtual NodeType XML::Node::type | ( | ) | const [pure virtual] |
Get the real type of the node.
Implemented in XML::ElementNode, XML::ProcessingNode, XML::DocTypeNode, XML::CDataNode, XML::CommentNode, XML::TextNode, and XML::Document.
const tchar * XML::Node::typeStr | ( | ) | const [inline] |
Get the type of the node as a string.
bool XML::Node::hasParent | ( | ) | const [inline] |
Get if the node has a parent.
const NodePtr XML::Node::parent | ( | ) | const [inline] |
Get the parent node.
NodePtr XML::Node::parent | ( | ) | [inline] |
Get the parent node.
const tchar * XML::Node::formatNodeType | ( | NodeType | eType | ) | [static] |
Convert the node type to a string.
void XML::Node::setParent | ( | Node * | pParent | ) | [inline, protected] |
Set the parent node.
friend class NodeContainer [friend] |
Allow container class to set the parent.
Node* XML::Node::m_pParent [private] |
The parent node.