Added JsonVariant::operator[](const char*)

This commit is contained in:
Benoit Blanchon
2014-11-04 10:30:45 +01:00
parent 97768ec176
commit e5669577df
3 changed files with 25 additions and 1 deletions

View File

@ -91,13 +91,17 @@ class JsonVariant {
static JsonVariant &invalid() { return _invalid; }
bool success() { return _type != Internals::JSON_INVALID; }
bool success() {
return _type != Internals::JSON_INVALID &&
_type != Internals::JSON_UNDEFINED;
}
template <typename T>
void writeTo(T &writer) const;
size_t size() const;
JsonVariant &operator[](int index);
JsonVariant &operator[](const char *key);
private:
JsonVariant(Internals::JsonVariantType type) : _type(type) {}