From ebf4a33fa2b816e8b0361c001dccb3079bd5708b Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sat, 23 Jan 2016 22:08:32 +0000 Subject: [PATCH] Added code for processing DTSTART in CalendarEventObject::ProcessData --- .../objects/calendarevent/CalendarEvent.cpp | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/source/objects/calendarevent/CalendarEvent.cpp b/source/objects/calendarevent/CalendarEvent.cpp index f737cc1..372ffb1 100644 --- a/source/objects/calendarevent/CalendarEvent.cpp +++ b/source/objects/calendarevent/CalendarEvent.cpp @@ -178,6 +178,8 @@ void CalendarEventObject::ProcessData(){ // Process the data. multimap DataReceived; + map PropertyData; + string *PropertyNameData = nullptr; // Get the Date Time Stamp (DTSTAMP). @@ -219,4 +221,54 @@ void CalendarEventObject::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; + + } + } -- 2.39.5