Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Version 0.08 release
[xestiacalendar/.git] / objects / CalDAV / CalDAV-XMLProcessing.cpp
1 // CalDAV-XMLProcessing.cpp - CalDAV Connection Object - XML Processing.
2 //
3 // (c) 2016 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
10 //
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
19 #include "CalDAV.h"
21 using namespace std;
22  
23 string CalDAV::ProcessXMLUserPrincipal(){
25         string UserPrincipalURI;
26         
27         xmlDocPtr xmlCalDAVDoc;
28         xmlCalDAVDoc = xmlReadMemory(ServerData.c_str(), (int)ServerData.size(), "noname.xml", NULL, 0);
30         xmlNodePtr NodeSeek;
31         bool NodeFound = false;
32         
33         // Start with the first node, look for multistatus.
34         
35         for (NodeSeek = xmlCalDAVDoc->children;
36                 NodeSeek != NULL;
37                 NodeSeek = NodeSeek->next)
38         {
39         
40                 if (!xmlStrcmp(NodeSeek->name, (const xmlChar *)"multistatus") ||
41                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"d:multistatus") ||
42                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"D:multistatus")
43                 ){
44                         
45                         NodeFound = true;
46                         break;
47                         
48                 }
49                 
50         }
51         
52         if (NodeFound == false){
53         
54                 return UserPrincipalURI;
56         }
57         
58         // Look for response.
60         if (NodeFound == false){ return UserPrincipalURI; } else { NodeFound = false; }
61         NodeFound = MatchXMLNameTransverse(&NodeSeek, "response");
63         // Look for propstat.
64         
65         if (NodeFound == false){ return UserPrincipalURI; } else { NodeFound = false; }
66         NodeFound = MatchXMLNameTransverse(&NodeSeek, "propstat");
68         // Look for prop.
69         
70         if (NodeFound == false){ return UserPrincipalURI; } else { NodeFound = false; }
71         NodeFound = MatchXMLNameTransverse(&NodeSeek, "prop");
72         
73         // Look for current-user-principal.
74         
75         if (NodeFound == false){ return UserPrincipalURI; } else { NodeFound = false; }
76         NodeFound = MatchXMLNameTransverse(&NodeSeek, "current-user-principal");
77         
78         // Look for href.       
79         
80         if (NodeFound == false){ return UserPrincipalURI; } else { NodeFound = false; }
81         NodeFound = MatchXMLNameTransverse(&NodeSeek, "href");
83         // Get the data from href.
84         
85         UserPrincipalURI = FetchXMLData(&NodeSeek);
86         
87         xmlFreeDoc(xmlCalDAVDoc);
88         
89         return UserPrincipalURI;
90         
91 }
93 string CalDAV::ProcessXMLCalendarHome(){
95         string CalendarHomeURI;
96         
97         xmlDocPtr xmlCalDAVDoc;
98         xmlCalDAVDoc = xmlReadMemory(ServerData.c_str(), (int)ServerData.size(), "noname.xml", NULL, 0);
100         xmlNodePtr NodeSeek;
101         bool NodeFound = false;
102         
103         // Start with the first node, look for multistatus.
104         
105         for (NodeSeek = xmlCalDAVDoc->children;
106                 NodeSeek != NULL;
107                 NodeSeek = NodeSeek->next)
108         {
109         
110                 if (!xmlStrcmp(NodeSeek->name, (const xmlChar *)"multistatus") ||
111                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"d:multistatus") ||
112                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"D:multistatus")
113                 ){
114                         
115                         NodeFound = true;
116                         break;
117                         
118                 }
119                 
120         }
121         
122         if (NodeFound == false){
123         
124                 return CalendarHomeURI;
126         }
127         
128         // Look for response.
130         if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
131         NodeFound = MatchXMLNameTransverse(&NodeSeek, "response");
133         // Look for propstat.
134         
135         if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
136         NodeFound = MatchXMLNameTransverse(&NodeSeek, "propstat");
138         // Look for prop.
139         
140         if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
141         NodeFound = MatchXMLNameTransverse(&NodeSeek, "prop");
142         
143         // Look for calendar-home-set.
144         
145         if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
146         NodeFound = MatchXMLNameTransverse(&NodeSeek, "calendar-home-set");
147         
148         // Look for href.       
149         
150         if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
151         NodeFound = MatchXMLNameTransverse(&NodeSeek, "href");
153         // Get the data from href.
154         
155         CalendarHomeURI = FetchXMLData(&NodeSeek);
156         
157         xmlFreeDoc(xmlCalDAVDoc);
158         
159         return CalendarHomeURI;
160         
163 CalDAVCalendarList CalDAV::ProcessXMLCalendarList(){
164         
165         CalDAVCalendarList CalendarList;
166         
167         xmlDocPtr xmlCalDAVDoc;
168         xmlCalDAVDoc = xmlReadMemory(ServerData.c_str(), (int)ServerData.size(), "noname.xml", NULL, 0);
170         xmlNodePtr NodeSeek = NULL;
171         xmlNodePtr NodeResponse = NULL;
172         xmlNodePtr NodeMatch = NULL;
173         xmlNodePtr NodeData = NULL;
174         bool NodeFound = false;
175         int ResponseCount = 0;
176         
177         // Start with the first node, look for multistatus.
178         
179         for (NodeSeek = xmlCalDAVDoc->children;
180                 NodeSeek != NULL;
181                 NodeSeek = NodeSeek->next)
182         {
183         
184                 if (!xmlStrcmp(NodeSeek->name, (const xmlChar *)"multistatus") ||
185                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"d:multistatus") ||
186                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"D:multistatus")
187                 ){
188                 
189                         NodeResponse = NodeSeek->children;      
190                         NodeFound = true;
191                         break;
192                         
193                 }
194                 
195         }
196         
197         if (NodeFound == false){
198         
199                 return CalendarList;
201         }
202         
203         for (NodeResponse = NodeSeek->children;
204                 NodeResponse != nullptr;
205                 NodeResponse = NodeResponse->next)
206         {
207         
208                 // Go through each of the responses and find the calendars.
210                 NodeMatch = xmlCopyNode(NodeResponse, 1);
211                 
212                 if (MatchXMLName(&NodeMatch, "response")){
213 \r                       NodeData = xmlCopyNode(NodeMatch, 1);
214                         
215                         // Check the resource type is a calendar.
216                         
217                         if (!MatchXMLNameTransverse(&NodeData, "propstat")){ continue; }
218                         if (!MatchXMLNameTransverse(&NodeData, "prop")){ continue; }
219                         if (!MatchXMLNameTransverse(&NodeData, "resourcetype")){ continue; }                    
220                         if (!MatchXMLNameTransverse(&NodeData, "calendar")){ continue; }
221                         
222                         // Get the HREF.
223                         
224                         NodeData = xmlCopyNode(NodeMatch, 1);
225                         
226                         if (!MatchXMLNameTransverse(&NodeData, "href")){ continue; }
227                                                 
228                         string HREFAddress = FetchXMLData(&NodeData);
229                         
230                         // Get the calendar name.
232                         NodeData = xmlCopyNode(NodeMatch, 1);
233                         
234                         if (!MatchXMLNameTransverse(&NodeData, "propstat")){ continue; }
235                         if (!MatchXMLNameTransverse(&NodeData, "prop")){ continue; }
236                         if (!MatchXMLNameTransverse(&NodeData, "displayname")){ continue; }
237                         
238                         string CalendarName = FetchXMLData(&NodeData);
239                         
240                         // Get the calendar description.
241                         
242                         NodeData = xmlCopyNode(NodeMatch, 1);
243                         
244                         string CalendarDescription = "";
245                         
246                         if (!MatchXMLNameTransverse(&NodeData, "propstat")){ continue; }
247                         if (!MatchXMLNameTransverse(&NodeData, "prop")){ continue; }
248                         if (MatchXMLNameTransverse(&NodeData, "calendar-description")){ 
249                         
250                                 CalendarDescription = FetchXMLData(&NodeData);
251                                 
252                         }
253                         
254                         // Get the calendar colour.
255                         
256                         NodeData = xmlCopyNode(NodeMatch, 1);
258                         Colour CalendarColour;
259                         bool ColourResult = false;
260                         
261                         if (!MatchXMLNameTransverse(&NodeData, "propstat")){ continue; }
262                         if (!MatchXMLNameTransverse(&NodeData, "prop")){ continue; }
263                         if (MatchXMLNameTransverse(&NodeData, "calendar-color")){ 
264                         
265                                 string CalendarColourString = "";
266                                 string CalendarColourHexValue = "";
267                                 int ColourNumber;
268                                 bool KeepRunning = true;
269                                 
270                                 CalendarColourString = FetchXMLData(&NodeData);
271                                 
272                                 while(KeepRunning == true){
273                                 
274                                         if (CalendarColourString.substr(0,1) == "#" && CalendarColourString.length() == 9){
275                                                 
276                                                 // Get the red colour.
277                                                 
278                                                 CalendarColourHexValue = CalendarColourString.substr(1,2);
279                                                 if (!HexToInt(&CalendarColourHexValue, &ColourNumber)){ break; }
280                                                 CalendarColour.red = ColourNumber;
281                                                 
282                                                 // Get the green colour.
284                                                 CalendarColourHexValue = CalendarColourString.substr(3,2);
285                                                 if (!HexToInt(&CalendarColourHexValue, &ColourNumber)){ break; }
286                                                 CalendarColour.green = ColourNumber;
287                                                 
288                                                 // Get the blue colour.
289                                                 
290                                                 CalendarColourHexValue = CalendarColourString.substr(5,2);
291                                                 if (!HexToInt(&CalendarColourHexValue, &ColourNumber)){ break; };
292                                                 CalendarColour.blue = ColourNumber;
293                                                 
294                                                 // Get the alpha.
296                                                 CalendarColourHexValue = CalendarColourString.substr(7,2);
297                                                 if (!HexToInt(&CalendarColourHexValue, &ColourNumber)){ break; };
298                                                 CalendarColour.alpha = ColourNumber;
299                                                 
300                                                 ColourResult = true;
301                                                 
302                                         } else {
304                                                 ColourResult = false;
305                                         
306                                         }
307                                         
308                                         break;
309                                         
310                                 }
311                                 
312                         }
313                         
314                         if (ColourResult == false){
315                                         
316                                         CalendarColour.red = 0;
317                                         CalendarColour.blue = 0;
318                                         CalendarColour.green = 0;
319                                         CalendarColour.alpha = 0;
320                                         
321                         }
322                         
323                         // Get the calendar order.
325                         NodeData = xmlCopyNode(NodeMatch, 1);
326                         
327                         int CalendarOrder = 0;
328                         
329                         if (!MatchXMLNameTransverse(&NodeData, "propstat")){ continue; }
330                         if (!MatchXMLNameTransverse(&NodeData, "prop")){ continue; }
331                         if (MatchXMLNameTransverse(&NodeData, "calendar-order")){
332                                 
333                                 string CalendarOrderString = FetchXMLData(&NodeData);
334                                 if (!HexToInt(&CalendarOrderString, &CalendarOrder)){
335                                         CalendarOrder = 0;
336                                 }
337                                 
338                         }
339                         
340                         // Get the calendar tag.
341                         
342                         NodeData = xmlCopyNode(NodeMatch, 1);
343                         
344                         string CalendarTag = "";
345                         
346                         if (!MatchXMLNameTransverse(&NodeData, "propstat")){ continue; }
347                         if (!MatchXMLNameTransverse(&NodeData, "prop")){ continue; }
348                         if (MatchXMLNameTransverse(&NodeData, "getctag")){ 
349                                 
350                                 CalendarTag = FetchXMLData(&NodeData);
351                                 
352                         }
353                         
354                         // Get the calendar tag URL.
355                         
356                         NodeData = xmlCopyNode(NodeMatch, 1);
357                         
358                         string CalendarTagURL = "";
359                         
360                         if (!MatchXMLNameTransverse(&NodeData, "propstat")){ continue; }
361                         if (!MatchXMLNameTransverse(&NodeData, "prop")){ continue; }
362                         if (MatchXMLNameTransverse(&NodeData, "sync-token")){ 
363                                 
364                                 CalendarTagURL = FetchXMLData(&NodeData);
365                                 
366                         }
367                         
368                         // Insert the calendar information into the
369                         // list if all the information is there.
370                         
371                         CalendarList.Name.insert(make_pair(ResponseCount, CalendarName));
372                         CalendarList.Description.insert(make_pair(ResponseCount, CalendarDescription));
373                         CalendarList.HREF.insert(make_pair(ResponseCount, HREFAddress));
374                         CalendarList.CalColour.insert(make_pair(ResponseCount, CalendarColour));
375                         CalendarList.Order.insert(make_pair(ResponseCount, CalendarOrder));
376                         CalendarList.Tag.insert(make_pair(ResponseCount, CalendarTag));
377                         CalendarList.TagURL.insert(make_pair(ResponseCount, CalendarTagURL));
378                         
379                         ResponseCount++;
380                         
381                 }
382                 
383         }
384         
385         xmlFreeDoc(xmlCalDAVDoc);
386         
387         return CalendarList;
388         
391 string CalDAV::ProcessXMLEntryETag(){
392         
393         string EntryETag;
394         
395         xmlDocPtr xmlCalDAVDoc;
396         xmlCalDAVDoc = xmlReadMemory(ServerData.c_str(), (int)ServerData.size(), "noname.xml", NULL, 0);
398         xmlNodePtr NodeSeek;
399         bool NodeFound = false;
400         
401         // Start with the first node, look for multistatus.
402         
403         for (NodeSeek = xmlCalDAVDoc->children;
404                 NodeSeek != NULL;
405                 NodeSeek = NodeSeek->next)
406         {
407         
408                 if (!xmlStrcmp(NodeSeek->name, (const xmlChar *)"multistatus") ||
409                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"d:multistatus") ||
410                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"D:multistatus")
411                 ){
412                         
413                         NodeFound = true;
414                         break;
415                         
416                 }
417                 
418         }
419         
420         if (NodeFound == false){
421         
422                 return EntryETag;
424         }
425         
426         // Look for response.
427         
428         if (NodeFound == false){ return EntryETag; } else { NodeFound = false; }
429         NodeFound = MatchXMLNameTransverse(&NodeSeek, "response");
431         // Look for propstat.
432         
433         if (NodeFound == false){ return EntryETag; } else { NodeFound = false; }
434         NodeFound = MatchXMLNameTransverse(&NodeSeek, "propstat");
436         // Look for prop.
437         
438         if (NodeFound == false){ return EntryETag; } else { NodeFound = false; }
439         NodeFound = MatchXMLNameTransverse(&NodeSeek, "prop");
440         
441         // Look for calendar-home-set.
442         
443         if (NodeFound == false){ return EntryETag; } else { NodeFound = false; }
444         NodeFound = MatchXMLNameTransverse(&NodeSeek, "getetag");
446         // Get the data from href.
447         
448         EntryETag = FetchXMLData(&NodeSeek);    
449         
450         xmlFreeDoc(xmlCalDAVDoc);       
451         
452         // Check if the entity tag contains quote marks
453         // at the start and end and remove them (if needed).
454         
455         if (EntryETag.substr(0,1) == "\"" && 
456                 EntryETag.substr(EntryETag.size()-1, 1) == "\"" && EntryETag.size() > 2){
457                 
458                 EntryETag.erase(EntryETag.begin());
459                 EntryETag.erase(EntryETag.end()-1);
460                         
461         }
462         
463         return EntryETag;
464         
467 CalDAVEntryList CalDAV::ProcessXMLEntryList(){
469         CalDAVEntryList EntryList;
470         
471         xmlDocPtr xmlCalDAVDoc;
472         xmlCalDAVDoc = xmlReadMemory(ServerData.c_str(), (int)ServerData.size(), "noname.xml", NULL, 0);
474         xmlNodePtr NodeSeek = NULL;
475         xmlNodePtr NodeResponse = NULL;
476         xmlNodePtr NodeMatch = NULL;
477         xmlNodePtr NodeData = NULL;
478         bool NodeFound = false;
479         int ResponseCount = 0;
480         
481         // Start with the first node, look for multistatus.
482         
483         for (NodeSeek = xmlCalDAVDoc->children;
484                 NodeSeek != NULL;
485                 NodeSeek = NodeSeek->next)
486         {
487         
488                 if (!xmlStrcmp(NodeSeek->name, (const xmlChar *)"multistatus") ||
489                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"d:multistatus") ||
490                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"D:multistatus")
491                 ){
492                 
493                         NodeResponse = NodeSeek->children;      
494                         NodeFound = true;
495                         break;
496                         
497                 }
498                 
499         }
500         
501         if (NodeFound == false){
502         
503                 return EntryList;
505         }
506         
507         for (NodeResponse = NodeSeek->children;
508                 NodeResponse != nullptr;
509                 NodeResponse = NodeResponse->next)
510         {
511         
512                 // Go through each of the responses and find the calendars.
514                 NodeMatch = xmlCopyNode(NodeResponse, 1);
515                 
516                 if (MatchXMLName(&NodeMatch, "response")){
518                         NodeData = xmlCopyNode(NodeMatch, 1);
519                         
520                         // Get the HREF.
521                         
522                         NodeData = xmlCopyNode(NodeMatch, 1);
523                         
524                         if (!MatchXMLNameTransverse(&NodeData, "href")){ continue; }
525                                                 
526                         string HREFAddress = FetchXMLData(&NodeData);
527                         
528                         // Get the calendar data.
529                         
530                         NodeData = xmlCopyNode(NodeMatch, 1);
531                         
532                         string EntryDescription = "";
533                         
534                         if (!MatchXMLNameTransverse(&NodeData, "propstat")){ continue; }
535                         if (!MatchXMLNameTransverse(&NodeData, "prop")){ continue; }
536                         if (MatchXMLNameTransverse(&NodeData, "calendar-data")){ 
537                         
538                                 // Note: libxml2 will strip the CDATA part at the start and
539                                 // end of each calendar-data section.
540                                 
541                                 EntryDescription = FetchXMLData(&NodeData);
542                                 
543                         }
544                         
545                         // Get the entry entity tag.
546                         
547                         NodeData = xmlCopyNode(NodeMatch, 1);
548                         
549                         string EntryEntityTag = "";
550                         
551                         if (!MatchXMLNameTransverse(&NodeData, "propstat")){ continue; }
552                         if (!MatchXMLNameTransverse(&NodeData, "prop")){ continue; }
553                         if (MatchXMLNameTransverse(&NodeData, "getetag")){ 
554                                 
555                                 EntryEntityTag = FetchXMLData(&NodeData);
556                                 
557                         }
558                         
559                         // Insert the calendar information into the
560                         // list if all the information is there.
561                         
562                         EntryList.HREF.insert(make_pair(ResponseCount, HREFAddress));
563                         EntryList.Data.insert(make_pair(ResponseCount, EntryDescription));
564                         EntryList.Tag.insert(make_pair(ResponseCount, EntryEntityTag));
565                         
566                         ResponseCount++;
567                         
568                 }
569                 
570         }
571         
572         xmlFreeDoc(xmlCalDAVDoc);
573         
574         return EntryList;
575         
578 CalDAVEntryList CalDAV::ProcessXMLSyncTokenList(){
580         CalDAVEntryList EntryList;
581         
582         xmlDocPtr xmlCalDAVDoc;
583         xmlCalDAVDoc = xmlReadMemory(ServerData.c_str(), (int)ServerData.size(), "noname.xml", NULL, 0);
585         xmlNodePtr NodeSeek = NULL;
586         xmlNodePtr NodeResponse = NULL;
587         xmlNodePtr NodeMatch = NULL;
588         xmlNodePtr NodeData = NULL;
589         bool NodeFound = false;
590         int ResponseCount = 0;
591         
592         // Start with the first node, look for multistatus.
593         
594         for (NodeSeek = xmlCalDAVDoc->children;
595                 NodeSeek != NULL;
596                 NodeSeek = NodeSeek->next)
597         {
598         
599                 if (!xmlStrcmp(NodeSeek->name, (const xmlChar *)"multistatus") ||
600                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"d:multistatus") ||
601                         !xmlStrcmp(NodeSeek->name, (const xmlChar *)"D:multistatus")
602                 ){
603                 
604                         NodeResponse = NodeSeek->children;      
605                         NodeFound = true;
606                         break;
607                         
608                 }
609                 
610         }
611         
612         if (NodeFound == false){
613         
614                 return EntryList;
616         }
617         
618         for (NodeResponse = NodeSeek->children;
619                 NodeResponse != nullptr;
620                 NodeResponse = NodeResponse->next)
621         {
622         
623                 // Go through each of the responses and find the calendars.
625                 NodeMatch = xmlCopyNode(NodeResponse, 1);
626                 
627                 if (MatchXMLName(&NodeMatch, "response")){
629                         NodeData = xmlCopyNode(NodeMatch, 1);
630                         
631                         // Get the HREF.
632                         
633                         NodeData = xmlCopyNode(NodeMatch, 1);
634                         
635                         if (!MatchXMLNameTransverse(&NodeData, "href")){ continue; }
636                                                 
637                         string HREFAddress = FetchXMLData(&NodeData);
638                         
639                         // Get the entry entity tag.
640                         
641                         NodeData = xmlCopyNode(NodeMatch, 1);
642                         
643                         string EntryEntityTag = "";
644                         
645                         if (!MatchXMLNameTransverse(&NodeData, "propstat")){ continue; }
646                         if (!MatchXMLNameTransverse(&NodeData, "prop")){ continue; }
647                         if (MatchXMLNameTransverse(&NodeData, "getetag")){ 
648                                 
649                                 EntryEntityTag = FetchXMLData(&NodeData);
650                                 
651                         }
652                         
653                         // Insert the calendar information into the
654                         // list if all the information is there.
655                         
656                         EntryList.HREF.insert(make_pair(ResponseCount, HREFAddress));
657                         EntryList.Data.insert(make_pair(ResponseCount, ""));
658                         EntryList.Tag.insert(make_pair(ResponseCount, EntryEntityTag));
659                         
660                         ResponseCount++;
661                         
662                 }
663                 
664         }
665         
666         xmlFreeDoc(xmlCalDAVDoc);
667         
668         return EntryList;
669         
672 bool CalDAV::MatchXMLNameTransverse(xmlNodePtr *NodePtr, string NodeName){
674         string NodeNameSmallD = "d:" + NodeName;
675         string NodeNameLargeD = "D:" + NodeName;
676         
677         for ((*NodePtr) = (*NodePtr)->children;
678                 (*NodePtr) != NULL;
679                 (*NodePtr) = (*NodePtr)->next)
680         {
681         
682                 if (!xmlStrcmp((*NodePtr)->name, (const xmlChar *)NodeName.c_str()) ||
683                         !xmlStrcmp((*NodePtr)->name, (const xmlChar *)NodeNameSmallD.c_str()) ||
684                         !xmlStrcmp((*NodePtr)->name, (const xmlChar *)NodeNameLargeD.c_str())
685                 ){
686                         
687                         return true;
688                         
689                 }
690                 
691         }
692         
693         return false;
694         
697 bool CalDAV::MatchXMLName(xmlNodePtr *NodePtrOriginal, string NodeName){
699         if (NodePtrOriginal == nullptr){
700                 
701                 return false;
702                 
703         }
704         
705         string NodeNameSmallD = "d:" + NodeName;
706         string NodeNameLargeD = "D:" + NodeName;
707         
708         xmlNodePtr *NodePtr = NodePtrOriginal;
709         
710         if (!xmlStrcmp((*NodePtr)->name, (const xmlChar *)NodeName.c_str()) ||
711                 !xmlStrcmp((*NodePtr)->name, (const xmlChar *)NodeNameSmallD.c_str()) ||
712                 !xmlStrcmp((*NodePtr)->name, (const xmlChar *)NodeNameLargeD.c_str())
713         ){
714                         
715                 return true;
716                         
717         } else {
718                         
719                 return false;
720                 
721         }
722         
723         return false;
724         
727 string CalDAV::FetchXMLData(xmlNodePtr *NodePtr){
729         for ((*NodePtr) = (*NodePtr)->children;
730                 (*NodePtr) != NULL;
731                 (*NodePtr) = (*NodePtr)->next)
732         {
733                                                                 
734                 return (const char*)(*NodePtr)->content;
735                         
736         }
737         
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