From 53ea51ea7ea1852fd1c57977867c112aeaa6ae68 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 31 Jan 2016 14:38:40 +0000 Subject: [PATCH] Added code to process the LAST-MODIFIED property in CalendarJournalObject. --- .../calendarjournal/CalendarJournal.cpp | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/source/objects/calendarjournal/CalendarJournal.cpp b/source/objects/calendarjournal/CalendarJournal.cpp index 3e08b8a..71d2727 100644 --- a/source/objects/calendarjournal/CalendarJournal.cpp +++ b/source/objects/calendarjournal/CalendarJournal.cpp @@ -203,4 +203,72 @@ void CalendarJournalObject::ProcessData(){ } + // Get the Date Time Start value. + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DTSTART"); + + // Process the data from DTSTART. + + if (DataReceived.begin() != DataReceived.end()){ + + bool TokenData = false; + string PropertyTokens; + + PropertyNameData = (string*)&DataReceived.begin()->first; + + PropertyData = SplitValues(*PropertyNameData); + + for(map::iterator iter = PropertyData.begin(); + iter != PropertyData.end(); iter++){ + + if (iter->first == "VALUE"){ + + DateTimeStartDataValue = iter->second; + + } else if (iter->first == "TZID"){ + + DateTimeStartDataTimeZoneID = iter->second; + + } else { + + if (TokenData == false){ + TokenData = true; + } else { + PropertyTokens += ";"; + } + + PropertyTokens += iter->first; + PropertyTokens += "="; + PropertyTokens += iter->second; + + } + + } + + if (PropertyTokens.size() > 0){ + DateTimeStartDataTokens = PropertyTokens; + } + + DateTimeStartData = DataReceived.begin()->second; + + } + + // Process the data from LAST-MODIFIED. + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "LAST-MODIFIED"); + + if (DataReceived.begin() != DataReceived.end()){ + + try { + LastModifiedTokens = DataReceived.begin()->first.substr(14); + } + + catch(const out_of_range &oor){ + // Do nothing as there is no data. + } + + LastModifiedData = DataReceived.begin()->second; + + } + } \ No newline at end of file -- 2.39.2