}
+ // Process Alarm section.
+
+ ProcessAlarms();
+
+ int SeekCount = 0;
+
+ bool AlarmActionFound = false;
+
+ for (vector<vector<string>>::iterator iter = EventAlarmName.begin();
+ iter != EventAlarmName.end(); iter++){
+
+ CalendarAlarmDataStruct NewAlarmData;
+
+ // Process the data from ACTION.
+
+ bool AlarmActionFound = false;
+ bool AlarmTriggerFound = 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;
+
+ }
+
+ if (NewAlarmData.AlarmType == CALENDARALARM_AUDIO &&
+ AlarmActionFound == true){
+
+ CalendarAlarmData.push_back(NewAlarmData);
+
+ }
+
+ SeekCount++;
+
+ }
+
ObjectSeekCount = 0;
// Process data from X-*
}
}
+
+void CalendarEventObject::ProcessAlarms(){
+
+ int SeekCount = 0;
+
+ bool TZMode = false; // False = STANDARD, True = DAYLIGHT.
+ bool ValidBegin = false;
+ vector<string> EventObjectName;
+ vector<string> EventObjectData;
+
+ for (vector<string>::iterator iter = ObjectName.begin();
+ iter != ObjectName.end(); iter++){
+
+ // Check if the current name is BEGIN and
+ // data is either STANDARD or DAYLIGHT.
+
+ if (ObjectName[SeekCount] == "BEGIN" &&
+ ObjectData[SeekCount] == "VALARM"){
+
+ if (ValidBegin == false){
+ ValidBegin = true;
+ EventObjectName.clear();
+ EventObjectData.clear();
+ } else {
+
+ }
+
+ SeekCount++;
+ continue;
+
+ }
+
+ // Check if current name is END and
+ // data is either STANDARD or DAYLIGHT.
+
+ if (ObjectName[SeekCount] == "END" &&
+ ObjectData[SeekCount] == "VALARM" &&
+ ValidBegin == true){
+
+ EventAlarmName.push_back(EventObjectName);
+ EventAlarmData.push_back(EventObjectData);
+
+ EventObjectName.clear();
+ EventObjectData.clear();
+
+ ValidBegin = false;
+
+ }
+
+ if (ValidBegin == true){
+
+ EventObjectName.push_back(ObjectName[SeekCount]);
+ EventObjectData.push_back(ObjectData[SeekCount]);
+
+ }
+
+ SeekCount++;
+
+ }
+
+}
\ No newline at end of file