Added JsonArray::getLong() and JsonHashTable::getLong()

This commit is contained in:
Benoit Blanchon
2014-01-12 12:57:44 +01:00
parent b3647a7d91
commit 80c2cf3567
6 changed files with 28 additions and 5 deletions

View File

@ -31,7 +31,7 @@ jsmntok_t* JsonHashTable::getToken(char* desiredKey)
for (int i = 0; i < tokens[0].size / 2 ; i++)
{
// get key token string
char* key = getTokenString(currentToken);
char* key = getStringFromToken(currentToken);
// compare with desired name
if (strcmp(desiredKey, key) == 0)
@ -58,7 +58,12 @@ JsonHashTable JsonHashTable::getHashTable(char* key)
return JsonHashTable(json, getToken(key));
}
long JsonHashTable::getLong(char* key)
{
return getLongFromToken(getToken(key));
}
char* JsonHashTable::getString(char* key)
{
return getTokenString(getToken(key));
return getStringFromToken(getToken(key));
}