X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;ds=inline;f=source%2Fobjects%2Fcalendarjournal%2FCalendarJournal.cpp;h=beb9755430aa013f6d4ae70c4257ec7ae1f23997;hb=1d8f15480f6e7e66bf66bcaa9ce58bed9dee8ee7;hp=2aa98574fdd521468901fbcbe2d849be13dc7c11;hpb=8bb9c7d34a5cda4f01ff12da284976b2d9ff5bae;p=xestiacalendar%2F.git
diff --git a/source/objects/calendarjournal/CalendarJournal.cpp b/source/objects/calendarjournal/CalendarJournal.cpp
index 2aa9857..beb9755 100644
--- a/source/objects/calendarjournal/CalendarJournal.cpp
+++ b/source/objects/calendarjournal/CalendarJournal.cpp
@@ -1,3 +1,21 @@
+// CalendarJournal.cpp - CalendarJournal class functions
+//
+// (c) 2016-2017 Xestia Software Development.
+//
+// This file is part of Xestia Calendar.
+//
+// Xestia Calendar is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Calendar is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Calendar. If not, see
+
#include "CalendarJournal.h"
using namespace std;
@@ -818,4 +836,370 @@ void CalendarJournalObject::ProcessData(){
}
+ // Process the data from CONTACT.
+
+ DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "CONTACT");
+
+ ObjectSeekCount = 0;
+
+ for(multimap::iterator iter = DataReceived.begin();
+ iter != DataReceived.end();
+ ++iter){
+
+ ContactListTokens.push_back("");
+ ContactListAltRep.push_back("");
+ ContactListLanguage.push_back("");
+ ContactList.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"){
+
+ ContactListAltRep[ObjectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "LANGUAGE"){
+
+ ContactListLanguage[ObjectSeekCount] = dataiter->second;
+
+ } else {
+
+ if (TokenData == false){
+ TokenData = true;
+ } else {
+ PropertyTokens += ";";
+ }
+
+ PropertyTokens += dataiter->first;
+ PropertyTokens += "=";
+ PropertyTokens += dataiter->second;
+
+ }
+
+ }
+
+ if (PropertyTokens.size() > 0){
+ ContactListTokens[ObjectSeekCount] = PropertyTokens;
+ }
+
+ ContactList[ObjectSeekCount] = iter->second;
+
+ ObjectSeekCount++;
+
+ }
+
+ // Process the data from Description.
+
+ DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "DESCRIPTION");
+
+ ObjectSeekCount = 0;
+
+ for(multimap::iterator iter = DataReceived.begin();
+ iter != DataReceived.end();
+ ++iter){
+
+ DescriptionListTokens.push_back("");
+ DescriptionListAltRep.push_back("");
+ DescriptionListLanguage.push_back("");
+ DescriptionList.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"){
+
+ DescriptionListAltRep[ObjectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "LANGUAGE"){
+
+ DescriptionListLanguage[ObjectSeekCount] = dataiter->second;
+
+ } else {
+
+ if (TokenData == false){
+ TokenData = true;
+ } else {
+ PropertyTokens += ";";
+ }
+
+ PropertyTokens += dataiter->first;
+ PropertyTokens += "=";
+ PropertyTokens += dataiter->second;
+
+ }
+
+ }
+
+ if (PropertyTokens.size() > 0){
+ DescriptionListTokens[ObjectSeekCount] = PropertyTokens;
+ }
+
+ DescriptionList[ObjectSeekCount] = iter->second;
+
+ ObjectSeekCount++;
+
+ }
+
+ // Process the data from EXDATE.
+
+ DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "EXDATE");
+
+ ObjectSeekCount = 0;
+
+ for(multimap::iterator iter = DataReceived.begin();
+ iter != DataReceived.end();
+ ++iter){
+
+ ExcludeDateDataTokens.push_back("");
+ ExcludeDateDataValue.push_back("");
+ ExcludeDateDataTimeZoneParam.push_back("");
+ ExcludeDateData.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 == "VALUE"){
+
+ ExcludeDateDataValue[ObjectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "TZID"){
+
+ ExcludeDateDataTimeZoneParam[ObjectSeekCount] = dataiter->second;
+
+ } else {
+
+ if (TokenData == false){
+ TokenData = true;
+ } else {
+ PropertyTokens += ";";
+ }
+
+ PropertyTokens += dataiter->first;
+ PropertyTokens += "=";
+ PropertyTokens += dataiter->second;
+
+ }
+
+ }
+
+ if (PropertyTokens.size() > 0){
+ ExcludeDateDataTokens[ObjectSeekCount] = PropertyTokens;
+ }
+
+ ExcludeDateData[ObjectSeekCount] = iter->second;
+
+ ObjectSeekCount++;
+
+ }
+
+ // Process the data from RELATED-TO.
+
+ DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "RELATED-TO");
+
+ ObjectSeekCount = 0;
+
+ for(multimap::iterator iter = DataReceived.begin();
+ iter != DataReceived.end();
+ ++iter){
+
+ RelatedToDataTokens.push_back("");
+ RelatedToDataRelationType.push_back("");
+ RelatedToData.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 == "RELTYPE"){
+
+ RelatedToDataRelationType[ObjectSeekCount] = dataiter->second;
+
+ } else {
+
+ if (TokenData == false){
+ TokenData = true;
+ } else {
+ PropertyTokens += ";";
+ }
+
+ PropertyTokens += dataiter->first;
+ PropertyTokens += "=";
+ PropertyTokens += dataiter->second;
+
+ }
+
+ }
+
+ if (PropertyTokens.size() > 0){
+ RelatedToDataTokens[ObjectSeekCount] = PropertyTokens;
+ }
+
+ RelatedToData[ObjectSeekCount] = iter->second;
+
+ ObjectSeekCount++;
+
+ }
+
+ // Process the data from RDATE.
+
+ DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "RDATE");
+
+ ObjectSeekCount = 0;
+
+ for(multimap::iterator iter = DataReceived.begin();
+ iter != DataReceived.end();
+ ++iter){
+
+ RecurranceDateDataTokens.push_back("");
+ RecurranceDateDataValue.push_back("");
+ RecurranceDateDataTimeZoneParam.push_back("");
+ RecurranceDateData.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 == "VALUE"){
+
+ RecurranceDateDataValue[ObjectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "TZID"){
+
+ RecurranceDateDataTimeZoneParam[ObjectSeekCount] = dataiter->second;
+
+ } else {
+
+ if (TokenData == false){
+ TokenData = true;
+ } else {
+ PropertyTokens += ";";
+ }
+
+ PropertyTokens += dataiter->first;
+ PropertyTokens += "=";
+ PropertyTokens += dataiter->second;
+
+ }
+
+ }
+
+ if (PropertyTokens.size() > 0){
+ RecurranceDateDataTokens[ObjectSeekCount] = PropertyTokens;
+ }
+
+ RecurranceDateData[ObjectSeekCount] = iter->second;
+
+ ObjectSeekCount++;
+
+ }
+
+ // Process the data from REQUEST-STATUS.
+
+ DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "REQUEST-STATUS");
+
+ ObjectSeekCount = 0;
+
+ for(multimap::iterator iter = DataReceived.begin();
+ iter != DataReceived.end();
+ ++iter){
+
+ RequestStatusTokens.push_back("");
+ RequestStatusLanguage.push_back("");
+ RequestStatusData.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"){
+
+ RequestStatusLanguage[ObjectSeekCount] = dataiter->second;
+
+ } else {
+
+ if (TokenData == false){
+ TokenData = true;
+ } else {
+ PropertyTokens += ";";
+ }
+
+ PropertyTokens += dataiter->first;
+ PropertyTokens += "=";
+ PropertyTokens += dataiter->second;
+
+ }
+
+ }
+
+ if (PropertyTokens.size() > 0){
+ RequestStatusTokens[ObjectSeekCount] = PropertyTokens;
+ }
+
+ RequestStatusData[ObjectSeekCount] = iter->second;
+
+ ObjectSeekCount++;
+
+ }
+
+ ObjectSeekCount = 0;
+
+ // Process data from X-*
+
+ for(vector::iterator iter = ObjectName.begin();
+ iter != ObjectName.end(); ++iter){
+
+ bool TokenData = false;
+ string PropertyTokens;
+
+ if (iter->substr(0,2) == "X-" &&
+ iter->size() > 2){
+
+ XTokensData.push_back(ObjectData[ObjectSeekCount]);
+ XTokensDataTokens.push_back(ObjectName[ObjectSeekCount]);
+
+ }
+
+ ObjectSeekCount++;
+
+ }
+
}
\ No newline at end of file