From 2fa80b58ada02ff544438efa8385affcaf675007 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 24 Jan 2016 09:22:12 +0000 Subject: [PATCH] Added code to process DESCRIPTION and GEO in CalendarEventObject. --- .../objects/calendarevent/CalendarEvent.cpp | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/source/objects/calendarevent/CalendarEvent.cpp b/source/objects/calendarevent/CalendarEvent.cpp index b35f7c1..823edce 100644 --- a/source/objects/calendarevent/CalendarEvent.cpp +++ b/source/objects/calendarevent/CalendarEvent.cpp @@ -307,4 +307,74 @@ void CalendarEventObject::ProcessData(){ } + // Process the data from DESCRIPTION. + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DESCRIPTION"); + + 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 == "ALTREP"){ + + DescriptionListAltRep.clear(); + DescriptionListAltRep.push_back(iter->second); + + } else if (iter->first == "LANGUAGE"){ + + DescriptionListLanguage.clear(); + DescriptionListLanguage.push_back(iter->second); + + } else { + + if (TokenData == false){ + TokenData = true; + } else { + PropertyTokens += ";"; + } + + PropertyTokens += iter->first; + PropertyTokens += "="; + PropertyTokens += iter->second; + + } + + } + + if (PropertyTokens.size() > 0){ + DescriptionListTokens.clear(); + DescriptionListTokens.push_back(PropertyTokens); + } + + DescriptionList.clear(); + DescriptionList.push_back(DataReceived.begin()->second); + + } + + // Process the data from GEO. + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "GEO"); + + if (DataReceived.begin() != DataReceived.end()){ + + try { + GeographicTokens = DataReceived.begin()->first.substr(4); + } + + catch(const out_of_range &oor){ + // Do nothing as there is no data. + } + + GeographicData = DataReceived.begin()->second; + + } + } -- 2.39.5