mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Fixed errors with Variable Length Arrays (issue #416)
This commit is contained in:
@@ -78,20 +78,46 @@ class JsonVariantBase : public Internals::JsonPrintable<TImpl> {
|
||||
// Returns the value associated with the specified key if the variant is
|
||||
// an object.
|
||||
// Return JsonVariant::invalid() if the variant is not an object.
|
||||
//
|
||||
// const JsonObjectSubscript operator[](TKey) const;
|
||||
// TKey = const std::string&, const String&
|
||||
template <typename TString>
|
||||
FORCE_INLINE
|
||||
typename TypeTraits::EnableIf<Internals::StringFuncs<TString>::has_equals,
|
||||
const JsonObjectSubscript<TString> >::type
|
||||
operator[](const TString &key) const {
|
||||
FORCE_INLINE typename TypeTraits::EnableIf<
|
||||
Internals::StringFuncs<TString>::has_equals,
|
||||
const JsonObjectSubscript<const TString &> >::type
|
||||
operator[](const TString &key) const {
|
||||
return asObject()[key];
|
||||
}
|
||||
//
|
||||
// const JsonObjectSubscript operator[](TKey) const;
|
||||
// TKey = const char*, const char[N], const FlashStringHelper*
|
||||
template <typename TString>
|
||||
FORCE_INLINE
|
||||
typename TypeTraits::EnableIf<Internals::StringFuncs<TString>::has_equals,
|
||||
JsonObjectSubscript<TString> >::type
|
||||
JsonObjectSubscript<const TString &> >::type
|
||||
operator[](const TString &key) {
|
||||
return asObject()[key];
|
||||
}
|
||||
//
|
||||
// JsonObjectSubscript operator[](TKey);
|
||||
// TKey = const std::string&, const String&
|
||||
template <typename TString>
|
||||
FORCE_INLINE typename TypeTraits::EnableIf<
|
||||
Internals::StringFuncs<TString *>::has_equals,
|
||||
JsonObjectSubscript<const TString *> >::type
|
||||
operator[](const TString *key) {
|
||||
return asObject()[key];
|
||||
}
|
||||
//
|
||||
// JsonObjectSubscript operator[](TKey);
|
||||
// TKey = const char*, const char[N], const FlashStringHelper*
|
||||
template <typename TString>
|
||||
FORCE_INLINE typename TypeTraits::EnableIf<
|
||||
Internals::StringFuncs<TString *>::has_equals,
|
||||
const JsonObjectSubscript<const TString *> >::type
|
||||
operator[](const TString *key) const {
|
||||
return asObject()[key];
|
||||
}
|
||||
|
||||
private:
|
||||
const TImpl *impl() const {
|
||||
|
||||
Reference in New Issue
Block a user