Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added FREEBUSY property for saving data from a CalendarFreeBusyObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 5 Jun 2016 18:47:41 +0000 (19:47 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 5 Jun 2016 18:47:41 +0000 (19:47 +0100)
Added the code and unit tests for the FREEBUSY property.

source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp
source/tests/xestiacalendar_icalfreebusysave.h

index 9132b94..d14ea57 100644 (file)
@@ -432,6 +432,44 @@ void CalendarFreeBusyObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the FREEBUSY value.
+       
+       if (FreeBusyList.size() > 0){
+               
+               for (int FreeBusyListSeek = 0; FreeBusyListSeek < FreeBusyList.size();
+                       FreeBusyListSeek++){
+       
+                       DataLine += "FREEBUSY";
+                       
+                       if (FreeBusyListType[FreeBusyListSeek].size() > 0){
+               
+                               DataLine += ";FBTYPE=";
+                               DataLine += FreeBusyListType[FreeBusyListSeek];
+                       
+                       }
+                       
+                       if (FreeBusyListTokens[FreeBusyListSeek].size() > 0){
+               
+                               DataLine += ";";
+                               DataLine += FreeBusyListTokens[FreeBusyListSeek];
+                       
+                       }
+                               
+                       DataLine += ":";
+                       DataLine += FreeBusyList[FreeBusyListSeek];
+                       DataLine += "\n";
+               
+                       DataLineProcessed = OutputText(&DataLine);
+               
+                       *SaveData += DataLineProcessed;
+
+                       DataLine.clear();
+                       DataLineProcessed.clear();
+                               
+               }
+               
+       }
+       
        *SaveData += "END:VFREEBUSY\n";
        
 }
\ No newline at end of file
index 9d36a57..75f73bb 100644 (file)
@@ -75,6 +75,9 @@ TEST(iCalendarSaveFreeBusy, SaveFreeBusyTests){
        "COMMENT:This is the first comment.\n"                                                              
        "COMMENT;ALTREP=\"null:nodata\";LANGUAGE=en:This is the second comment.\n"
        "COMMENT;ZEBRAS=YES:This is the third comment.\n"
+       "FREEBUSY:20160202T210000Z/PT1H\n"
+       "FREEBUSY;FBTYPE=FREE:20160202T220000Z/PT1H\n"
+       "FREEBUSY;FBTYPE=BUSY-UNAVAILABLE;RESULT=ARGH;TEST=YES:20160202T230000Z/PT9H\n"
        "END:VFREEBUSY\n"
        "END:VCALENDAR";        
 
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