version 0.2.4
[fms.git] / src / http / identityexportxml.cpp
index 1f87e85..e8d9d0b 100644 (file)
@@ -9,9 +9,9 @@ IdentityExportXML::IdentityExportXML()
        Initialize();\r
 }\r
 \r
-void IdentityExportXML::AddIdentity(const std::string &name, const std::string &publickey, const std::string &privatekey, const bool singleuse, const bool publishtrustlist, const bool publishboardlist)\r
+void IdentityExportXML::AddIdentity(const std::string &name, const std::string &publickey, const std::string &privatekey, const bool singleuse, const bool publishtrustlist, const bool publishboardlist, const bool publishfreesite)\r
 {\r
-       m_identities.push_back(identity(name,publickey,privatekey,singleuse,publishtrustlist,publishboardlist));\r
+       m_identities.push_back(identity(name,publickey,privatekey,singleuse,publishtrustlist,publishboardlist,publishfreesite));\r
 }\r
 \r
 const std::string IdentityExportXML::GetName(const long index)\r
@@ -62,6 +62,18 @@ const bool IdentityExportXML::GetPublishBoardList(const long index)
        }\r
 }\r
 \r
+const bool IdentityExportXML::GetPublishFreesite(const long index)\r
+{\r
+       if(index>=0 && index<GetCount())\r
+       {\r
+               return m_identities[index].m_publishfreesite;\r
+       }\r
+       else\r
+       {\r
+               return false;\r
+       }\r
+}\r
+\r
 const bool IdentityExportXML::GetPublishTrustList(const long index)\r
 {\r
        if(index>=0 && index<GetCount())\r
@@ -107,6 +119,7 @@ std::string IdentityExportXML::GetXML()
                tr->LinkEndChild(XMLCreateBooleanElement("SingleUse",(*i).m_singleuse));\r
                tr->LinkEndChild(XMLCreateBooleanElement("PublishTrustList",(*i).m_publishtrustlist));\r
                tr->LinkEndChild(XMLCreateBooleanElement("PublishBoardList",(*i).m_publishboardlist));\r
+               tr->LinkEndChild(XMLCreateBooleanElement("PublishFreesite",(*i).m_publishfreesite));\r
        }\r
 \r
        td.Accept(&tp);\r
@@ -131,6 +144,7 @@ const bool IdentityExportXML::ParseXML(const std::string &xml)
                bool singleuse=false;\r
                bool publishtrustlist=false;\r
                bool publishboardlist=false;\r
+               bool publishfreesite=false;\r
                TiXmlText *txt;\r
                TiXmlHandle hnd(&td);\r
                TiXmlNode *node;\r
@@ -146,6 +160,7 @@ const bool IdentityExportXML::ParseXML(const std::string &xml)
                        singleuse=false;\r
                        publishtrustlist=false;\r
                        publishboardlist=false;\r
+                       publishfreesite=false;\r
 \r
                        TiXmlHandle hnd2(node);\r
                        txt=hnd2.FirstChild("Name").FirstChild().ToText();\r
@@ -167,10 +182,11 @@ const bool IdentityExportXML::ParseXML(const std::string &xml)
                        singleuse=XMLGetBooleanElement(node->ToElement(),"SingleUse");\r
                        publishtrustlist=XMLGetBooleanElement(node->ToElement(),"PublishTrustList");\r
                        publishboardlist=XMLGetBooleanElement(node->ToElement(),"PublishBoardList");\r
+                       publishfreesite=XMLGetBooleanElement(node->ToElement(),"PublishFreesite");\r
 \r
                        if(name!="" && publickey!="" && privatekey!="")\r
                        {\r
-                               m_identities.push_back(identity(name,publickey,privatekey,singleuse,publishtrustlist,publishboardlist));\r
+                               m_identities.push_back(identity(name,publickey,privatekey,singleuse,publishtrustlist,publishboardlist,publishfreesite));\r
                        }\r
                        \r
                        node=node->NextSibling("Identity");\r