Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ObjectImpl.hpp
00001 // ArduinoJson - arduinojson.org 00002 // Copyright Benoit Blanchon 2014-2021 00003 // MIT License 00004 00005 #pragma once 00006 00007 #include <ArduinoJson/Array/ArrayRef.hpp> 00008 #include <ArduinoJson/Object/ObjectRef.hpp> 00009 00010 namespace ARDUINOJSON_NAMESPACE { 00011 00012 template <typename TObject> 00013 template <typename TString> 00014 inline ArrayRef ObjectShortcuts<TObject>::createNestedArray( 00015 const TString& key) const { 00016 return impl()->getOrAddMember(key).template to<ArrayRef>(); 00017 } 00018 00019 template <typename TObject> 00020 template <typename TChar> 00021 inline ArrayRef ObjectShortcuts<TObject>::createNestedArray(TChar* key) const { 00022 return impl()->getOrAddMember(key).template to<ArrayRef>(); 00023 } 00024 00025 template <typename TObject> 00026 template <typename TString> 00027 inline ObjectRef ObjectShortcuts<TObject>::createNestedObject( 00028 const TString& key) const { 00029 return impl()->getOrAddMember(key).template to<ObjectRef>(); 00030 } 00031 00032 template <typename TObject> 00033 template <typename TChar> 00034 inline ObjectRef ObjectShortcuts<TObject>::createNestedObject( 00035 TChar* key) const { 00036 return impl()->getOrAddMember(key).template to<ObjectRef>(); 00037 } 00038 00039 template <typename TObject> 00040 template <typename TString> 00041 inline typename enable_if<IsString<TString>::value, bool>::type 00042 ObjectShortcuts<TObject>::containsKey(const TString& key) const { 00043 return !impl()->getMember(key).isUndefined(); 00044 } 00045 00046 template <typename TObject> 00047 template <typename TChar> 00048 inline typename enable_if<IsString<TChar*>::value, bool>::type 00049 ObjectShortcuts<TObject>::containsKey(TChar* key) const { 00050 return !impl()->getMember(key).isUndefined(); 00051 } 00052 00053 template <typename TObject> 00054 template <typename TString> 00055 inline typename enable_if<IsString<TString*>::value, 00056 MemberProxy<TObject, TString*> >::type 00057 ObjectShortcuts<TObject>::operator[](TString* key) const { 00058 return MemberProxy<TObject, TString*>(*impl(), key); 00059 } 00060 00061 template <typename TObject> 00062 template <typename TString> 00063 inline typename enable_if<IsString<TString>::value, 00064 MemberProxy<TObject, TString> >::type 00065 ObjectShortcuts<TObject>::operator[](const TString& key) const { 00066 return MemberProxy<TObject, TString>(*impl(), key); 00067 } 00068 00069 } // namespace ARDUINOJSON_NAMESPACE
Generated on Wed Jul 13 2022 01:10:36 by
1.7.2