From ee8966cf22611d16244a4d728003c71feb53e205 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Thu, 2 Jun 2016 23:01:36 +0100 Subject: [PATCH] Added STATUS property for saving data from a CalendarEventObject. Added the code and unit tests for the STATUS property. --- .../calendarevent/CalendarEvent-Save.cpp | 33 +++++++++++++++++++ source/tests/xestiacalendar_icaleventsave.h | 1 + 2 files changed, 34 insertions(+) diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp index 432459a..c149557 100644 --- a/source/objects/calendarevent/CalendarEvent-Save.cpp +++ b/source/objects/calendarevent/CalendarEvent-Save.cpp @@ -489,6 +489,39 @@ void CalendarEventObject::SaveObjectData(string *SaveData){ } + // Process the STATUS value. + + if (StatusData.size() > 0){ + + DataLine += "STATUS"; + + if (StatusLanguage.size() > 0){ + + DataLine += ";LANGUAGE="; + DataLine += StatusLanguage; + + } + + if (StatusTokens.size() > 0){ + + DataLine += ";"; + DataLine += StatusTokens; + + } + + DataLine += ":"; + DataLine += StatusData; + 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 7cdfd69..0e92588 100644 --- a/source/tests/xestiacalendar_icaleventsave.h +++ b/source/tests/xestiacalendar_icaleventsave.h @@ -89,6 +89,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){ " eply@example.com\";LANGUAGE=kw;HAPPY=DAYS:mailto:organiser@example.com\n" "PRIORITY;STATUS=DEFAULT:5\n" "SEQUENCE;TEST=YAY:3\n" + "STATUS;LANGUAGE=kw;FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN:2.0;Success\n" "END:VEVENT\n" "END:VCARD"; -- 2.39.5