Minh Nguyen / ArduinoJson
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ArrayImpl.hpp Source File

ArrayImpl.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 TArray>
00013 inline ArrayRef ArrayShortcuts<TArray>::createNestedArray() const {
00014   return impl()->addElement().template to<ArrayRef>();
00015 }
00016 
00017 template <typename TArray>
00018 inline ObjectRef ArrayShortcuts<TArray>::createNestedObject() const {
00019   return impl()->addElement().template to<ObjectRef>();
00020 }
00021 
00022 template <typename TArray>
00023 inline ElementProxy<TArray> ArrayShortcuts<TArray>::operator[](
00024     size_t index) const {
00025   return ElementProxy<TArray>(*impl(), index);
00026 }
00027 
00028 }  // namespace ARDUINOJSON_NAMESPACE