mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-27 17:27:30 +02:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
815326d42e | |||
7d40a541c9 | |||
2507ee2e56 | |||
a0a451195b | |||
ce247a5637 | |||
59f9c9747f |
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1 @@
|
||||
custom: https://arduinojson.org/book/
|
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,6 +1,17 @@
|
||||
ArduinoJson: change log
|
||||
=======================
|
||||
|
||||
v6.11.2 (2019-07-08)
|
||||
-------
|
||||
|
||||
* Fixed assignment of `JsonDocument` to `JsonVariant` (issue #1023)
|
||||
* Fix invalid conversion error on Particle Argon (issue #1035)
|
||||
|
||||
v6.11.1 (2019-06-21)
|
||||
-------
|
||||
|
||||
* Fixed `serialized()` not working with Flash strings (issue #1030)
|
||||
|
||||
v6.11.0 (2019-05-26)
|
||||
-------
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
---
|
||||
|
||||
[](https://www.ardu-badge.com/ArduinoJson/6.11.0)
|
||||
[](https://www.ardu-badge.com/ArduinoJson/6.11.2)
|
||||
[](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
|
||||
[](https://travis-ci.org/bblanchon/ArduinoJson)
|
||||
[](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x)
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: 6.11.0.{build}
|
||||
version: 6.11.2.{build}
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
|
@ -7,7 +7,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/bblanchon/ArduinoJson.git"
|
||||
},
|
||||
"version": "6.11.0",
|
||||
"version": "6.11.2",
|
||||
"authors": {
|
||||
"name": "Benoit Blanchon",
|
||||
"url": "https://blog.benoitblanchon.fr"
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=ArduinoJson
|
||||
version=6.11.0
|
||||
version=6.11.2
|
||||
author=Benoit Blanchon <blog.benoitblanchon.fr>
|
||||
maintainer=Benoit Blanchon <blog.benoitblanchon.fr>
|
||||
sentence=An efficient and elegant JSON library for Arduino.
|
||||
|
@ -18,7 +18,7 @@ struct ArduinoStreamReader {
|
||||
|
||||
int read() {
|
||||
// don't use _stream.read() as it ignores the timeout
|
||||
uint8_t c;
|
||||
char c;
|
||||
return _stream.readBytes(&c, 1) ? c : -1;
|
||||
}
|
||||
};
|
||||
|
@ -278,6 +278,10 @@ class JsonDocument : public Visitable {
|
||||
_data.remove(adaptString(key));
|
||||
}
|
||||
|
||||
FORCE_INLINE operator VariantConstRef() const {
|
||||
return VariantConstRef(&_data);
|
||||
}
|
||||
|
||||
protected:
|
||||
JsonDocument(MemoryPool pool) : _pool(pool) {
|
||||
_data.setNull();
|
||||
|
@ -29,7 +29,7 @@ class SizedFlashStringAdapter {
|
||||
char* save(MemoryPool* pool) const {
|
||||
if (!_str) return NULL;
|
||||
char* dup = pool->allocFrozenString(_size);
|
||||
if (!dup) memcpy_P(dup, (const char*)_str, _size);
|
||||
if (dup) memcpy_P(dup, (const char*)_str, _size);
|
||||
return dup;
|
||||
}
|
||||
|
||||
|
@ -222,6 +222,7 @@ class VariantRef : public VariantRefBase<VariantData>,
|
||||
// set(ArrayConstRef)
|
||||
// set(ObjectRef)
|
||||
// set(ObjecConstRef)
|
||||
// set(const JsonDocument&)
|
||||
template <typename TVariant>
|
||||
typename enable_if<IsVisitable<TVariant>::value, bool>::type set(
|
||||
const TVariant &value) const;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define ARDUINOJSON_VERSION "6.11.0"
|
||||
#define ARDUINOJSON_VERSION "6.11.2"
|
||||
#define ARDUINOJSON_VERSION_MAJOR 6
|
||||
#define ARDUINOJSON_VERSION_MINOR 11
|
||||
#define ARDUINOJSON_VERSION_REVISION 0
|
||||
#define ARDUINOJSON_VERSION_REVISION 2
|
||||
|
@ -108,3 +108,19 @@ TEST_CASE("JsonVariant with not enough memory") {
|
||||
REQUIRE(v.isNull());
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("JsonVariant::set(DynamicJsonDocument)") {
|
||||
DynamicJsonDocument doc1(1024);
|
||||
doc1["hello"] = "world";
|
||||
|
||||
DynamicJsonDocument doc2(1024);
|
||||
JsonVariant v = doc2.to<JsonVariant>();
|
||||
|
||||
// Should copy the doc
|
||||
v.set(doc1);
|
||||
doc1.clear();
|
||||
|
||||
std::string json;
|
||||
serializeJson(doc2, json);
|
||||
REQUIRE(json == "{\"hello\":\"world\"}");
|
||||
}
|
||||
|
Reference in New Issue
Block a user