Update to ArduinoJson 7.0.4

This commit is contained in:
iranl
2024-04-19 14:44:01 +02:00
parent 1378732081
commit 81be0a689a
444 changed files with 10842 additions and 9422 deletions

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org
// Copyright © 2014-2023, Benoit BLANCHON
// Copyright © 2014-2024, Benoit BLANCHON
// MIT License
#include <ArduinoJson.h>
@@ -12,25 +12,25 @@ class CustomWriter {
CustomWriter& operator=(const CustomWriter&) = delete;
size_t write(uint8_t c) {
_str.append(1, static_cast<char>(c));
str_.append(1, static_cast<char>(c));
return 1;
}
size_t write(const uint8_t* s, size_t n) {
_str.append(reinterpret_cast<const char*>(s), n);
str_.append(reinterpret_cast<const char*>(s), n);
return n;
}
const std::string& str() const {
return _str;
return str_;
}
private:
std::string _str;
std::string str_;
};
TEST_CASE("CustomWriter") {
DynamicJsonDocument doc(4096);
JsonDocument doc;
JsonArray array = doc.to<JsonArray>();
array.add(4);
array.add(2);