X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=include%2Fifmsxmldocument.h;h=ae3f4e6c38c469f467b9c695551f2d4a30710138;hb=76805933f794915a72b7f0a21b12af6654759f4f;hp=6358e8f6a4b30ce1ac09d1e23a3cc7c14c7e8fe8;hpb=dec33c63afafabf83c3039e916725cac6faef9b3;p=fms.git diff --git a/include/ifmsxmldocument.h b/include/ifmsxmldocument.h index 6358e8f..ae3f4e6 100644 --- a/include/ifmsxmldocument.h +++ b/include/ifmsxmldocument.h @@ -77,12 +77,12 @@ protected: /** \brief Creates and returns an element with a boolean value */ - virtual Poco::XML::Element *XMLCreateBooleanElement(Poco::XML::Document *doc, const std::string &name, const bool value) + virtual Poco::AutoPtr XMLCreateBooleanElement(Poco::AutoPtr doc, const std::string &name, const bool value) { if(doc) { - Poco::XML::Text *txt=doc->createTextNode(value ? "true" : "false"); - Poco::XML::Element *el=doc->createElement(name); + Poco::AutoPtr txt=doc->createTextNode(value ? "true" : "false"); + Poco::AutoPtr el=doc->createElement(name); el->appendChild(txt); return el; } @@ -95,15 +95,15 @@ protected: /** \brief Creates and returns an element with a CDATA value */ - virtual Poco::XML::Element *XMLCreateCDATAElement(Poco::XML::Document *doc, const std::string &name, const std::string &data) + virtual Poco::AutoPtr XMLCreateCDATAElement(Poco::AutoPtr doc, const std::string &name, const std::string &data) { if(doc) { // Poco XML won't break up CDATA sections correctly when assigned a string with the // end tag is present. However, it will parse it correctly, so we will manually break the // CDATA into separate parts - Poco::XML::CDATASection *sec=doc->createCDATASection(StringFunctions::Replace(data,"]]>","]]]>")); - Poco::XML::Element *el=doc->createElement(name); + Poco::AutoPtr sec=doc->createCDATASection(StringFunctions::Replace(data,"]]>","]]]>")); + Poco::AutoPtr el=doc->createElement(name); el->appendChild(sec); return el; } @@ -116,12 +116,12 @@ protected: /** \brief Creates and returns a text element */ - virtual Poco::XML::Element *XMLCreateTextElement(Poco::XML::Document *doc, const std::string &name, const std::string &data) + virtual Poco::AutoPtr XMLCreateTextElement(Poco::AutoPtr doc, const std::string &name, const std::string &data) { if(doc) { - Poco::XML::Text *txt=doc->createTextNode(data); - Poco::XML::Element *el=doc->createElement(name); + Poco::AutoPtr txt=doc->createTextNode(data); + Poco::AutoPtr el=doc->createElement(name); el->appendChild(txt); return el; } @@ -131,7 +131,7 @@ protected: } } - virtual Poco::XML::Element *XMLCreateTextElement(Poco::XML::Document *doc, const std::string &name, const long data) + virtual Poco::AutoPtr XMLCreateTextElement(Poco::AutoPtr doc, const std::string &name, const long data) { if(doc) { @@ -171,6 +171,7 @@ protected: { child=child->nextSibling(); } + //return child.cast(); return static_cast(child); } else @@ -188,6 +189,7 @@ protected: { next=next->nextSibling(); } + //return next.cast(); return static_cast(next); } else @@ -207,7 +209,7 @@ protected: return returntext; } - const std::string GenerateXML(Poco::XML::Document *doc) + const std::string GenerateXML(Poco::AutoPtr doc) { std::ostringstream str; if(doc)