X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fobjects%2Fcalendarobject%2FCalendarObject.cpp;h=e094bc2b4c70f628496080ae9c6b3a1efd5796a1;hb=f53595647be46dd59b042f252d6aa9a0f744d420;hp=aecb136388dab31f88effecdef2404ce2385b305;hpb=679177e983e748ab33ff6361dab881d3546d9948;p=xestiacalendar%2F.git diff --git a/source/objects/calendarobject/CalendarObject.cpp b/source/objects/calendarobject/CalendarObject.cpp index aecb136..e094bc2 100644 --- a/source/objects/calendarobject/CalendarObject.cpp +++ b/source/objects/calendarobject/CalendarObject.cpp @@ -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 {