Added JsonValue::as<T>()

This commit is contained in:
Benoit Blanchon
2014-10-23 17:22:23 +02:00
parent 8947a6c9de
commit e4779512e6
7 changed files with 24 additions and 18 deletions

View File

@ -25,7 +25,7 @@ namespace ArduinoJson
void operator=(int);
void operator=(const JsonValue& value) { duplicate(value); }
void operator=(const Internals::JsonNodeWrapper& object) { duplicate(object); }
operator bool() const;
operator const char*() const;
operator double() const;
@ -35,5 +35,11 @@ namespace ArduinoJson
operator JsonObject() const;
void set(double value, int decimals);
template<typename T>
T as()
{
return static_cast<T>(*this);
}
};
}