Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added DESCRIPTION property for saving data from a CalendarEventObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 1 Jun 2016 21:48:51 +0000 (22:48 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 1 Jun 2016 21:48:51 +0000 (22:48 +0100)
Added the code and unit tests for the DESCRIPTION property.

source/objects/calendarevent/CalendarEvent-Save.cpp
source/tests/xestiacalendar_icaleventsave.h

index ee48352..849a196 100644 (file)
@@ -242,6 +242,48 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the DESCRIPTION values. Write out the
+       // first DESCRPITION only as per RFC5545 specifcation.
+       
+       if (DescriptionList.size() > 0){
+               
+               DataLine += "DESCRIPTION";
+               
+               if (DescriptionListAltRep[0].size() > 0){
+               
+                       DataLine += ";ALTREP=\"";
+                       DataLine += DescriptionListAltRep[0];
+                       DataLine += "\"";
+                       
+               }
+               
+               if (DescriptionListLanguage[0].size() > 0){
+               
+                       DataLine += ";LANGUAGE=";
+                       DataLine += DescriptionListLanguage[0];
+                       
+               }
+               
+               if (DescriptionListTokens[0].size() > 0){
+               
+                       DataLine += ";";
+                       DataLine += DescriptionListTokens[0];
+                       
+               }
+
+               DataLine += ":";
+               DataLine += DescriptionList[0];
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+               
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
+       
        *SaveData += "END:VEVENT\n";
        
 }
\ No newline at end of file
index 41e07a8..ef5f60a 100644 (file)
@@ -80,6 +80,8 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        " y of the event.\n"
        "CLASS;CHOCOLATE=BAR:PUBLIC\n"
        "CREATED;CARAMEL=PLEASE:20160123T081100Z\n"
+       "DESCRIPTION;ALTREP=\"null:nodata\";LANGUAGE=kw;EXAMPLE=TOKEN;MOREDATA=YES:This \n"
+       " is a description of the event.\n"
        "END:VEVENT\n"
        "END:VCARD";
 
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