X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Ffreenet%2Fidentityxml.cpp;h=e30989a1fd94fe97e354d149020b33665e1144c7;hp=a44057368ff3a4728ee4dc7a42e7dca56ddcdaa8;hb=76805933f794915a72b7f0a21b12af6654759f4f;hpb=047cea32f848d605c549ec123c12c1c400dd7ec1 diff --git a/src/freenet/identityxml.cpp b/src/freenet/identityxml.cpp index a440573..e30989a 100644 --- a/src/freenet/identityxml.cpp +++ b/src/freenet/identityxml.cpp @@ -12,39 +12,24 @@ IdentityXML::IdentityXML() std::string IdentityXML::GetXML() { Poco::AutoPtr doc=new Poco::XML::Document; - //TiXmlDocument td; - //TiXmlDeclaration *tdec=new TiXmlDeclaration("1.0","UTF-8",""); - Poco::XML::Element *root=doc->createElement("Identity"); - //TiXmlElement *tid; - //TiXmlPrinter tp; + Poco::AutoPtr root=doc->createElement("Identity"); doc->appendChild(root); - //td.LinkEndChild(tdec); - //tid=new TiXmlElement("Identity"); - //td.LinkEndChild(tid); root->appendChild(XMLCreateCDATAElement(doc,"Name",m_name)); - //tid->LinkEndChild(XMLCreateCDATAElement("Name",m_name)); root->appendChild(XMLCreateBooleanElement(doc,"SingleUse",m_singleuse)); - //tid->LinkEndChild(XMLCreateBooleanElement("SingleUse",m_singleuse)); root->appendChild(XMLCreateBooleanElement(doc,"PublishTrustList",m_publishtrustlist)); - //tid->LinkEndChild(XMLCreateBooleanElement("PublishTrustList",m_publishtrustlist)); root->appendChild(XMLCreateBooleanElement(doc,"PublishBoardList",m_publishboardlist)); - //tid->LinkEndChild(XMLCreateBooleanElement("PublishBoardList",m_publishboardlist)); // freesite edition will be -1 if identity isn't publishing a freesite if(m_freesiteedition>=0) { root->appendChild(XMLCreateTextElement(doc,"FreesiteEdition",m_freesiteedition)); - //tid->LinkEndChild(XMLCreateTextElement("FreesiteEdition",m_freesiteedition)); } - //td.Accept(&tp); - //return std::string(tp.CStr()); - return GenerateXML(doc); } @@ -106,48 +91,4 @@ const bool IdentityXML::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("Identity").FirstChild("Name").FirstChild().ToText(); - if(txt) - { - m_name=txt->ValueStr(); - } - - if(m_name.size()>40) - { - m_name.erase(40); - } - - m_singleuse=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"SingleUse"); - - m_publishtrustlist=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"PublishTrustList"); - - m_publishboardlist=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"PublishBoardList"); - - txt=hnd.FirstChild("Identity").FirstChild("FreesiteEdition").FirstChild().ToText(); - if(txt) - { - std::string editionstr=SanitizeSingleString(txt->ValueStr()); - StringFunctions::Convert(editionstr,m_freesiteedition); - } - - return true; - - } - else - { - return false; - } -*/ }