X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffreenet%2Fintroductionpuzzlexml.cpp;h=735ddf9728443bcf252e6fe3df7e0134ad184ec5;hb=76805933f794915a72b7f0a21b12af6654759f4f;hp=bb457223750f3c0c872fb3afa6402251cfb0537b;hpb=047cea32f848d605c549ec123c12c1c400dd7ec1;p=fms.git diff --git a/src/freenet/introductionpuzzlexml.cpp b/src/freenet/introductionpuzzlexml.cpp index bb45722..735ddf9 100644 --- a/src/freenet/introductionpuzzlexml.cpp +++ b/src/freenet/introductionpuzzlexml.cpp @@ -12,31 +12,18 @@ IntroductionPuzzleXML::IntroductionPuzzleXML() std::string IntroductionPuzzleXML::GetXML() { Poco::AutoPtr doc=new Poco::XML::Document; - //TiXmlDocument td; - //TiXmlDeclaration *tdec=new TiXmlDeclaration("1.0","UTF-8",""); - Poco::XML::Element *root=doc->createElement("IntroductionPuzzle"); - //TiXmlElement *tid; - //TiXmlPrinter tp; + Poco::AutoPtr root=doc->createElement("IntroductionPuzzle"); doc->appendChild(root); - //td.LinkEndChild(tdec); - //tid=new TiXmlElement("IntroductionPuzzle"); - //td.LinkEndChild(tid); root->appendChild(XMLCreateTextElement(doc,"Type",m_type)); - //tid->LinkEndChild(XMLCreateTextElement("Type",m_type)); root->appendChild(XMLCreateCDATAElement(doc,"UUID",m_uuid)); - //tid->LinkEndChild(XMLCreateCDATAElement("UUID",m_uuid)); root->appendChild(XMLCreateTextElement(doc,"MimeType",m_mimetype)); - //tid->LinkEndChild(XMLCreateTextElement("MimeType",m_mimetype)); root->appendChild(XMLCreateTextElement(doc,"PuzzleData",m_puzzledata)); - //tid->LinkEndChild(XMLCreateTextElement("PuzzleData",m_puzzledata)); - //td.Accept(&tp); - //return std::string(tp.CStr()); return GenerateXML(doc); } @@ -101,48 +88,4 @@ const bool IntroductionPuzzleXML::ParseXML(const std::string &xml) } return parsed; - - /* - TiXmlDocument td; - td.Parse(xml.c_str()); - - if(!td.Error()) - { - TiXmlText *txt; - TiXmlHandle hnd(&td); - - Initialize(); - - txt=hnd.FirstChild("IntroductionPuzzle").FirstChild("Type").FirstChild().ToText(); - if(txt) - { - m_type=SanitizeSingleString(txt->ValueStr()); - } - - txt=hnd.FirstChild("IntroductionPuzzle").FirstChild("UUID").FirstChild().ToText(); - if(txt) - { - m_uuid=SanitizeSingleString(txt->ValueStr()); - } - - txt=hnd.FirstChild("IntroductionPuzzle").FirstChild("MimeType").FirstChild().ToText(); - if(txt) - { - m_mimetype=SanitizeSingleString(txt->ValueStr()); - } - - txt=hnd.FirstChild("IntroductionPuzzle").FirstChild("PuzzleData").FirstChild().ToText(); - if(txt) - { - m_puzzledata=txt->ValueStr(); - } - - return true; - - } - else - { - return false; - } - */ }