From: Steve Brokenshire Date: Sun, 24 Jan 2016 09:23:34 +0000 (+0000) Subject: Check for quote and go in and out of Quote mode as needed. X-Git-Tag: release-0.02~700 X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=commitdiff_plain;h=88a5b0d1ed4ffe6e7bfb2e7c41d651eb8745bcc6 Check for quote and go in and out of Quote mode as needed. --- diff --git a/source/objects/calendarobject/CalendarObject.cpp b/source/objects/calendarobject/CalendarObject.cpp index aecb136..ab21f14 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,7 +117,8 @@ 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.