Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Changed variable type to std::string for three RequestStatus variables.
[xestiacalendar/.git] / source / objects / calendarobject / CalendarObject.cpp
index 0925b45..e094bc2 100644 (file)
@@ -52,6 +52,7 @@ CalendarObjectLoadResult CalendarObject::LoadString(std::string *LoadStringData)
        bool NewLine = false;
        bool SkipMode = false;
        bool ColonFound = false;
+       bool QuoteMode = false;
        char BufferChar = 0;
        int StringDataSize = LoadStringData->size();
        int SeekCount = 0;
@@ -73,6 +74,22 @@ CalendarObjectLoadResult CalendarObject::LoadString(std::string *LoadStringData)
 
                        NewLine = false;
                                
+               } else if ((*LoadStringData)[SeekCount] == '\"'){
+                       
+                       if (QuoteMode == false){
+                               QuoteMode = true;
+                       } else {
+                               QuoteMode = false;
+                       }
+                       
+                       BufferChar = (*LoadStringData)[SeekCount];
+                       
+                       if (ColonFound == false){
+                               PropertyName += BufferChar;
+                       } else {
+                               PropertyValue += BufferChar;
+                       }
+                       
                } else if (NewLine == true){
                
                        // Character is on a new line but not a space or
@@ -100,12 +117,19 @@ CalendarObjectLoadResult CalendarObject::LoadString(std::string *LoadStringData)
                        
                        NewLine = true;
                        
-               } else if ((*LoadStringData)[SeekCount] == ':'){
+               } else if ((*LoadStringData)[SeekCount] == ':' &&
+                               QuoteMode == false){
                
                        // Character is the colon. Set the colon
                        // found boolen to true.
                        
-                       ColonFound = true;
+                       BufferChar = (*LoadStringData)[SeekCount];
+                                       
+                       if (ColonFound == true){
+                               PropertyValue += BufferChar;
+                       } else {
+                               ColonFound = true;
+                       }
                        
                } else {
                        
@@ -282,4 +306,22 @@ void CalendarObject::ProcessBaseData(){
                
        }
        
+       // Get the calendar scale (CALSCALE).
+       
+       DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "CALSCALE");
+       
+       if (DataReceived.begin() != DataReceived.end()){
+               
+               try {
+                       CalendarScaleTokens = DataReceived.begin()->first.substr(9);
+               }
+               
+               catch(const out_of_range &oor){
+                       // Do nothing as there is no data.
+               }               
+               
+               CalendarScaleData = DataReceived.begin()->second;
+               
+       }
+       
 }
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy