1 #include "../../include/freenet/identityxml.h"
\r
7 IdentityXML::IdentityXML()
\r
12 std::string IdentityXML::GetXML()
\r
15 TiXmlDeclaration *tdec=new TiXmlDeclaration("1.0","UTF-8","");
\r
19 td.LinkEndChild(tdec);
\r
20 tid=new TiXmlElement("Identity");
\r
21 td.LinkEndChild(tid);
\r
23 tid->LinkEndChild(XMLCreateCDATAElement("Name",m_name));
\r
25 tid->LinkEndChild(XMLCreateBooleanElement("SingleUse",m_singleuse));
\r
27 tid->LinkEndChild(XMLCreateBooleanElement("PublishTrustList",m_publishtrustlist));
\r
29 tid->LinkEndChild(XMLCreateBooleanElement("PublishBoardList",m_publishboardlist));
\r
32 return std::string(tp.CStr());
\r
36 void IdentityXML::Initialize()
\r
39 m_publishtrustlist=false;
\r
40 m_publishboardlist=false;
\r
44 const bool IdentityXML::ParseXML(const std::string &xml)
\r
47 td.Parse(xml.c_str());
\r
52 TiXmlHandle hnd(&td);
\r
56 txt=hnd.FirstChild("Identity").FirstChild("Name").FirstChild().ToText();
\r
59 m_name=txt->ValueStr();
\r
62 m_singleuse=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"SingleUse");
\r
64 m_publishtrustlist=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"PublishTrustList");
\r
66 m_publishboardlist=XMLGetBooleanElement(hnd.FirstChild("Identity").ToElement(),"PublishBoardList");
\r