Made JsonValue inherit from JsonObjectBase

This commit is contained in:
Benoît Blanchon
2014-07-16 13:41:00 +02:00
parent d189bd7140
commit 6a868e46bd
7 changed files with 61 additions and 73 deletions

View File

@ -25,9 +25,14 @@ namespace ArduinoJson
JsonArray() {}
bool success()
{
return JsonObjectBase::success() && tokens->type == JSMN_ARRAY;
}
int getLength()
{
return tokens != 0 ? tokens[0].size : 0;
return success() ? tokens[0].size : 0;
}
JsonValue operator[](int index);
@ -61,7 +66,11 @@ namespace ArduinoJson
private:
JsonArray(char* json, jsmntok_t* tokens);
JsonArray(char* json, jsmntok_t* tokens)
: JsonObjectBase(json, tokens)
{
}
};
}
}