X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fobjects%2Fcalendarjournal%2FCalendarJournal.cpp;h=d8201dc0f8553eea150a8af6fc978dc98375cf78;hb=0391d3b44ed7d1eb889385674238e4a81c8a32e4;hp=f3c66c765c464b9acd643974dc98c2ff2b0b3d08;hpb=4e0fe0815e5733fab35e33cabd4f9ef10c997969;p=xestiacalendar%2F.git diff --git a/source/objects/calendarjournal/CalendarJournal.cpp b/source/objects/calendarjournal/CalendarJournal.cpp index f3c66c7..d8201dc 100644 --- a/source/objects/calendarjournal/CalendarJournal.cpp +++ b/source/objects/calendarjournal/CalendarJournal.cpp @@ -144,5 +144,181 @@ void CalendarJournalObject::ProcessData(){ map PropertyData; string *PropertyNameData = nullptr; int ObjectSeekCount = 0; + + // Get the Date Time Stamp (DTSTAMP). + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DTSTAMP"); + + // Process the data from DTSTAMP. + + if (DataReceived.begin() != DataReceived.end()){ + + try { + DateTimeStampTokens = DataReceived.begin()->first.substr(8); + } + + catch(const out_of_range &oor){ + // Do nothing as there is no data. + } + + DateTimeStampData = DataReceived.begin()->second; + + } + + // Get the Unique ID (UID). + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "UID"); + + // Process the data from UID. + + if (DataReceived.begin() != DataReceived.end()){ + + try { + UniqueIDTokens = DataReceived.begin()->first.substr(4); + } + + catch(const out_of_range &oor){ + // Do nothing as there is no data. + } + + UniqueID = DataReceived.begin()->second; + + } + + // Process the data from CLASS. + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "CLASS"); + + if (DataReceived.begin() != DataReceived.end()){ + + try { + ClassDataTokens = DataReceived.begin()->first.substr(6); + } + + catch(const out_of_range &oor){ + // Do nothing as there is no data. + } + + ClassData = DataReceived.begin()->second; + + } + + // 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; + + } + + // Process the data from LOCATION. + + DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "LOCATION"); + + 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"){ + + LocationDataAltRep = iter->second; + + } else if (iter->first == "LANGUAGE"){ + + LocationDataLanguage = iter->second; + + } else { + + if (TokenData == false){ + TokenData = true; + } else { + PropertyTokens += ";"; + } + + PropertyTokens += iter->first; + PropertyTokens += "="; + PropertyTokens += iter->second; + + } + + } + + if (PropertyTokens.size() > 0){ + + LocationDataTokens = PropertyTokens; + + } + + LocationData = DataReceived.begin()->second; + + } } \ No newline at end of file