From: Steve Brokenshire Date: Sun, 31 Jan 2016 15:12:01 +0000 (+0000) Subject: Added code to process the CATEGORIES and COMMENT property in CalendarJournalObject. X-Git-Tag: release-0.02~462 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=8bb9c7d34a5cda4f01ff12da284976b2d9ff5bae;p=xestiacalendar%2F.git Added code to process the CATEGORIES and COMMENT property in CalendarJournalObject. --- diff --git a/source/objects/calendarjournal/CalendarJournal.cpp b/source/objects/calendarjournal/CalendarJournal.cpp index 6f87e50..2aa9857 100644 --- a/source/objects/calendarjournal/CalendarJournal.cpp +++ b/source/objects/calendarjournal/CalendarJournal.cpp @@ -705,4 +705,117 @@ void CalendarJournalObject::ProcessData(){ } + // Process the data from CATEGORIES. + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "CATEGORIES"); + + ObjectSeekCount = 0; + + for(multimap::iterator iter = DataReceived.begin(); + iter != DataReceived.end(); + ++iter){ + + CategoriesListTokens.push_back(""); + CategoriesListLanguage.push_back(""); + CategoriesList.push_back(""); + + bool TokenData = false; + string PropertyTokens; + + PropertyNameData = (string*)&iter->first; + + PropertyData = SplitValues(*PropertyNameData); + + for(map::iterator dataiter = PropertyData.begin(); + dataiter != PropertyData.end(); dataiter++){ + + if (dataiter->first == "LANGUAGE"){ + + CategoriesListLanguage[ObjectSeekCount] = dataiter->second; + + } else { + + if (TokenData == false){ + TokenData = true; + } else { + PropertyTokens += ";"; + } + + PropertyTokens += dataiter->first; + PropertyTokens += "="; + PropertyTokens += dataiter->second; + + } + + } + + if (PropertyTokens.size() > 0){ + CategoriesListTokens[ObjectSeekCount] = PropertyTokens; + } + + CategoriesList[ObjectSeekCount] = iter->second; + + ObjectSeekCount++; + + } + + // Process the data from COMMENT. + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "COMMENT"); + + ObjectSeekCount = 0; + + for(multimap::iterator iter = DataReceived.begin(); + iter != DataReceived.end(); + ++iter){ + + CommentListTokens.push_back(""); + CommentListAltRep.push_back(""); + CommentListLanguage.push_back(""); + CommentList.push_back(""); + + bool TokenData = false; + string PropertyTokens; + + PropertyNameData = (string*)&iter->first; + + PropertyData = SplitValues(*PropertyNameData); + + for(map::iterator dataiter = PropertyData.begin(); + dataiter != PropertyData.end(); dataiter++){ + + if (dataiter->first == "ALTREP"){ + + CommentListAltRep[ObjectSeekCount] = dataiter->second; + + } else if (dataiter->first == "LANGUAGE"){ + + CommentListLanguage[ObjectSeekCount] = dataiter->second; + + } else { + + if (TokenData == false){ + TokenData = true; + } else { + PropertyTokens += ";"; + } + + PropertyTokens += dataiter->first; + PropertyTokens += "="; + PropertyTokens += dataiter->second; + + } + + } + + if (PropertyTokens.size() > 0){ + CommentListTokens[ObjectSeekCount] = PropertyTokens; + } + + CommentList[ObjectSeekCount] = iter->second; + + ObjectSeekCount++; + + } + } \ No newline at end of file