-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ArduinoJson6 to current 6.x release (#2795)
ArduinoJson is currently at v7 but there are many breaking changes to consider so would require a new library. This PR updates v6 to the latest release: Was v6.15.2, released15/5/20 v6.21.3 released 23/7/23 Now v6.x, released 6/11/23 FlashString (FSTR::String) support has been simplified, and includes a couple of minor patches to ArduinoJson. This ensures FlashString objects are always passed by reference.
- Loading branch information
Showing
5 changed files
with
72 additions
and
80 deletions.
There are no files selected for viewing
Submodule ArduinoJson
updated
475 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
diff --git a/src/ArduinoJson/Document/JsonDocument.hpp b/src/ArduinoJson/Document/JsonDocument.hpp | ||
index 39c1536f..1b129120 100644 | ||
--- a/src/ArduinoJson/Document/JsonDocument.hpp | ||
+++ b/src/ArduinoJson/Document/JsonDocument.hpp | ||
@@ -181,6 +181,11 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> { | ||
return {*this, key}; | ||
} | ||
|
||
+ inline detail::MemberProxy<JsonDocument&, ::String> | ||
+ operator[](const FSTR::String& key) { | ||
+ return {*this, ::String(key)}; | ||
+ } | ||
+ | ||
// Gets or sets a root object's member. | ||
// https://arduinojson.org/v6/api/jsondocument/subscript/ | ||
template <typename TChar> | ||
diff --git a/src/ArduinoJson/Object/JsonObject.hpp b/src/ArduinoJson/Object/JsonObject.hpp | ||
index 7cdc1c76..2e006b1e 100644 | ||
--- a/src/ArduinoJson/Object/JsonObject.hpp | ||
+++ b/src/ArduinoJson/Object/JsonObject.hpp | ||
@@ -115,6 +115,11 @@ class JsonObject : public detail::VariantOperators<JsonObject> { | ||
return {*this, key}; | ||
} | ||
|
||
+ inline detail::MemberProxy<JsonObject, ::String> | ||
+ operator[](const FSTR::String& key) const { | ||
+ return {*this, ::String(key)}; | ||
+ } | ||
+ | ||
// Gets or sets the member with specified key. | ||
// https://arduinojson.org/v6/api/jsonobject/subscript/ | ||
template <typename TChar> | ||
diff --git a/src/ArduinoJson/Variant/VariantRefBase.hpp b/src/ArduinoJson/Variant/VariantRefBase.hpp | ||
index 2afdda6a..6b48e102 100644 | ||
--- a/src/ArduinoJson/Variant/VariantRefBase.hpp | ||
+++ b/src/ArduinoJson/Variant/VariantRefBase.hpp | ||
@@ -244,6 +244,11 @@ class VariantRefBase : public VariantTag { | ||
MemberProxy<TDerived, TChar*>>::type | ||
operator[](TChar* key) const; | ||
|
||
+ inline MemberProxy<TDerived, ::String> | ||
+ operator[](const FSTR::String& key) const { | ||
+ return MemberProxy<TDerived, ::String>(derived(), ::String(key)); | ||
+ } | ||
+ | ||
// Creates an array and adds it to the object. | ||
// https://arduinojson.org/v6/api/jsonvariant/createnestedarray/ | ||
template <typename TString> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters