Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added VALARM:X-Token property for saving data from a CalendarEventObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 4 Jun 2016 23:48:32 +0000 (00:48 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 4 Jun 2016 23:48:32 +0000 (00:48 +0100)
Added the code and unit tests for the VALARM:X-Token property.

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

index f539944..89819dd 100644 (file)
@@ -1526,6 +1526,29 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                                
                        }
                        
+                       // Process the X-Token VALARM values.
+                       
+                       if (CalendarAlarmData[CalendarAlarmDataSeek].XTokensData.size() > 0){
+                               
+                               for (int XTokenSeek = 0; XTokenSeek < CalendarAlarmData[CalendarAlarmDataSeek].XTokensData.size();
+                                       XTokenSeek++){
+       
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].XTokensDataTokens[XTokenSeek];             
+                                       DataLine += ":";
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].XTokensData[XTokenSeek];
+                                       DataLine += "\n";
+               
+                                       DataLineProcessed = OutputText(&DataLine);
+               
+                                       *SaveData += DataLineProcessed;
+
+                                       DataLine.clear();
+                                       DataLineProcessed.clear();
+                                       
+                               }
+                               
+                       }
+                       
                        *SaveData += "END:VALARM\n";
                        
                }
index f2e4847..8f188ef 100644 (file)
@@ -142,6 +142,9 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        " l\n"
        "ATTACH;FMTTYPE=text/plain;VALUE=BINARY;ENCODING=BASE64;STUPID=EXAMPLE:VGhpcyB\n"
        " pcyBhbiBleGFtcGxlIGZpbGU=\n"
+       "X-EXAMPLE1;YAY=YES:Example Data 1\n"
+       "X-EXAMPLE2;NOPE=YEP:Example Data 2\n"
+       "X-EXAMPLE3;WORLD=NO:Example Data 3\n"
        "END:VALARM\n"
        "BEGIN:VALARM\n"
        "ACTION;FLASHING=LIGHTS:DISPLAY\n"
@@ -150,6 +153,9 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "DESCRIPTION;ALTREP=\"null:nodata\";LANGUAGE=kw;TERRIBLE=TOKEN:This is the secon\n"
        " d alarm.\n"
        "REPEAT;SLEEP=ALWAYS:PT3M\n"
+       "X-EXAMPLE1;YAY=YES:Example Data 1\n"
+       "X-EXAMPLE2;NOPE=YEP:Example Data 2\n"
+       "X-EXAMPLE3;WORLD=NO:Example Data 3\n"
        "END:VALARM\n"
        "BEGIN:VALARM\n"
        "ACTION;FLASHING=LIGHTS:EMAIL\n"
@@ -171,6 +177,9 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        " l\n"
        "ATTACH;FMTTYPE=text/plain;VALUE=BINARY;ENCODING=BASE64;STUPID=EXAMPLE:VGhpcyB\n"
        " pcyBhbiBleGFtcGxlIGZpbGU=\n"
+       "X-EXAMPLE1;YAY=YES:Example Data 1\n"
+       "X-EXAMPLE2;NOPE=YEP:Example Data 2\n"
+       "X-EXAMPLE3;WORLD=NO:Example Data 3\n"
        "END:VALARM\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