Epic refactoring int progress...

This commit is contained in:
Benoit Blanchon
2014-10-27 22:50:50 +01:00
parent 8988cb4761
commit 852256c1af
34 changed files with 334 additions and 256 deletions

View File

@ -70,9 +70,6 @@ void JsonParser::parseValueTo(JsonValue destination) {
case '\"':
destination = parseString();
break;
default:
destination = NULL; // invalid JSON
}
}
@ -142,10 +139,9 @@ JsonObject JsonParser::parseObject() {
const char *key = parseString();
if (!key) return NULL;
if (!skip(':'))
return NULL;
if (!skip(':')) return NULL;
JsonValue value = object[key];
JsonValue value = object[key];
parseValueTo(value);
if (!value.success()) return NULL;
@ -159,3 +155,9 @@ JsonObject JsonParser::parseObject() {
const char *JsonParser::parseString() {
return QuotedString::extractFrom(_ptr, &_ptr);
}
JsonValue JsonParser::parseValue() {
JsonValue value = _buffer->createValue();
parseValueTo(value);
return value;
}