From 392148c686b83408416006ccd16bd499e8f95695 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sat, 4 Jun 2016 09:03:57 +0100 Subject: [PATCH] Added RRULE property for saving data from a CalendarEventObject. Added the code and unit tests for the RRULE property. --- .../calendarevent/CalendarEvent-Save.cpp | 26 +++++++++++++++++++ source/tests/xestiacalendar_icaleventsave.h | 1 + 2 files changed, 27 insertions(+) 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"; -- 2.39.5