From: Steve Brokenshire Date: Sat, 4 Jun 2016 08:03:57 +0000 (+0100) Subject: Added RRULE property for saving data from a CalendarEventObject. X-Git-Tag: release-0.02~236 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=392148c686b83408416006ccd16bd499e8f95695;p=xestiacalendar%2F.git Added RRULE property for saving data from a CalendarEventObject. Added the code and unit tests for the RRULE property. --- diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp index e7d78d8..aee9093 100644 --- a/source/objects/calendarevent/CalendarEvent-Save.cpp +++ b/source/objects/calendarevent/CalendarEvent-Save.cpp @@ -621,6 +621,32 @@ void CalendarEventObject::SaveObjectData(string *SaveData){ } + // Process the RRULE value. + + if (RecurranceRuleData.size() > 0){ + + DataLine += "RRULE"; + + if (RecurranceRuleDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += RecurranceRuleDataTokens; + + } + + DataLine += ":"; + DataLine += RecurranceRuleData; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + *SaveData += "END:VEVENT\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaleventsave.h b/source/tests/xestiacalendar_icaleventsave.h index 8d19378..ccbb1ea 100644 --- a/source/tests/xestiacalendar_icaleventsave.h +++ b/source/tests/xestiacalendar_icaleventsave.h @@ -94,6 +94,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){ "URL;EXTERNAL=YES:http://www.example.com/\n" "RECURRENCE-ID;TZID=Europe/Truro;RANGE=THISANDFUTURE;VALUE=DATE;EXAMPLE=DATA:2\n" " 0160124\n" + "RRULE;TEST=DATA:FREQ=DAILY;COUNT=10\n" "END:VEVENT\n" "END:VCARD";