- public:
- wxXmlNode() : m_Properties(NULL), m_Parent(NULL),
- m_Children(NULL), m_Next(NULL) {}
- wxXmlNode(wxXmlNode *parent,wxXmlNodeType type,
- const wxString& name, const wxString& content,
- wxXmlProperty *props, wxXmlNode *next);
- ~wxXmlNode() { delete m_Properties; delete m_Next; delete m_Children; }
-
- // copy ctor & operator=. Note that this does NOT copy syblings
- // and parent pointer, i.e. m_Parent and m_Next will be NULL
- // after using copy ctor and are never unmodified by operator=.
- // On the other hand, it DOES copy children and properties.
- wxXmlNode(const wxXmlNode& node);
- wxXmlNode& operator=(const wxXmlNode& node);
-
- // user-friendly creation:
- wxXmlNode(wxXmlNodeType type, const wxString& name,
- const wxString& content = wxEmptyString);
- void AddChild(wxXmlNode *child);
- void InsertChild(wxXmlNode *child, wxXmlNode *before_node);
- bool RemoveChild(wxXmlNode *child);
- void AddProperty(const wxString& name, const wxString& value);
- bool DeleteProperty(const wxString& name);
-
- // access methods:
- wxXmlNodeType GetType() const { return m_Type; }
- wxString GetName() const { return m_Name; }
- wxString GetContent() const { return m_Content; }
-
- wxXmlNode *GetParent() const { return m_Parent; }
- wxXmlNode *GetNext() const { return m_Next; }
- wxXmlNode *GetChildren() const { return m_Children; }
-
- wxXmlProperty *GetProperties() const { return m_Properties; }
- bool GetPropVal(const wxString& propName, wxString *value) const;
- wxString GetPropVal(const wxString& propName, const wxString& defaultVal) const;
- bool HasProp(const wxString& propName) const;
-
- void SetType(wxXmlNodeType type) { m_Type = type; }
- void SetName(const wxString& name) { m_Name = name; }
- void SetContent(const wxString& con) { m_Content = con; }
-
- void SetParent(wxXmlNode *parent) { m_Parent = parent; }
- void SetNext(wxXmlNode *next) { m_Next = next; }
- void SetChildren(wxXmlNode *child) { m_Children = child; }
-
- void SetProperties(wxXmlProperty *prop) { m_Properties = prop; }
- void AddProperty(wxXmlProperty *prop);
-
- private:
- wxXmlNodeType m_Type;
- wxString m_Name;
- wxString m_Content;
- wxXmlProperty *m_Properties;
- wxXmlNode *m_Parent, *m_Children, *m_Next;
-
- void DoCopy(const wxXmlNode& node);
+public:
+ wxXmlNode() : m_properties(NULL), m_parent(NULL),
+ m_children(NULL), m_next(NULL) {}
+ wxXmlNode(wxXmlNode *parent,wxXmlNodeType type,
+ const wxString& name, const wxString& content,
+ wxXmlProperty *props, wxXmlNode *next);
+ ~wxXmlNode() { delete m_properties; delete m_next; delete m_children; }
+
+ // copy ctor & operator=. Note that this does NOT copy syblings
+ // and parent pointer, i.e. m_parent and m_next will be NULL
+ // after using copy ctor and are never unmodified by operator=.
+ // On the other hand, it DOES copy children and properties.
+ wxXmlNode(const wxXmlNode& node);
+ wxXmlNode& operator=(const wxXmlNode& node);
+
+ // user-friendly creation:
+ wxXmlNode(wxXmlNodeType type, const wxString& name,
+ const wxString& content = wxEmptyString);
+ void AddChild(wxXmlNode *child);
+ void InsertChild(wxXmlNode *child, wxXmlNode *before_node);
+ bool RemoveChild(wxXmlNode *child);
+ void AddProperty(const wxString& name, const wxString& value);
+ bool DeleteProperty(const wxString& name);
+
+ // access methods:
+ wxXmlNodeType GetType() const { return m_type; }
+ wxString GetName() const { return m_name; }
+ wxString GetContent() const { return m_content; }
+
+ wxXmlNode *GetParent() const { return m_parent; }
+ wxXmlNode *GetNext() const { return m_next; }
+ wxXmlNode *GetChildren() const { return m_children; }
+
+ wxXmlProperty *GetProperties() const { return m_properties; }
+ bool GetPropVal(const wxString& propName, wxString *value) const;
+ wxString GetPropVal(const wxString& propName,
+ const wxString& defaultVal) const;
+ bool HasProp(const wxString& propName) const;
+
+ void SetType(wxXmlNodeType type) { m_type = type; }
+ void SetName(const wxString& name) { m_name = name; }
+ void SetContent(const wxString& con) { m_content = con; }
+
+ void SetParent(wxXmlNode *parent) { m_parent = parent; }
+ void SetNext(wxXmlNode *next) { m_next = next; }
+ void SetChildren(wxXmlNode *child) { m_children = child; }
+
+ void SetProperties(wxXmlProperty *prop) { m_properties = prop; }
+ void AddProperty(wxXmlProperty *prop);
+
+private:
+ wxXmlNodeType m_type;
+ wxString m_name;
+ wxString m_content;
+ wxXmlProperty *m_properties;
+ wxXmlNode *m_parent, *m_children, *m_next;
+
+ void DoCopy(const wxXmlNode& node);