bool ValidDateTimeStamp = false;
bool ValidUniqueID = false;
int SeekCount = 0;
+ string PropertyName;
// Look for BEGIN:VEVENT.
for (vector<string>::iterator iter = ObjectName.begin();
iter != ObjectName.end(); iter++){
-
- if (ObjectName[SeekCount] == "DTSTAMP"){
+
+ try{
+ PropertyName = ObjectName[SeekCount].substr(0,7);
+ }
+
+ catch(const out_of_range& oor){
+ continue;
+ }
+
+ if (PropertyName == "DTSTAMP"){
if (ValidDateTimeStamp == false){
ValidDateTimeStamp = true;
for (vector<string>::iterator iter = ObjectName.begin();
iter != ObjectName.end(); iter++){
- if (ObjectName[SeekCount] == "UID"){
+ try{
+ PropertyName = ObjectName[SeekCount].substr(0,3);
+ }
+
+ catch(const out_of_range& oor){
+ continue;
+ }
+
+ if (PropertyName == "UID"){
if (ValidUniqueID == false){
ValidUniqueID = true;