Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added ProcessXMLCalenadrHome to the CalDAV Object.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 6 Mar 2016 10:55:16 +0000 (10:55 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 6 Mar 2016 10:55:16 +0000 (10:55 +0000)
source/objects/CalDAV/CalDAV-XMLProcessing.cpp

index 81d4674..1884533 100644 (file)
@@ -84,6 +84,70 @@ string CalDAV::ProcessXMLUserPrincipal(){
        
 }
 
+string CalDAV::ProcessXMLCalendarHome(){
+
+       string CalendarHomeURI;
+       
+       xmlDocPtr xmlCalDAVDoc;
+       xmlCalDAVDoc = xmlReadMemory(ServerData.c_str(), (int)ServerData.size(), "noname.xml", NULL, 0);
+
+       xmlNodePtr NodeSeek;
+       bool NodeFound = false;
+       
+       // Start with the first node, look for multistatus.
+       
+       for (NodeSeek = xmlCalDAVDoc->children;
+               NodeSeek != NULL;
+               NodeSeek = NodeSeek->next)
+       {
+       
+               if (!xmlStrcmp(NodeSeek->name, (const xmlChar *)"multistatus") ||
+                       !xmlStrcmp(NodeSeek->name, (const xmlChar *)"d:multistatus") ||
+                       !xmlStrcmp(NodeSeek->name, (const xmlChar *)"D:multistatus")
+               ){
+                       
+                       NodeFound = true;
+                       break;
+                       
+               }
+               
+       }
+       
+       // Look for response.
+
+       if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
+       NodeFound = MatchXMLName(&NodeSeek, "response");
+
+       // Look for propstat.
+       
+       if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
+       NodeFound = MatchXMLName(&NodeSeek, "propstat");
+
+       // Look for prop.
+       
+       if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
+       NodeFound = MatchXMLName(&NodeSeek, "prop");
+       
+       // Look for calendar-home-set.
+       
+       if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
+       NodeFound = MatchXMLName(&NodeSeek, "calendar-home-set");
+       
+       // Look for href.       
+       
+       if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
+       NodeFound = MatchXMLName(&NodeSeek, "href");
+
+       // Get the data from href.
+       
+       CalendarHomeURI = FetchXMLData(&NodeSeek);
+       
+       xmlFreeDoc(xmlCalDAVDoc);
+       
+       return CalendarHomeURI;
+       
+}
+
 bool CalDAV::MatchXMLName(xmlNodePtr *NodePtr, string NodeName){
 
        string NodeNameSmallD = "d:" + NodeName;
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy