version 0.3.2
[fms.git] / src / freenet / identityxml.cpp
index a440573..e30989a 100644 (file)
@@ -12,39 +12,24 @@ IdentityXML::IdentityXML()
 std::string IdentityXML::GetXML()\r
 {\r
        Poco::AutoPtr<Poco::XML::Document> doc=new Poco::XML::Document;\r
-       //TiXmlDocument td;\r
-       //TiXmlDeclaration *tdec=new TiXmlDeclaration("1.0","UTF-8","");\r
-       Poco::XML::Element *root=doc->createElement("Identity");\r
-       //TiXmlElement *tid;\r
-       //TiXmlPrinter tp;\r
+       Poco::AutoPtr<Poco::XML::Element> root=doc->createElement("Identity");\r
 \r
        doc->appendChild(root);\r
-       //td.LinkEndChild(tdec);\r
-       //tid=new TiXmlElement("Identity");\r
-       //td.LinkEndChild(tid);\r
 \r
        root->appendChild(XMLCreateCDATAElement(doc,"Name",m_name));\r
-       //tid->LinkEndChild(XMLCreateCDATAElement("Name",m_name));\r
 \r
        root->appendChild(XMLCreateBooleanElement(doc,"SingleUse",m_singleuse));\r
-       //tid->LinkEndChild(XMLCreateBooleanElement("SingleUse",m_singleuse));\r
 \r
        root->appendChild(XMLCreateBooleanElement(doc,"PublishTrustList",m_publishtrustlist));\r
-       //tid->LinkEndChild(XMLCreateBooleanElement("PublishTrustList",m_publishtrustlist));\r
 \r
        root->appendChild(XMLCreateBooleanElement(doc,"PublishBoardList",m_publishboardlist));\r
-       //tid->LinkEndChild(XMLCreateBooleanElement("PublishBoardList",m_publishboardlist));\r
 \r
        // freesite edition will be -1 if identity isn't publishing a freesite\r
        if(m_freesiteedition>=0)\r
        {\r
                root->appendChild(XMLCreateTextElement(doc,"FreesiteEdition",m_freesiteedition));\r
-               //tid->LinkEndChild(XMLCreateTextElement("FreesiteEdition",m_freesiteedition));\r
        }\r
 \r
-       //td.Accept(&tp);\r
-       //return std::string(tp.CStr());\r
-\r
        return GenerateXML(doc);\r
 }\r
 \r
@@ -106,48 +91,4 @@ const bool IdentityXML::ParseXML(const std::string &xml)
        }\r
 \r
        return parsed;\r
-\r
-       /*\r
-       TiXmlDocument td;\r
-       td.Parse(xml.c_str());\r
-\r
-       if(!td.Error())\r
-       {\r
-               TiXmlText *txt;\r
-               TiXmlHandle hnd(&td);\r
-\r
-               Initialize();\r
-\r
-               txt=hnd.FirstChild("Identity").FirstChild("Name").FirstChild().ToText();\r
-               if(txt)\r
-               {\r
-                       m_name=txt->ValueStr();\r
-               }\r
-\r
-               if(m_name.size()>40)\r
-               {\r
-                       m_name.erase(40);\r
-               }\r
-\r
-               m_singleuse=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"SingleUse");\r
-\r
-               m_publishtrustlist=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"PublishTrustList");\r
-\r
-               m_publishboardlist=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"PublishBoardList");\r
-\r
-               txt=hnd.FirstChild("Identity").FirstChild("FreesiteEdition").FirstChild().ToText();\r
-               if(txt)\r
-               {\r
-                       std::string editionstr=SanitizeSingleString(txt->ValueStr());\r
-                       StringFunctions::Convert(editionstr,m_freesiteedition);\r
-               }\r
-\r
-               return true;\r
-\r
-       }\r
-       else\r
-       {\r
-               return false;\r
-       }\r
-*/\r
 }\r