X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;ds=inline;f=source%2Fobjects%2Fcalendarevent%2FCalendarEvent.cpp;h=339012af2ac192b3700758cc22ca46e632ece5ff;hb=refs%2Ftags%2Frelease-0.02;hp=1d762ebae46e63edd895bccd5df08f65243d0a82;hpb=9bb46ebb7c0bf80597f677b59ae057526f0cec13;p=xestiacalendar%2F.git
diff --git a/source/objects/calendarevent/CalendarEvent.cpp b/source/objects/calendarevent/CalendarEvent.cpp
index 1d762eb..339012a 100644
--- a/source/objects/calendarevent/CalendarEvent.cpp
+++ b/source/objects/calendarevent/CalendarEvent.cpp
@@ -1,167 +1,185 @@
+// CalendarEvent.cpp - CalendarEventObject 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 "CalendarEvent.h"
using namespace std;
CalendarObjectValidResult CalendarEventObject::ValidObject(){
- bool ValidBegin = false;
- bool ValidEnd = false;
- bool ValidDateTimeStamp = false;
- bool ValidUniqueID = false;
- bool ValidDateTimeStart = false;
- int SeekCount = 0;
- string PropertyName;
+ bool validBegin = false;
+ bool validEnd = false;
+ bool validDateTimeStamp = false;
+ bool validUniqueID = false;
+ bool validDateTimeStart = false;
+ int seekCount = 0;
+ string propertyName;
// Look for BEGIN:VEVENT.
- for (vector::iterator iter = ObjectName.begin();
- iter != ObjectName.end(); iter++){
+ for (vector::iterator iter = objectName.begin();
+ iter != objectName.end(); iter++){
- if (ObjectName[SeekCount] == "BEGIN" &&
- ObjectData[SeekCount] == "VEVENT"){
+ if (objectName[seekCount] == "BEGIN" &&
+ objectData[seekCount] == "VEVENT"){
- if (ValidBegin == false){
- ValidBegin = true;
+ if (validBegin == false){
+ validBegin = true;
} else {
return CALENDAROBJECTVALID_INVALIDFORMAT;
}
}
- if (ObjectName[SeekCount] == "END" &&
- ObjectData[SeekCount] == "VEVENT" &&
- ValidBegin == false){
+ if (objectName[seekCount] == "END" &&
+ objectData[seekCount] == "VEVENT" &&
+ validBegin == false){
return CALENDAROBJECTVALID_INVALIDFORMAT;
}
- SeekCount++;
+ seekCount++;
}
- SeekCount = 0;
+ seekCount = 0;
// Look for DTSTAMP.
- for (vector::iterator iter = ObjectName.begin();
- iter != ObjectName.end(); iter++){
+ for (vector::iterator iter = objectName.begin();
+ iter != objectName.end(); iter++){
try{
- PropertyName = ObjectName[SeekCount].substr(0,7);
+ propertyName = objectName[seekCount].substr(0,7);
}
catch(const out_of_range& oor){
continue;
}
- if (PropertyName == "DTSTAMP"){
+ if (propertyName == "DTSTAMP"){
- if (ValidDateTimeStamp == false){
- ValidDateTimeStamp = true;
+ if (validDateTimeStamp == false){
+ validDateTimeStamp = true;
} else {
return CALENDAROBJECTVALID_INVALIDFORMAT;
}
}
- SeekCount++;
+ seekCount++;
}
- SeekCount = 0;
+ seekCount = 0;
// Look for UID.
- for (vector::iterator iter = ObjectName.begin();
- iter != ObjectName.end(); iter++){
+ for (vector::iterator iter = objectName.begin();
+ iter != objectName.end(); iter++){
try{
- PropertyName = ObjectName[SeekCount].substr(0,3);
+ propertyName = objectName[seekCount].substr(0,3);
}
catch(const out_of_range& oor){
continue;
}
- if (PropertyName == "UID"){
+ if (propertyName == "UID"){
- if (ValidUniqueID == false){
- ValidUniqueID = true;
+ if (validUniqueID == false){
+ validUniqueID = true;
} else {
return CALENDAROBJECTVALID_INVALIDFORMAT;
}
}
- SeekCount++;
+ seekCount++;
}
- SeekCount = 0;
+ seekCount = 0;
// Look for DTSTART if nothing is set for METHOD..
- if (MethodData.size() == 0){
+ if (methodData.size() == 0){
- for (vector::iterator iter = ObjectName.begin();
- iter != ObjectName.end(); iter++){
+ for (vector::iterator iter = objectName.begin();
+ iter != objectName.end(); iter++){
try{
- PropertyName = ObjectName[SeekCount].substr(0,7);
+ propertyName = objectName[seekCount].substr(0,7);
}
catch(const out_of_range& oor){
continue;
}
- if (PropertyName == "DTSTART"){
+ if (propertyName == "DTSTART"){
- if (ValidDateTimeStart == false){
- ValidDateTimeStart = true;
+ if (validDateTimeStart == false){
+ validDateTimeStart = true;
} else {
return CALENDAROBJECTVALID_INVALIDFORMAT;
}
}
- SeekCount++;
+ seekCount++;
}
} else {
- ValidDateTimeStart = true;
+ validDateTimeStart = true;
}
- SeekCount = 0;
+ seekCount = 0;
// Look for END:VEVENT.
- for (vector::iterator iter = ObjectName.begin();
- iter != ObjectName.end(); iter++){
+ for (vector::iterator iter = objectName.begin();
+ iter != objectName.end(); iter++){
- if (ObjectName[SeekCount] == "END" &&
- ObjectData[SeekCount] == "VEVENT"){
+ if (objectName[seekCount] == "END" &&
+ objectData[seekCount] == "VEVENT"){
- if (ValidEnd == false){
- ValidEnd = true;
+ if (validEnd == false){
+ validEnd = true;
} else {
return CALENDAROBJECTVALID_INVALIDFORMAT;
}
}
- SeekCount++;
+ seekCount++;
}
// Check if the VEVENT is valid.
-
- if (ValidBegin == true &&
- ValidEnd == true &&
- ValidDateTimeStamp == true &&
- ValidDateTimeStart == true &&
- ValidUniqueID == true){
+
+ if (validBegin == true &&
+ validEnd == true &&
+ validDateTimeStamp == true &&
+ validDateTimeStart == true &&
+ validUniqueID == true){
return CALENDAROBJECTVALID_OK;
@@ -177,341 +195,341 @@ void CalendarEventObject::ProcessData(){
// Process the data.
- multimap DataReceived;
- map PropertyData;
- string *PropertyNameData = nullptr;
- int ObjectSeekCount = 0;
+ multimap dataReceived;
+ map propertyData;
+ string *propertyNameData = nullptr;
+ int objectSeekCount = 0;
// Get the Date Time Stamp (DTSTAMP).
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DTSTAMP");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "DTSTAMP");
// Process the data from DTSTAMP.
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
try {
- DateTimeStampTokens = DataReceived.begin()->first.substr(8);
+ dateTimeStampTokens = dataReceived.begin()->first.substr(8);
}
catch(const out_of_range &oor){
// Do nothing as there is no data.
}
- DateTimeStampData = DataReceived.begin()->second;
+ dateTimeStampData = dataReceived.begin()->second;
}
// Get the Unique ID (UID).
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "UID");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "UID");
// Process the data from UID.
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
try {
- UniqueIDTokens = DataReceived.begin()->first.substr(4);
+ uniqueIDTokens = dataReceived.begin()->first.substr(4);
}
catch(const out_of_range &oor){
// Do nothing as there is no data.
}
- UniqueID = DataReceived.begin()->second;
+ uniqueID = dataReceived.begin()->second;
}
// Get the Date Time Start value.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DTSTART");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "DTSTART");
// Process the data from DTSTART.
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
- bool TokenData = false;
- string PropertyTokens;
+ bool tokenData = false;
+ string propertyTokens;
- PropertyNameData = (string*)&DataReceived.begin()->first;
+ propertyNameData = (string*)&dataReceived.begin()->first;
- PropertyData = SplitValues(*PropertyNameData);
+ propertyData = SplitValues(*propertyNameData);
- for(map::iterator iter = PropertyData.begin();
- iter != PropertyData.end(); iter++){
+ for(map::iterator iter = propertyData.begin();
+ iter != propertyData.end(); iter++){
if (iter->first == "VALUE"){
- DateTimeStartDataValue = iter->second;
+ dateTimeStartDataValue = iter->second;
} else if (iter->first == "TZID"){
- DateTimeStartDataTimeZoneID = iter->second;
+ dateTimeStartDataTimeZoneID = iter->second;
} else {
- if (TokenData == false){
- TokenData = true;
+ if (tokenData == false){
+ tokenData = true;
} else {
- PropertyTokens += ";";
+ propertyTokens += ";";
}
- PropertyTokens += iter->first;
- PropertyTokens += "=";
- PropertyTokens += iter->second;
+ propertyTokens += iter->first;
+ propertyTokens += "=";
+ propertyTokens += iter->second;
}
}
- if (PropertyTokens.size() > 0){
- DateTimeStartDataTokens = PropertyTokens;
+ if (propertyTokens.size() > 0){
+ dateTimeStartDataTokens = propertyTokens;
}
- DateTimeStartData = DataReceived.begin()->second;
+ dateTimeStartData = dataReceived.begin()->second;
}
// Process the data from CLASS.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "CLASS");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "CLASS");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
try {
- ClassDataTokens = DataReceived.begin()->first.substr(6);
+ classDataTokens = dataReceived.begin()->first.substr(6);
}
catch(const out_of_range &oor){
// Do nothing as there is no data.
}
- ClassData = DataReceived.begin()->second;
+ classData = dataReceived.begin()->second;
}
// Process the data from CREATED.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "CREATED");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "CREATED");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
try {
- DateTimeCreatedTokens = DataReceived.begin()->first.substr(8);
+ dateTimeCreatedTokens = dataReceived.begin()->first.substr(8);
}
catch(const out_of_range &oor){
// Do nothing as there is no data.
}
- DateTimeCreatedData = DataReceived.begin()->second;
+ dateTimeCreatedData = dataReceived.begin()->second;
}
// Process the data from DESCRIPTION.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DESCRIPTION");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "DESCRIPTION");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
- bool TokenData = false;
- string PropertyTokens;
+ bool tokenData = false;
+ string propertyTokens;
- PropertyNameData = (string*)&DataReceived.begin()->first;
+ propertyNameData = (string*)&dataReceived.begin()->first;
- PropertyData = SplitValues(*PropertyNameData);
+ propertyData = SplitValues(*propertyNameData);
- for(map::iterator iter = PropertyData.begin();
- iter != PropertyData.end(); iter++){
+ for(map::iterator iter = propertyData.begin();
+ iter != propertyData.end(); iter++){
if (iter->first == "ALTREP"){
- DescriptionListAltRep.clear();
- DescriptionListAltRep.push_back(iter->second);
+ descriptionListAltRep.clear();
+ descriptionListAltRep.push_back(iter->second);
} else if (iter->first == "LANGUAGE"){
- DescriptionListLanguage.clear();
- DescriptionListLanguage.push_back(iter->second);
+ descriptionListLanguage.clear();
+ descriptionListLanguage.push_back(iter->second);
} else {
- if (TokenData == false){
- TokenData = true;
+ if (tokenData == false){
+ tokenData = true;
} else {
- PropertyTokens += ";";
+ propertyTokens += ";";
}
- PropertyTokens += iter->first;
- PropertyTokens += "=";
- PropertyTokens += iter->second;
+ propertyTokens += iter->first;
+ propertyTokens += "=";
+ propertyTokens += iter->second;
}
}
- if (PropertyTokens.size() > 0){
- DescriptionListTokens.clear();
- DescriptionListTokens.push_back(PropertyTokens);
+ if (propertyTokens.size() > 0){
+ descriptionListTokens.clear();
+ descriptionListTokens.push_back(propertyTokens);
}
- DescriptionList.clear();
- DescriptionList.push_back(DataReceived.begin()->second);
+ descriptionList.clear();
+ descriptionList.push_back(dataReceived.begin()->second);
}
// Process the data from GEO.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "GEO");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "GEO");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
try {
- GeographicTokens = DataReceived.begin()->first.substr(4);
+ geographicTokens = dataReceived.begin()->first.substr(4);
}
catch(const out_of_range &oor){
// Do nothing as there is no data.
}
- GeographicData = DataReceived.begin()->second;
+ geographicData = dataReceived.begin()->second;
}
// Process the data from LAST-MODIFIED.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "LAST-MODIFIED");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "LAST-MODIFIED");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
try {
- LastModifiedTokens = DataReceived.begin()->first.substr(14);
+ lastModifiedTokens = dataReceived.begin()->first.substr(14);
}
catch(const out_of_range &oor){
// Do nothing as there is no data.
}
- LastModifiedData = DataReceived.begin()->second;
+ lastModifiedData = dataReceived.begin()->second;
}
// Process the data from LOCATION.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "LOCATION");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "LOCATION");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
- bool TokenData = false;
- string PropertyTokens;
+ bool tokenData = false;
+ string propertyTokens;
- PropertyNameData = (string*)&DataReceived.begin()->first;
+ propertyNameData = (string*)&dataReceived.begin()->first;
- PropertyData = SplitValues(*PropertyNameData);
+ propertyData = SplitValues(*propertyNameData);
- for(map::iterator iter = PropertyData.begin();
- iter != PropertyData.end(); iter++){
+ for(map::iterator iter = propertyData.begin();
+ iter != propertyData.end(); iter++){
if (iter->first == "ALTREP"){
- LocationDataAltRep = iter->second;
+ locationDataAltRep = iter->second;
} else if (iter->first == "LANGUAGE"){
- LocationDataLanguage = iter->second;
+ locationDataLanguage = iter->second;
} else {
- if (TokenData == false){
- TokenData = true;
+ if (tokenData == false){
+ tokenData = true;
} else {
- PropertyTokens += ";";
+ propertyTokens += ";";
}
- PropertyTokens += iter->first;
- PropertyTokens += "=";
- PropertyTokens += iter->second;
+ propertyTokens += iter->first;
+ propertyTokens += "=";
+ propertyTokens += iter->second;
}
}
- if (PropertyTokens.size() > 0){
+ if (propertyTokens.size() > 0){
- LocationDataTokens = PropertyTokens;
+ locationDataTokens = propertyTokens;
}
- LocationData = DataReceived.begin()->second;
+ locationData = dataReceived.begin()->second;
}
// Process the data from ORGANIZER.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "ORGANIZER");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "ORGANIZER");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
- bool TokenData = false;
- string PropertyTokens;
+ bool tokenData = false;
+ string propertyTokens;
- PropertyNameData = (string*)&DataReceived.begin()->first;
+ propertyNameData = (string*)&dataReceived.begin()->first;
- PropertyData = SplitValues(*PropertyNameData);
+ propertyData = SplitValues(*propertyNameData);
- for(map::iterator iter = PropertyData.begin();
- iter != PropertyData.end(); iter++){
+ for(map::iterator iter = propertyData.begin();
+ iter != propertyData.end(); iter++){
if (iter->first == "CN"){
- OrganiserDataCommonName = iter->second;
+ organiserDataCommonName = iter->second;
} else if (iter->first == "DIR"){
- OrganiserDataDirectoryEntry = iter->second;
+ organiserDataDirectoryEntry = iter->second;
} else if (iter->first == "SENT-BY"){
- OrganiserDataSentByParam = iter->second;
+ organiserDataSentByParam = iter->second;
} else if (iter->first == "LANGUAGE"){
- OrganiserDataLanguage = iter->second;
+ organiserDataLanguage = iter->second;
} else {
- if (TokenData == false){
- TokenData = true;
+ if (tokenData == false){
+ tokenData = true;
} else {
- PropertyTokens += ";";
+ propertyTokens += ";";
}
- PropertyTokens += iter->first;
- PropertyTokens += "=";
- PropertyTokens += iter->second;
+ propertyTokens += iter->first;
+ propertyTokens += "=";
+ propertyTokens += iter->second;
}
}
- if (PropertyTokens.size() > 0){
+ if (propertyTokens.size() > 0){
- OrganiserDataTokens = PropertyTokens;
+ organiserDataTokens = propertyTokens;
}
- OrganiserData = DataReceived.begin()->second;
+ organiserData = dataReceived.begin()->second;
}
// Process the data from PRIORITY.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "PRIORITY");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "PRIORITY");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
try {
- PriorityTokens = DataReceived.begin()->first.substr(9);
+ priorityTokens = dataReceived.begin()->first.substr(9);
}
catch(const out_of_range &oor){
@@ -519,23 +537,23 @@ void CalendarEventObject::ProcessData(){
}
try {
- PriorityData = stoi(DataReceived.begin()->second);
+ priorityData = stoi(dataReceived.begin()->second);
}
catch(const invalid_argument &oor){
- PriorityTokens.clear();
+ priorityTokens.clear();
}
}
// Process the data from SEQUENCE.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "SEQUENCE");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "SEQUENCE");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
try {
- SequenceTokens = DataReceived.begin()->first.substr(9);
+ sequenceTokens = dataReceived.begin()->first.substr(9);
}
catch(const out_of_range &oor){
@@ -543,512 +561,1434 @@ void CalendarEventObject::ProcessData(){
}
try {
- SequenceData = stoi(DataReceived.begin()->second);
+ sequenceData = stoi(dataReceived.begin()->second);
}
catch(const invalid_argument &oor){
- SequenceTokens.clear();
+ sequenceTokens.clear();
}
}
// Process the data from STATUS.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "STATUS");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "STATUS");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
- bool TokenData = false;
- string PropertyTokens;
+ bool tokenData = false;
+ string propertyTokens;
- PropertyNameData = (string*)&DataReceived.begin()->first;
+ propertyNameData = (string*)&dataReceived.begin()->first;
- PropertyData = SplitValues(*PropertyNameData);
+ propertyData = SplitValues(*propertyNameData);
- for(map::iterator iter = PropertyData.begin();
- iter != PropertyData.end(); iter++){
+ for(map::iterator iter = propertyData.begin();
+ iter != propertyData.end(); iter++){
if (iter->first == "LANGUAGE"){
- RequestStatusLanguage = iter->second;
+ statusLanguage = iter->second;
} else {
- if (TokenData == false){
- TokenData = true;
+ if (tokenData == false){
+ tokenData = true;
} else {
- PropertyTokens += ";";
+ propertyTokens += ";";
}
- PropertyTokens += iter->first;
- PropertyTokens += "=";
- PropertyTokens += iter->second;
+ propertyTokens += iter->first;
+ propertyTokens += "=";
+ propertyTokens += iter->second;
}
}
- if (PropertyTokens.size() > 0){
+ if (propertyTokens.size() > 0){
- RequestStatusTokens = PropertyTokens;
+ statusTokens = propertyTokens;
}
- RequestStatusData = DataReceived.begin()->second;
+ statusData = dataReceived.begin()->second;
}
// Process the data from SUMMARY.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "SUMMARY");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "SUMMARY");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
- bool TokenData = false;
- string PropertyTokens;
+ bool tokenData = false;
+ string propertyTokens;
- PropertyNameData = (string*)&DataReceived.begin()->first;
+ propertyNameData = (string*)&dataReceived.begin()->first;
- PropertyData = SplitValues(*PropertyNameData);
+ propertyData = SplitValues(*propertyNameData);
- for(map::iterator iter = PropertyData.begin();
- iter != PropertyData.end(); iter++){
+ for(map::iterator iter = propertyData.begin();
+ iter != propertyData.end(); iter++){
if (iter->first == "ALTREP"){
- SummaryDataAltRep = iter->second;
+ summaryDataAltRep = iter->second;
} else if (iter->first == "LANGUAGE"){
- SummaryDataLanguage = iter->second;
+ summaryDataLanguage = iter->second;
} else {
- if (TokenData == false){
- TokenData = true;
+ if (tokenData == false){
+ tokenData = true;
} else {
- PropertyTokens += ";";
+ propertyTokens += ";";
}
- PropertyTokens += iter->first;
- PropertyTokens += "=";
- PropertyTokens += iter->second;
+ propertyTokens += iter->first;
+ propertyTokens += "=";
+ propertyTokens += iter->second;
}
}
- if (PropertyTokens.size() > 0){
+ if (propertyTokens.size() > 0){
- SummaryDataTokens = PropertyTokens;
+ summaryDataTokens = propertyTokens;
}
- SummaryData = DataReceived.begin()->second;
+ summaryData = dataReceived.begin()->second;
}
// Process the data from TRANSP.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "TRANSP");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "TRANSP");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
try {
- TimeTransparencyDataTokens = DataReceived.begin()->first.substr(7);
+ timeTransparencyDataTokens = dataReceived.begin()->first.substr(7);
}
catch(const out_of_range &oor){
// Do nothing as there is no data.
}
- TimeTransparencyData = DataReceived.begin()->second;
+ timeTransparencyData = dataReceived.begin()->second;
}
// Process the data from URL.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "URL");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "URL");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
try {
- URLDataTokens = DataReceived.begin()->first.substr(4);
+ urlDataTokens = dataReceived.begin()->first.substr(4);
}
catch(const out_of_range &oor){
// Do nothing as there is no data.
}
- URLData = DataReceived.begin()->second;
+ urlData = dataReceived.begin()->second;
}
// Process the data from RECURRENCE-ID.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "RECURRENCE-ID");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "RECURRENCE-ID");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
- bool TokenData = false;
- string PropertyTokens;
+ bool tokenData = false;
+ string propertyTokens;
- PropertyNameData = (string*)&DataReceived.begin()->first;
+ propertyNameData = (string*)&dataReceived.begin()->first;
- PropertyData = SplitValues(*PropertyNameData);
+ propertyData = SplitValues(*propertyNameData);
- for(map::iterator iter = PropertyData.begin();
- iter != PropertyData.end(); iter++){
+ for(map::iterator iter = propertyData.begin();
+ iter != propertyData.end(); iter++){
if (iter->first == "TZID"){
- RecurranceIDDataTimeZoneParam = iter->second;
+ recurranceIDDataTimeZoneParam = iter->second;
} else if (iter->first == "VALUE"){
- RecurranceIDDataValue = iter->second;
+ recurranceIDDataValue = iter->second;
} else if (iter->first == "RANGE"){
- RecurranceIDDataRangeParam = iter->second;
+ recurranceIDDataRangeParam = iter->second;
} else {
- if (TokenData == false){
- TokenData = true;
+ if (tokenData == false){
+ tokenData = true;
} else {
- PropertyTokens += ";";
+ propertyTokens += ";";
}
- PropertyTokens += iter->first;
- PropertyTokens += "=";
- PropertyTokens += iter->second;
+ propertyTokens += iter->first;
+ propertyTokens += "=";
+ propertyTokens += iter->second;
}
}
- if (PropertyTokens.size() > 0){
+ if (propertyTokens.size() > 0){
- RecurranceIDDataTokens = PropertyTokens;
+ recurranceIDDataTokens = propertyTokens;
}
- RecurranceIDData = DataReceived.begin()->second;
+ recurranceIDData = dataReceived.begin()->second;
}
// Process the data from RRULE.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "RRULE");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "RRULE");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
try {
- RecurranceRuleDataTokens = DataReceived.begin()->first.substr(6);
+ recurranceRuleDataTokens = dataReceived.begin()->first.substr(6);
}
catch(const out_of_range &oor){
// Do nothing as there is no data.
}
- RecurranceRuleData = DataReceived.begin()->second;
+ recurranceRuleData = dataReceived.begin()->second;
}
// Process the data from DTEND.
- bool DateTimeEndProcessed = false;
+ bool dateTimeEndProcessed = false;
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DTEND");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "DTEND");
- if (DataReceived.begin() != DataReceived.end()){
+ if (dataReceived.begin() != dataReceived.end()){
- bool TokenData = false;
- string PropertyTokens;
+ bool tokenData = false;
+ string propertyTokens;
- PropertyNameData = (string*)&DataReceived.begin()->first;
+ propertyNameData = (string*)&dataReceived.begin()->first;
- PropertyData = SplitValues(*PropertyNameData);
+ propertyData = SplitValues(*propertyNameData);
- for(map::iterator iter = PropertyData.begin();
- iter != PropertyData.end(); iter++){
+ for(map::iterator iter = propertyData.begin();
+ iter != propertyData.end(); iter++){
if (iter->first == "VALUE"){
- DateTimeEndDataValue = iter->second;
+ dateTimeEndDataValue = iter->second;
} else if (iter->first == "TZID"){
- DateTimeEndDataTimeZoneID = iter->second;
+ dateTimeEndDataTimeZoneID = iter->second;
} else {
- if (TokenData == false){
- TokenData = true;
+ if (tokenData == false){
+ tokenData = true;
} else {
- PropertyTokens += ";";
+ propertyTokens += ";";
}
- PropertyTokens += iter->first;
- PropertyTokens += "=";
- PropertyTokens += iter->second;
+ propertyTokens += iter->first;
+ propertyTokens += "=";
+ propertyTokens += iter->second;
}
}
- if (PropertyTokens.size() > 0){
- DateTimeEndDataTokens = PropertyTokens;
+ if (propertyTokens.size() > 0){
+ dateTimeEndDataTokens = propertyTokens;
}
- DateTimeEndData = DataReceived.begin()->second;
+ dateTimeEndData = dataReceived.begin()->second;
- DateTimeEndProcessed = true;
+ dateTimeEndProcessed = true;
}
- if (DateTimeEndProcessed == false){
+ if (dateTimeEndProcessed == false){
// Process the data from DURATION if DTEND
// hasn't already been processed.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DURATION");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, false, "DURATION");
- if (DataReceived.begin() != DataReceived.end()){
-
- try {
- DurationDataTokens = DataReceived.begin()->first.substr(9);
- }
+ bool tokenData = false;
+ string propertyTokens;
- catch(const out_of_range &oor){
- // Do nothing as there is no data.
- }
-
- DurationData = DataReceived.begin()->second;
+ if (dataReceived.begin() != dataReceived.end()){
+
+ durationData = dataReceived.begin()->second;
+ propertyNameData = (string*)&dataReceived.begin()->first;
+
+ propertyData = SplitValues(*propertyNameData);
+
+ for(map::iterator dataiter = propertyData.begin();
+ dataiter != propertyData.end(); dataiter++){
+
+ if (tokenData == false){
+ tokenData = true;
+ } else {
+ propertyTokens += ";";
+ }
+
+ propertyTokens += dataiter->first;
+ propertyTokens += "=";
+ propertyTokens += dataiter->second;
+
+ }
+
+ if (propertyTokens.size() > 0){
+ durationDataTokens = propertyTokens;
+ }
+
}
}
// Process the data from ATTACH.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "ATTACH");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, true, "ATTACH");
- for(multimap::iterator iter = DataReceived.begin();
- iter != DataReceived.end();
+ for(multimap::iterator iter = dataReceived.begin();
+ iter != dataReceived.end();
++iter){
- AttachListEncoding.push_back("");
- AttachListValue.push_back("");
- AttachListFormatType.push_back("");
- AttachListTokens.push_back("");
- AttachList.push_back("");
+ attachListEncoding.push_back("");
+ attachListValue.push_back("");
+ attachListFormatType.push_back("");
+ attachListTokens.push_back("");
+ attachList.push_back("");
- bool TokenData = false;
- string PropertyTokens;
+ bool tokenData = false;
+ string propertyTokens;
- PropertyNameData = (string*)&iter->first;
+ propertyNameData = (string*)&iter->first;
- PropertyData = SplitValues(*PropertyNameData);
+ propertyData = SplitValues(*propertyNameData);
- for(map::iterator dataiter = PropertyData.begin();
- dataiter != PropertyData.end(); dataiter++){
+ for(map::iterator dataiter = propertyData.begin();
+ dataiter != propertyData.end(); dataiter++){
if (dataiter->first == "ENCODING"){
- AttachListEncoding[ObjectSeekCount] = dataiter->second;
+ attachListEncoding[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "VALUE"){
- AttachListValue[ObjectSeekCount] = dataiter->second;
+ attachListValue[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "FMTTYPE"){
- AttachListFormatType[ObjectSeekCount] = dataiter->second;
+ attachListFormatType[objectSeekCount] = dataiter->second;
} else {
- if (TokenData == false){
- TokenData = true;
+ if (tokenData == false){
+ tokenData = true;
} else {
- PropertyTokens += ";";
+ propertyTokens += ";";
}
- PropertyTokens += dataiter->first;
- PropertyTokens += "=";
- PropertyTokens += dataiter->second;
+ propertyTokens += dataiter->first;
+ propertyTokens += "=";
+ propertyTokens += dataiter->second;
}
}
- if (PropertyTokens.size() > 0){
- AttachListTokens[ObjectSeekCount] = PropertyTokens;
+ if (propertyTokens.size() > 0){
+ attachListTokens[objectSeekCount] = propertyTokens;
}
- AttachList[ObjectSeekCount] = iter->second;
+ attachList[objectSeekCount] = iter->second;
- ObjectSeekCount++;
+ objectSeekCount++;
}
// Process the data from ATTENDEE.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "ATTENDEE");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, true, "ATTENDEE");
- ObjectSeekCount = 0;
+ objectSeekCount = 0;
- for(multimap::iterator iter = DataReceived.begin();
- iter != DataReceived.end();
+ for(multimap::iterator iter = dataReceived.begin();
+ iter != dataReceived.end();
++iter){
- AttendeeListMember.push_back("");
- AttendeeListDelegatedFrom.push_back("");
- AttendeeListDelegatedTo.push_back("");
- AttendeeListRole.push_back("");
- AttendeeListRSVP.push_back("");
- AttendeeListDirectoryEntry.push_back("");
- AttendeeListSentBy.push_back("");
- AttendeeListCommonName.push_back("");
- AttendeeListCalendarUserType.push_back("");
- AttendeeListParticipationStatus.push_back("");
- AttendeeListLanguage.push_back("");
- AttendeeListTokens.push_back("");
- AttendeeList.push_back("");
+ attendeeListMember.push_back("");
+ attendeeListDelegatedFrom.push_back("");
+ attendeeListDelegatedTo.push_back("");
+ attendeeListRole.push_back("");
+ attendeeListRSVP.push_back("");
+ attendeeListDirectoryEntry.push_back("");
+ attendeeListSentBy.push_back("");
+ attendeeListCommonName.push_back("");
+ attendeeListCalendarUserType.push_back("");
+ attendeeListParticipationStatus.push_back("");
+ attendeeListLanguage.push_back("");
+ attendeeListTokens.push_back("");
+ attendeeList.push_back("");
- bool TokenData = false;
- string PropertyTokens;
+ bool tokenData = false;
+ string propertyTokens;
- PropertyNameData = (string*)&iter->first;
+ propertyNameData = (string*)&iter->first;
- PropertyData = SplitValues(*PropertyNameData);
+ propertyData = SplitValues(*propertyNameData);
- for(map::iterator dataiter = PropertyData.begin();
- dataiter != PropertyData.end(); dataiter++){
+ for(map::iterator dataiter = propertyData.begin();
+ dataiter != propertyData.end(); dataiter++){
if (dataiter->first == "CUTYPE"){
- AttendeeListCalendarUserType[ObjectSeekCount] = dataiter->second;
+ attendeeListCalendarUserType[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "MEMBER"){
- AttendeeListMember[ObjectSeekCount] = dataiter->second;
+ attendeeListMember[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "ROLE"){
- AttendeeListRole[ObjectSeekCount] = dataiter->second;
+ attendeeListRole[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "PARTSTAT"){
- AttendeeListParticipationStatus[ObjectSeekCount] = dataiter->second;
+ attendeeListParticipationStatus[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "RSVP"){
- AttendeeListRSVP[ObjectSeekCount] = dataiter->second;
+ attendeeListRSVP[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "DELEGATED-TO"){
- AttendeeListDelegatedTo[ObjectSeekCount] = dataiter->second;
+ attendeeListDelegatedTo[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "DELEGATED-FROM"){
- AttendeeListDelegatedFrom[ObjectSeekCount] = dataiter->second;
+ attendeeListDelegatedFrom[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "SENT-BY"){
- AttendeeListSentBy[ObjectSeekCount] = dataiter->second;
+ attendeeListSentBy[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "CN"){
- AttendeeListCommonName[ObjectSeekCount] = dataiter->second;
+ attendeeListCommonName[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "DIR"){
- AttendeeListDirectoryEntry[ObjectSeekCount] = dataiter->second;
+ attendeeListDirectoryEntry[objectSeekCount] = dataiter->second;
} else if (dataiter->first == "LANGUAGE"){
- AttendeeListLanguage[ObjectSeekCount] = dataiter->second;
+ attendeeListLanguage[objectSeekCount] = dataiter->second;
} else {
- if (TokenData == false){
- TokenData = true;
+ if (tokenData == false){
+ tokenData = true;
} else {
- PropertyTokens += ";";
+ propertyTokens += ";";
}
- PropertyTokens += dataiter->first;
- PropertyTokens += "=";
- PropertyTokens += dataiter->second;
+ propertyTokens += dataiter->first;
+ propertyTokens += "=";
+ propertyTokens += dataiter->second;
}
}
- if (PropertyTokens.size() > 0){
- AttendeeListTokens[ObjectSeekCount] = PropertyTokens;
+ if (propertyTokens.size() > 0){
+ attendeeListTokens[objectSeekCount] = propertyTokens;
}
- AttendeeList[ObjectSeekCount] = iter->second;
+ attendeeList[objectSeekCount] = iter->second;
- ObjectSeekCount++;
+ objectSeekCount++;
}
// Process the data from CATEGORIES.
- DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "CATEGORIES");
+ dataReceived = ProcessTextVectors(&objectName, &objectData, true, "CATEGORIES");
- ObjectSeekCount = 0;
+ objectSeekCount = 0;
- for(multimap::iterator iter = DataReceived.begin();
- iter != DataReceived.end();
+ for(multimap::iterator iter = dataReceived.begin();
+ iter != dataReceived.end();
++iter){
- CategoriesListTokens.push_back("");
- CategoriesListLanguage.push_back("");
- CategoriesList.push_back("");
+ categoriesListTokens.push_back("");
+ categoriesListLanguage.push_back("");
+ categoriesList.push_back("");
- bool TokenData = false;
- string PropertyTokens;
+ bool tokenData = false;
+ string propertyTokens;
- PropertyNameData = (string*)&iter->first;
+ propertyNameData = (string*)&iter->first;
- PropertyData = SplitValues(*PropertyNameData);
+ propertyData = SplitValues(*propertyNameData);
- for(map::iterator dataiter = PropertyData.begin();
- dataiter != PropertyData.end(); dataiter++){
+ for(map::iterator dataiter = propertyData.begin();
+ dataiter != propertyData.end(); dataiter++){
if (dataiter->first == "LANGUAGE"){
- CategoriesListLanguage[ObjectSeekCount] = dataiter->second;
+ categoriesListLanguage[objectSeekCount] = dataiter->second;
} else {
- if (TokenData == false){
- TokenData = true;
+ if (tokenData == false){
+ tokenData = true;
} else {
- PropertyTokens += ";";
+ propertyTokens += ";";
}
- PropertyTokens += dataiter->first;
- PropertyTokens += "=";
- PropertyTokens += dataiter->second;
+ propertyTokens += dataiter->first;
+ propertyTokens += "=";
+ propertyTokens += dataiter->second;
}
}
- if (PropertyTokens.size() > 0){
- CategoriesListTokens[ObjectSeekCount] = PropertyTokens;
+ if (propertyTokens.size() > 0){
+ categoriesListTokens[objectSeekCount] = propertyTokens;
}
- CategoriesList[ObjectSeekCount] = iter->second;
+ categoriesList[objectSeekCount] = iter->second;
- ObjectSeekCount++;
+ 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++;
+
+ }
+
+ // 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 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 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++;
+
+ }
+
+ // 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 RESOURCES.
+
+ dataReceived = ProcessTextVectors(&objectName, &objectData, true, "RESOURCES");
+
+ objectSeekCount = 0;
+
+ for(multimap::iterator iter = dataReceived.begin();
+ iter != dataReceived.end();
+ ++iter){
+
+ resourcesDataTokens.push_back("");
+ resourcesDataAltRep.push_back("");
+ resourcesDataLanguage.push_back("");
+ resourcesData.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"){
+
+ resourcesDataAltRep[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "LANGUAGE"){
+
+ resourcesDataLanguage[objectSeekCount] = dataiter->second;
+
+ } else {
+
+ if (tokenData == false){
+ tokenData = true;
+ } else {
+ propertyTokens += ";";
+ }
+
+ propertyTokens += dataiter->first;
+ propertyTokens += "=";
+ propertyTokens += dataiter->second;
+
+ }
+
+ }
+
+ if (propertyTokens.size() > 0){
+ resourcesDataTokens[objectSeekCount] = propertyTokens;
+ }
+
+ resourcesData[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 VALARM section.
+
+ int seekCount = 0;
+ int alarmObjectCount = 0;
+
+ bool alarmActionFound = false;
+
+ for (vector>::iterator iter = eventAlarmName.begin();
+ iter != eventAlarmName.end(); iter++){
+
+ CalendarAlarmDataStruct newAlarmData;
+
+ // Process the data from ACTION.
+
+ bool alarmActionFound = false;
+ bool alarmTriggerFound = false;
+ bool alarmDurationFound = false;
+ bool alarmDescriptionFound = false;
+ bool alarmSummaryFound = false;
+
+ dataReceived = ProcessTextVectors(&eventAlarmName[seekCount],
+ &eventAlarmData[seekCount], false, "ACTION");
+
+ if (dataReceived.begin() != dataReceived.end()){
+
+ try {
+ newAlarmData.alarmActionTokens = dataReceived.begin()->first.substr(7);
+ }
+
+ catch(const out_of_range &oor){
+ // Do nothing as there is no data.
+ }
+
+ newAlarmData.alarmAction = dataReceived.begin()->second;
+ alarmActionFound = true;
+
+ }
+
+ // Check if a value was set for AlarmAction, otherwise
+ // process the next VALARM section.
+
+ if (newAlarmData.alarmAction.size() < 1){
+
+ seekCount++;
+ continue;
+
+ }
+
+ // Check if AlarmAction is DISPLAY, AUDIO or EMAIL.
+ // Process the next VALARM section if not.
+
+ if (newAlarmData.alarmAction == "AUDIO"){
+
+ newAlarmData.alarmType = CALENDARALARM_AUDIO;
+
+ } else if (newAlarmData.alarmAction == "DISPLAY"){
+
+ newAlarmData.alarmType = CALENDARALARM_DISPLAY;
+
+ } else if (newAlarmData.alarmAction == "EMAIL"){
+
+ newAlarmData.alarmType = CALENDARALARM_EMAIL;
+
+ } else {
+
+ seekCount++;
+ continue;
+
+ }
+
+ // Process the data from TRIGGER.
+
+ dataReceived = ProcessTextVectors(&eventAlarmName[seekCount], &eventAlarmData[seekCount], false, "TRIGGER");
+
+ 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"){
+
+ newAlarmData.triggerValue = iter->second;
+
+ } else if (iter->first == "RELATED"){
+
+ newAlarmData.triggerRelated = iter->second;
+
+ } else {
+
+ if (tokenData == false){
+ tokenData = true;
+ } else {
+ propertyTokens += ";";
+ }
+
+ propertyTokens += iter->first;
+ propertyTokens += "=";
+ propertyTokens += iter->second;
+
+ }
+
+ }
+
+ if (propertyTokens.size() > 0){
+ newAlarmData.triggerTokens = propertyTokens;
+ }
+
+ newAlarmData.triggerData = dataReceived.begin()->second;
+ alarmTriggerFound = true;
+
+ }
+
+ // Process the data from DESCRIPTION.
+
+ dataReceived = ProcessTextVectors(&eventAlarmName[seekCount], &eventAlarmData[seekCount], false, "DESCRIPTION");
+
+ if (dataReceived.begin() != dataReceived.end() &&
+ (newAlarmData.alarmType == CALENDARALARM_DISPLAY ||
+ newAlarmData.alarmType == CALENDARALARM_EMAIL)){
+
+ 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"){
+
+ newAlarmData.descriptionAltRep = iter->second;
+
+ } else if (iter->first == "LANGUAGE"){
+
+ newAlarmData.descriptionLanguage = iter->second;
+
+ } else {
+
+ if (tokenData == false){
+ tokenData = true;
+ } else {
+ propertyTokens += ";";
+ }
+
+ propertyTokens += iter->first;
+ propertyTokens += "=";
+ propertyTokens += iter->second;
+
+ }
+
+ }
+
+ if (propertyTokens.size() > 0){
+ newAlarmData.descriptionTokens = propertyTokens;
+ }
+
+ newAlarmData.descriptionData = dataReceived.begin()->second;
+ alarmDescriptionFound = true;
+
+ }
+
+ // Process data from SUMMARY.
+
+ dataReceived = ProcessTextVectors(&eventAlarmName[seekCount], &eventAlarmData[seekCount], false, "SUMMARY");
+
+ if (dataReceived.begin() != dataReceived.end() &&
+ newAlarmData.alarmType == CALENDARALARM_EMAIL){
+
+ 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"){
+
+ newAlarmData.summaryAltRep = iter->second;
+
+ } else if (iter->first == "LANGUAGE"){
+
+ newAlarmData.summaryLanguage = iter->second;
+
+ } else {
+
+ if (tokenData == false){
+ tokenData = true;
+ } else {
+ propertyTokens += ";";
+ }
+
+ propertyTokens += iter->first;
+ propertyTokens += "=";
+ propertyTokens += iter->second;
+
+ }
+
+ }
+
+ if (propertyTokens.size() > 0){
+ newAlarmData.summaryTokens = propertyTokens;
+ }
+
+ newAlarmData.summaryData = dataReceived.begin()->second;
+ alarmSummaryFound = true;
+
+ }
+
+ // Process data from DURATION.
+
+ dataReceived = ProcessTextVectors(&eventAlarmName[seekCount], &eventAlarmData[seekCount], false, "DURATION");
+
+ if (dataReceived.begin() != dataReceived.end()){
+
+ try {
+ newAlarmData.durationTokens = dataReceived.begin()->first.substr(9);
+ }
+
+ catch(const out_of_range &oor){
+ // Do nothing as there is no data.
+ }
+
+ newAlarmData.durationData = dataReceived.begin()->second;
+ alarmDurationFound = true;
+
+ }
+
+ // Process data from REPEAT.
+
+ dataReceived = ProcessTextVectors(&eventAlarmName[seekCount], &eventAlarmData[seekCount], false, "REPEAT");
+
+ if (dataReceived.begin() != dataReceived.end() && alarmDurationFound == true){
+
+ try {
+ newAlarmData.repeatTokens = dataReceived.begin()->first.substr(7);
+ }
+
+ catch(const out_of_range &oor){
+ // Do nothing as there is no data.
+ }
+
+ newAlarmData.repeatData = dataReceived.begin()->second;
+
+ } else {
+
+ newAlarmData.durationData.clear();
+ newAlarmData.durationTokens.clear();
+
+ }
+
+ // Process data from ATTENDEE.
+
+ dataReceived = ProcessTextVectors(&eventAlarmName[seekCount], &eventAlarmData[seekCount], true, "ATTENDEE");
+
+ objectSeekCount = 0;
+
+ for(multimap::iterator iter = dataReceived.begin();
+ iter != dataReceived.end();
+ ++iter){
+
+ newAlarmData.attendeeListMember.push_back("");
+ newAlarmData.attendeeListDelegatedFrom.push_back("");
+ newAlarmData.attendeeListDelegatedTo.push_back("");
+ newAlarmData.attendeeListRole.push_back("");
+ newAlarmData.attendeeListRSVP.push_back("");
+ newAlarmData.attendeeListDirectoryEntry.push_back("");
+ newAlarmData.attendeeListSentBy.push_back("");
+ newAlarmData.attendeeListCommonName.push_back("");
+ newAlarmData.attendeeListCalendarUserType.push_back("");
+ newAlarmData.attendeeListParticipationStatus.push_back("");
+ newAlarmData.attendeeListLanguage.push_back("");
+ newAlarmData.attendeeListTokens.push_back("");
+ newAlarmData.attendeeList.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 == "CUTYPE"){
+
+ newAlarmData.attendeeListCalendarUserType[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "MEMBER"){
+
+ newAlarmData.attendeeListMember[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "ROLE"){
+
+ newAlarmData.attendeeListRole[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "PARTSTAT"){
+
+ newAlarmData.attendeeListParticipationStatus[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "RSVP"){
+
+ newAlarmData.attendeeListRSVP[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "DELEGATED-TO"){
+
+ newAlarmData.attendeeListDelegatedTo[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "DELEGATED-FROM"){
+
+ newAlarmData.attendeeListDelegatedFrom[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "SENT-BY"){
+
+ newAlarmData.attendeeListSentBy[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "CN"){
+
+ newAlarmData.attendeeListCommonName[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "DIR"){
+
+ newAlarmData.attendeeListDirectoryEntry[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "LANGUAGE"){
+
+ newAlarmData.attendeeListLanguage[objectSeekCount] = dataiter->second;
+
+ } else {
+
+ if (tokenData == false){
+ tokenData = true;
+ } else {
+ propertyTokens += ";";
+ }
+
+ propertyTokens += dataiter->first;
+ propertyTokens += "=";
+ propertyTokens += dataiter->second;
+
+ }
+
+ }
+
+ if (propertyTokens.size() > 0){
+ newAlarmData.attendeeListTokens[objectSeekCount] = propertyTokens;
+ }
+
+ newAlarmData.attendeeList[objectSeekCount] = iter->second;
+
+ objectSeekCount++;
+
+ }
+
+ // Process data from ATTACH.
+
+ dataReceived = ProcessTextVectors(&eventAlarmName[seekCount], &eventAlarmData[seekCount], true, "ATTACH");
+
+ objectSeekCount = 0;
+
+ for(multimap::iterator iter = dataReceived.begin();
+ iter != dataReceived.end();
+ ++iter){
+
+ newAlarmData.attachListEncoding.push_back("");
+ newAlarmData.attachListValue.push_back("");
+ newAlarmData.attachListFormatType.push_back("");
+ newAlarmData.attachListTokens.push_back("");
+ newAlarmData.attachList.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 == "ENCODING"){
+
+ newAlarmData.attachListEncoding[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "VALUE"){
+
+ newAlarmData.attachListValue[objectSeekCount] = dataiter->second;
+
+ } else if (dataiter->first == "FMTTYPE"){
+
+ newAlarmData.attachListFormatType[objectSeekCount] = dataiter->second;
+
+ } else {
+
+ if (tokenData == false){
+ tokenData = true;
+ } else {
+ propertyTokens += ";";
+ }
+
+ propertyTokens += dataiter->first;
+ propertyTokens += "=";
+ propertyTokens += dataiter->second;
+
+ }
+
+ }
+
+ if (propertyTokens.size() > 0){
+ newAlarmData.attachListTokens[objectSeekCount] = propertyTokens;
+ }
+
+ newAlarmData.attachList[objectSeekCount] = iter->second;
+
+ objectSeekCount++;
+
+ }
+
+ // Process data from X-*
+
+ alarmObjectCount = 0;
+
+ for(vector::iterator xtokeniter = eventAlarmName[seekCount].begin();
+ xtokeniter != eventAlarmName[seekCount].end(); ++xtokeniter){
+
+ bool tokenData = false;
+ string propertyTokens;
+
+ if (xtokeniter->substr(0,2) == "X-" &&
+ xtokeniter->size() > 2){
+
+ newAlarmData.xTokensData.push_back(eventAlarmData[seekCount][alarmObjectCount]);
+ newAlarmData.xTokensDataTokens.push_back(eventAlarmName[seekCount][alarmObjectCount]);
+
+ }
+
+ alarmObjectCount++;
+
+ }
+
+ if (newAlarmData.alarmType == CALENDARALARM_AUDIO &&
+ alarmActionFound == true &&
+ alarmTriggerFound == true){
+
+ calendarAlarmData.push_back(newAlarmData);
+
+ } else if (newAlarmData.alarmType == CALENDARALARM_DISPLAY &&
+ alarmActionFound == true &&
+ alarmTriggerFound == true &&
+ alarmDescriptionFound == true){
+
+ calendarAlarmData.push_back(newAlarmData);
+
+ } else if (newAlarmData.alarmType == CALENDARALARM_EMAIL &&
+ alarmActionFound == true &&
+ alarmTriggerFound == true &&
+ alarmDescriptionFound == true &&
+ alarmSummaryFound == true){
+
+ calendarAlarmData.push_back(newAlarmData);
+
+ }
+
+ seekCount++;
+
+ }
+
+ 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