summaryrefslogtreecommitdiff
path: root/cpp/src/IceXML/Parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceXML/Parser.cpp')
-rw-r--r--cpp/src/IceXML/Parser.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/cpp/src/IceXML/Parser.cpp b/cpp/src/IceXML/Parser.cpp
index dccff6d34d5..9a32636b47e 100644
--- a/cpp/src/IceXML/Parser.cpp
+++ b/cpp/src/IceXML/Parser.cpp
@@ -126,6 +126,12 @@ IceXML::Node::addChild(const NodePtr&)
return false;
}
+void
+IceXML::Node::destroy()
+{
+ _parent = 0;
+}
+
int
IceXML::Node::getLine() const
{
@@ -181,6 +187,16 @@ IceXML::Element::addChild(const NodePtr& child)
return true;
}
+void
+IceXML::Element::destroy()
+{
+ Node::destroy();
+ for(NodeList::iterator p = _children.begin(); p != _children.end(); ++p)
+ {
+ (*p)->destroy();
+ }
+}
+
//
// Text
//
@@ -218,6 +234,16 @@ IceXML::Document::addChild(const NodePtr& child)
return true;
}
+void
+IceXML::Document::destroy()
+{
+ Node::destroy();
+ for(NodeList::iterator p = _children.begin(); p != _children.end(); ++p)
+ {
+ (*p)->destroy();
+ }
+}
+
//
// Handler
//
@@ -242,6 +268,7 @@ namespace IceXML
class DocumentBuilder : public Handler
{
public:
+
DocumentBuilder();
virtual void startElement(const string&, const Attributes&, int, int);
@@ -251,6 +278,7 @@ public:
DocumentPtr getDocument() const;
private:
+
list<NodePtr> _nodeStack;
DocumentPtr _document;
};