src/lib/INIReader.cpp
branchv_0
changeset 35 930f17f16fd7
parent 34 7eb3dcacba7b
child 39 509e4b02f3c2
equal deleted inserted replaced
34:7eb3dcacba7b 35:930f17f16fd7
   200 	}
   200 	}
   201 
   201 
   202 	std::string readUntil(const std::string& until, bool* found = nullptr) {
   202 	std::string readUntil(const std::string& until, bool* found = nullptr) {
   203 		std::stringstream result;
   203 		std::stringstream result;
   204 
   204 
   205 		for (char ch = peek(); input.good() && !oneOf(ch, until); ch = peek()) {
   205 		for (char ch = peek(); input.good(); ch = peek()) {
   206 			if (allowLineContinuationsWithEscaping && ch == '\\') {
   206 			if (allowLineContinuationsWithSpace && ch == '\n') {
       
   207 				get();
       
   208 				ch = peek();
       
   209 				if (ch == ' ') get();
       
   210 				else if (ch == std::istream::traits_type::eof()) break;
       
   211 				else {
       
   212 					if (found) *found = true;
       
   213 					return result.str();
       
   214 				}
       
   215 			} else if (oneOf(ch, until)) {
       
   216 				break;
       
   217 			} else if (allowLineContinuationsWithEscaping && ch == '\\') {
   207 				get();
   218 				get();
   208 				ch = get();
   219 				ch = get();
   209 				if (oneOf(ch, until) && ch == '\n') processContinuingLine(result);
   220 				if (oneOf(ch, until) && ch == '\n') processContinuingLine(result);
   210 				else if (oneOf(ch, until)) result.put(ch);
   221 				else if (oneOf(ch, until)) result.put(ch);
   211 				else if (ch == std::istream::traits_type::eof()) break;
   222 				else if (ch == std::istream::traits_type::eof()) break;