From: Steve Brokenshire Date: Thu, 2 Jun 2016 21:06:04 +0000 (+0100) Subject: Added LOCATION property for saving data from a CalendarEventObject. X-Git-Tag: release-0.02~244 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=2f59db5effef27ce057160796deb1f70f1817cd7;p=xestiacalendar%2F.git Added LOCATION property for saving data from a CalendarEventObject. Added the code and unit tests for the LOCATION property. --- diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp index a5afcd5..8f28931 100644 --- a/source/objects/calendarevent/CalendarEvent-Save.cpp +++ b/source/objects/calendarevent/CalendarEvent-Save.cpp @@ -340,6 +340,47 @@ void CalendarEventObject::SaveObjectData(string *SaveData){ } + // Process the LOCATION value. + + if (LocationData.size() > 0){ + + DataLine += "LOCATION"; + + if (LocationDataAltRep.size() > 0){ + + DataLine += ";ALTREP=\""; + DataLine += LocationDataAltRep; + DataLine += "\""; + + } + + if (LocationDataLanguage.size() > 0){ + + DataLine += ";LANGUAGE="; + DataLine += LocationDataLanguage; + + } + + if (LocationDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += LocationDataTokens; + + } + + DataLine += ":"; + DataLine += LocationData; + 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 dcb07be..b6c7576 100644 --- a/source/tests/xestiacalendar_icaleventsave.h +++ b/source/tests/xestiacalendar_icaleventsave.h @@ -84,6 +84,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){ " is a description of the event.\n" "GEO;EXAMPLE=MEEP:5.0;5.0\n" "LAST-MODIFIED;FUTURE=ODD:20160124T093000Z\n" + "LOCATION;ALTREP=\"null:nodata\";LANGUAGE=kw;EXACT=NO:The Basement, Truro\n" "END:VEVENT\n" "END:VCARD";