#include <xml2.h>
Inheritance diagram for wxXml2BaseNode:
This is the base class for more specific nodes like wxXml2Node, wxXml2ElemDecl, wxXml2AttrDecl, wxXml2EntityDecl. This class provides the basic functions used to modify an XML tree. Libxml2 in fact, uses different structures for the different types of nodes but all of them have some parts in common: wxXml2BaseNodeObj is the common part of all XML nodes handled by libxml2. So, when you have an XML node, you can always cast it, regardless of its specific type, to a wxXml2BaseNodeObj and then change its NEXT, PREVIOUS, CHILDREN, PARENT pointers...
Public Member Functions | |
wxXml2BaseNode () | |
wxXml2BaseNode (wxXml2BaseNodeObj *p) | |
virtual | ~wxXml2BaseNode () |
bool | IsUnlinked () const |
Is this node linked to a wider XML tree ? | |
bool | IsNonEmpty () const |
Returns TRUE if this object is wrapping a non-NULL object. | |
bool | operator== (const wxXml2BaseNode &decl) const |
bool | operator!= (const wxXml2BaseNode &decl) const |
wxXml2BaseNode & | operator= (const wxXml2BaseNode &decl) |
Getters | |
These functions wrap on the fly the internal pointers of the libxml2 structure and then return them (this is why they return objects and not references to objects). | |
wxXml2NodeType | GetType () const |
wxXml2BaseNode | GetParent () const |
wxXml2BaseNode | GetChildren () const |
wxXml2BaseNode | GetFirstChild () const |
wxXml2BaseNode | GetNext () const |
wxXml2BaseNode | GetPrevious () const |
wxXml2BaseNodeObj * | GetObj () const |
Setters: still not tested all & unstable. | |
These functions are dangereous since they can break the libxml2 internal tree if they are not used carefully. Try to avoid them. | |
void | SetType (wxXml2NodeType type) |
void | SetChildren (const wxXml2BaseNode &child) |
void | SetNext (const wxXml2BaseNode &next) |
void | SetPrevious (const wxXml2BaseNode &prev) |
Protected Member Functions | |
void | Destroy () |
Destroys the data wrapped by this class freeing its memory. | |
void | SetAsEmpty () |
Sets this element as empty: that is wrapping a NULL pointer. | |
void | Copy (const wxXml2BaseNode &n) |
int & | GetPrivate () const |
Returns the private member of the wrapped structure. |
wxXml2BaseNode::wxXml2BaseNode | ( | ) | [inline] |
wxXml2BaseNode::wxXml2BaseNode | ( | wxXml2BaseNodeObj * | p | ) | [inline] |
virtual wxXml2BaseNode::~wxXml2BaseNode | ( | ) | [inline, virtual] |
void wxXml2BaseNode::Copy | ( | const wxXml2BaseNode & | n | ) | [inline, protected] |
void wxXml2BaseNode::Destroy | ( | ) | [inline, protected, virtual] |
Destroys the data wrapped by this class freeing its memory.
This function should not try to update the reference count since it should have been already updated by the caller.
Implements wxXml2Wrapper.
Reimplemented in wxXml2Node.
wxXml2BaseNode wxXml2BaseNode::GetChildren | ( | ) | const [inline] |
Reimplemented in wxXml2Node.
wxXml2BaseNode wxXml2BaseNode::GetFirstChild | ( | ) | const [inline] |
Reimplemented in wxXml2Node.
wxXml2BaseNode wxXml2BaseNode::GetNext | ( | ) | const [inline] |
Reimplemented in wxXml2Node.
wxXml2BaseNodeObj* wxXml2BaseNode::GetObj | ( | ) | const [inline] |
Reimplemented in wxXml2ElemDecl, wxXml2AttrDecl, wxXml2EntityDecl, and wxXml2Node.
wxXml2BaseNode wxXml2BaseNode::GetParent | ( | ) | const [inline] |
Reimplemented in wxXml2ElemDecl, wxXml2AttrDecl, wxXml2EntityDecl, and wxXml2Node.
wxXml2BaseNode wxXml2BaseNode::GetPrevious | ( | ) | const [inline] |
Reimplemented in wxXml2Node.
int& wxXml2BaseNode::GetPrivate | ( | ) | const [inline, protected, virtual] |
Returns the private member of the wrapped structure.
This function should be used to implement copy constructor and assignment operators.
Implements wxXml2Wrapper.
wxXml2NodeType wxXml2BaseNode::GetType | ( | ) | const [inline] |
Reimplemented in wxXml2ElemDecl, wxXml2AttrDecl, and wxXml2EntityDecl.
bool wxXml2BaseNode::IsNonEmpty | ( | ) | const [inline, virtual] |
bool wxXml2BaseNode::IsUnlinked | ( | ) | const [virtual] |
bool wxXml2BaseNode::operator!= | ( | const wxXml2BaseNode & | decl | ) | const [inline] |
wxXml2BaseNode& wxXml2BaseNode::operator= | ( | const wxXml2BaseNode & | decl | ) | [inline] |
bool wxXml2BaseNode::operator== | ( | const wxXml2BaseNode & | decl | ) | const |
void wxXml2BaseNode::SetAsEmpty | ( | ) | [inline, protected, virtual] |
Sets this element as empty: that is wrapping a NULL pointer.
This function *must not* free the memory of the currently wrapped pointer: it must just reset that pointer to NULL. This function is used by DestroyIfUnlinked().
Implements wxXml2Wrapper.
void wxXml2BaseNode::SetChildren | ( | const wxXml2BaseNode & | child | ) |
void wxXml2BaseNode::SetNext | ( | const wxXml2BaseNode & | next | ) |
void wxXml2BaseNode::SetPrevious | ( | const wxXml2BaseNode & | prev | ) |
void wxXml2BaseNode::SetType | ( | wxXml2NodeType | type | ) | [inline] |