From 7c145c75e8142fcebe87ed35ce2a84e716c4091e Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 31 Jan 2016 12:27:38 +0000 Subject: [PATCH] Added code to process SEQUENCE and STATUS in CalendarTaskObject. --- source/objects/calendartask/CalendarTask.cpp | 70 ++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/source/objects/calendartask/CalendarTask.cpp b/source/objects/calendartask/CalendarTask.cpp index 79742f3..3fa4a3d 100644 --- a/source/objects/calendartask/CalendarTask.cpp +++ b/source/objects/calendartask/CalendarTask.cpp @@ -581,4 +581,74 @@ void CalendarTaskObject::ProcessData(){ } + // Process the data from SEQUENCE. + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "SEQUENCE"); + + if (DataReceived.begin() != DataReceived.end()){ + + try { + SequenceTokens = DataReceived.begin()->first.substr(9); + } + + catch(const out_of_range &oor){ + // Do nothing as there is no data. + } + + try { + SequenceData = stoi(DataReceived.begin()->second); + } + + catch(const invalid_argument &oor){ + SequenceTokens.clear(); + } + + } + + // Process the data from STATUS. + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "STATUS"); + + 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 == "LANGUAGE"){ + + StatusLanguage = iter->second; + + } else { + + if (TokenData == false){ + TokenData = true; + } else { + PropertyTokens += ";"; + } + + PropertyTokens += iter->first; + PropertyTokens += "="; + PropertyTokens += iter->second; + + } + + } + + if (PropertyTokens.size() > 0){ + + StatusTokens = PropertyTokens; + + } + + StatusData = DataReceived.begin()->second; + + } + } \ No newline at end of file -- 2.39.5