mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 08:42:39 +01:00 
			
		
		
		
	Element proxy
This commit is contained in:
		| @@ -204,3 +204,11 @@ TEST_CASE("ElementProxy::operator[]") { | ||||
|     REQUIRE(doc.as<std::string>() == "[null,[null,null,42]]"); | ||||
|   } | ||||
| } | ||||
|  | ||||
| TEST_CASE("ElementProxy::link()") { | ||||
|   StaticJsonDocument<1024> doc1, doc2; | ||||
|   doc1[0].link(doc2); | ||||
|   doc2["hello"] = "world"; | ||||
|  | ||||
|   CHECK(doc1.as<std::string>() == "[{\"hello\":\"world\"}]"); | ||||
| } | ||||
|   | ||||
| @@ -92,6 +92,10 @@ class ElementProxy : public VariantOperators<ElementProxy<TArray> >, | ||||
|     return getOrAddUpstreamElement().template to<T>(); | ||||
|   } | ||||
|  | ||||
|   FORCE_INLINE void link(VariantConstRef value) const { | ||||
|     getOrAddUpstreamElement().link(value); | ||||
|   } | ||||
|  | ||||
|   // Replaces the value | ||||
|   // | ||||
|   // bool set(const TValue&) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user