Replaced JsonToken operators by meaningful methods

This commit is contained in:
Benoit Blanchon
2014-07-18 15:54:49 +02:00
parent 4a1d8483cc
commit 714a37bd59
6 changed files with 18 additions and 17 deletions

View File

@ -26,7 +26,7 @@ JsonValue JsonHashTable::getValue(const char* desiredKey)
return JsonValue::null();
// skip first token, it's the whole object
JsonToken runningToken = token + 1;
JsonToken runningToken = token.firstChild();
// scan each keys
for (int i = 0; i < token.size() / 2; i++)
@ -35,7 +35,7 @@ JsonValue JsonHashTable::getValue(const char* desiredKey)
char* key = runningToken.getText(json);
// move to the 'value' token
runningToken += 1;
runningToken = runningToken.nextSibling();
// compare with desired name
if (strcmp(desiredKey, key) == 0)
@ -45,7 +45,7 @@ JsonValue JsonHashTable::getValue(const char* desiredKey)
}
// skip nested tokens
runningToken += 1 + runningToken.nestedTokenCount();
runningToken = runningToken.nextSibling();
}
// nothing found, return NULL