From: Steve Brokenshire Date: Sun, 5 Jun 2016 23:02:57 +0000 (+0100) Subject: Added RDATE property for saving data from a CalendarJournalObject. X-Git-Tag: release-0.02~178 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=81abf41fcbbd5290d609ac2109172607118390ad;p=xestiacalendar%2F.git Added RDATE property for saving data from a CalendarJournalObject. Added the code and unit tests for the RDATE property. --- diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index 05025de..b347e0b 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -839,6 +839,50 @@ void CalendarJournalObject::SaveObjectData(string *SaveData){ } + // Process the RDATE value. + + if (RecurranceDateData.size() > 0){ + + for (int RecurranceDateDataSeek = 0; RecurranceDateDataSeek < RecurranceDateData.size(); + RecurranceDateDataSeek++){ + + DataLine += "RDATE"; + + if (RecurranceDateDataValue[RecurranceDateDataSeek].size() > 0){ + + DataLine += ";VALUE="; + DataLine += RecurranceDateDataValue[RecurranceDateDataSeek]; + + } + + if (RecurranceDateDataTimeZoneParam[RecurranceDateDataSeek].size() > 0){ + + DataLine += ";TZID="; + DataLine += RecurranceDateDataTimeZoneParam[RecurranceDateDataSeek]; + + } + + if (RecurranceDateDataTokens[RecurranceDateDataSeek].size() > 0){ + + DataLine += ";"; + DataLine += RecurranceDateDataTokens[RecurranceDateDataSeek]; + + } + + DataLine += ":"; + DataLine += RecurranceDateData[RecurranceDateDataSeek]; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + + } *SaveData += "END:VJOURNAL\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaljournalsave.h b/source/tests/xestiacalendar_icaljournalsave.h index ccf7008..835d995 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -110,6 +110,9 @@ TEST(iCalendarSaveJournal, SaveEventTests){ "RELATED-TO:person.1@example.com\n" "RELATED-TO;RELTYPE=PARENT:person.2@example.com\n" "RELATED-TO;SCHOOL=MEETING:person.3@example.com\n" + "RDATE:20160120\n" + "RDATE;VALUE=DATE;TZID=Europe/Truro:20160121\n" + "RDATE;ZILCH=DATA:20160520\n" "END:VJOURNAL\n" "END:VCALENDAR";