mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 16:14:05 +01:00
as<int>()
This commit is contained in:
@@ -134,6 +134,8 @@ class VariantData {
|
||||
|
||||
template <typename T>
|
||||
bool isInteger() const {
|
||||
if (isPointer())
|
||||
return _content.asPointer->isInteger<T>();
|
||||
switch (type()) {
|
||||
case VALUE_IS_UNSIGNED_INTEGER:
|
||||
return canConvertNumber<T>(_content.asUnsignedInteger);
|
||||
|
||||
@@ -17,6 +17,8 @@ namespace ARDUINOJSON_NAMESPACE {
|
||||
|
||||
template <typename T>
|
||||
inline T VariantData::asIntegral() const {
|
||||
if (isPointer())
|
||||
return _content.asPointer->asIntegral<T>();
|
||||
switch (type()) {
|
||||
case VALUE_IS_BOOLEAN:
|
||||
return _content.asBoolean;
|
||||
|
||||
Reference in New Issue
Block a user