mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
JsonVariant automatically promotes to JsonObject or JsonArray on write
This commit is contained in:
@@ -9,13 +9,31 @@
|
||||
|
||||
namespace ARDUINOJSON_NAMESPACE {
|
||||
|
||||
template <typename TObject>
|
||||
template <typename TString>
|
||||
inline ArrayRef ObjectRef::createNestedArray(const TString& key) const {
|
||||
return set(key).template to<ArrayRef>();
|
||||
inline ArrayRef ObjectShortcuts<TObject>::createNestedArray(
|
||||
const TString& key) const {
|
||||
return impl()->getOrCreate(key).template to<ArrayRef>();
|
||||
}
|
||||
|
||||
template <typename TObject>
|
||||
template <typename TString>
|
||||
inline ArrayRef ObjectRef::createNestedArray(TString* key) const {
|
||||
return set(key).template to<ArrayRef>();
|
||||
inline ArrayRef ObjectShortcuts<TObject>::createNestedArray(
|
||||
TString* key) const {
|
||||
return impl()->getOrCreate(key).template to<ArrayRef>();
|
||||
}
|
||||
|
||||
template <typename TObject>
|
||||
template <typename TKey>
|
||||
ObjectRef ObjectShortcuts<TObject>::createNestedObject(const TKey& key) const {
|
||||
return impl()->getOrCreate(key).template to<ObjectRef>();
|
||||
}
|
||||
//
|
||||
// ObjectRef createNestedObject(TKey);
|
||||
// TKey = char*, const char*, char[], const char[], const __FlashStringHelper*
|
||||
template <typename TObject>
|
||||
template <typename TKey>
|
||||
ObjectRef ObjectShortcuts<TObject>::createNestedObject(TKey* key) const {
|
||||
return impl()->getOrCreate(key).template to<ObjectRef>();
|
||||
}
|
||||
} // namespace ARDUINOJSON_NAMESPACE
|
||||
|
||||
Reference in New Issue
Block a user