diff options
Diffstat (limited to 'cpp/src/IceXML/Parser.cpp')
-rw-r--r-- | cpp/src/IceXML/Parser.cpp | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/cpp/src/IceXML/Parser.cpp b/cpp/src/IceXML/Parser.cpp index 0097ed0a352..5cae7178956 100644 --- a/cpp/src/IceXML/Parser.cpp +++ b/cpp/src/IceXML/Parser.cpp @@ -28,16 +28,16 @@ IceXML::ParserException::ParserException(const char* file, int line, const strin { } +#ifndef ICE_CPP11_COMPILER IceXML::ParserException::~ParserException() throw() { } - -const char* IceXML::ParserException::_name = "IceXML::ParserException"; +#endif string -IceXML::ParserException::ice_name() const +IceXML::ParserException::ice_id() const { - return _name; + return "::IceXML::ParserException"; } void @@ -54,11 +54,13 @@ IceXML::ParserException::ice_print(std::ostream& out) const } } +#ifndef ICE_CPP11_MAPPING IceXML::ParserException* IceXML::ParserException::ice_clone() const { return new ParserException(*this); } +#endif void IceXML::ParserException::ice_throw() const @@ -126,6 +128,12 @@ IceXML::Node::addChild(const NodePtr&) return false; } +void +IceXML::Node::destroy() +{ + _parent = 0; +} + int IceXML::Node::getLine() const { @@ -181,6 +189,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 +236,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 +270,7 @@ namespace IceXML class DocumentBuilder : public Handler { public: + DocumentBuilder(); virtual void startElement(const string&, const Attributes&, int, int); @@ -251,6 +280,7 @@ public: DocumentPtr getDocument() const; private: + list<NodePtr> _nodeStack; DocumentPtr _document; }; @@ -405,7 +435,7 @@ IceXML::Parser::parse(istream& in, Handler& handler) } if(XML_Parse(parser, buff, static_cast<int>(in.gcount()), isFinal) != 1) { - handler.error(XML_ErrorString(XML_GetErrorCode(parser)), + handler.error(XML_ErrorString(XML_GetErrorCode(parser)), static_cast<int>(XML_GetCurrentLineNumber(parser)), static_cast<int>(XML_GetCurrentColumnNumber(parser))); return; |