forked from bblanchon/ArduinoJson
Fixed return type of JsonArray::is<T>()
and some others (issue #121)
This commit is contained in:
@ -92,7 +92,7 @@ class JsonArray : public Internals::JsonPrintable<JsonArray>,
|
||||
|
||||
// Check the type of the value at specified index.
|
||||
template <typename T>
|
||||
FORCE_INLINE T is(size_t index) const;
|
||||
FORCE_INLINE bool is(size_t index) const;
|
||||
|
||||
// Creates a JsonArray and adds a reference at the end of the array.
|
||||
// It's a shortcut for JsonBuffer::createArray() and JsonArray::add()
|
||||
|
@ -182,7 +182,7 @@ inline T JsonArray::get(size_t index) const {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T JsonArray::is(size_t index) const {
|
||||
inline bool JsonArray::is(size_t index) const {
|
||||
node_type *node = getNodeAt(index);
|
||||
return node ? node->content.is<T>() : false;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ class JsonArraySubscript : public JsonSubscriptBase<JsonArraySubscript> {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
FORCE_INLINE T is() const {
|
||||
FORCE_INLINE bool is() const {
|
||||
return _array.is<T>(_index);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ class JsonObjectSubscript
|
||||
}
|
||||
|
||||
template <typename TValue>
|
||||
FORCE_INLINE TValue is() const {
|
||||
FORCE_INLINE bool is() const {
|
||||
return _object.is<TValue>(_key);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user