mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-03 13:46:46 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
40ee05c065 | |||
632cb279f1 | |||
6e641ae0b0 | |||
5d1d2721d1 | |||
3e1be980d9 |
17
.github/workflows/release.yml
vendored
17
.github/workflows/release.yml
vendored
@ -76,3 +76,20 @@ jobs:
|
||||
- name: Publish
|
||||
run: bash -eux extras/scripts/publish-particle-library.sh
|
||||
timeout-minutes: 5
|
||||
|
||||
platformio:
|
||||
name: PlatformIO
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- name: Install PlatformIO
|
||||
run: pip install platformio
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Publish
|
||||
run: pio pkg publish --no-interactive --no-notify
|
||||
env:
|
||||
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
|
||||
|
@ -1,6 +1,13 @@
|
||||
ArduinoJson: change log
|
||||
=======================
|
||||
|
||||
v6.21.5 (2024-01-10)
|
||||
-------
|
||||
|
||||
* Fix warning `function returns incomplete class type` on IAR (issue #2001)
|
||||
* Fix `volatile bool` serialized as `1` or `0` instead of `true` or `false` (issue #2029)
|
||||
* Remove unused files in the PlatformIO package
|
||||
|
||||
v6.21.4 (2023-12-07)
|
||||
-------
|
||||
|
||||
|
@ -10,7 +10,7 @@ if(ESP_PLATFORM)
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(ArduinoJson VERSION 6.21.4)
|
||||
project(ArduinoJson VERSION 6.21.5)
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
include(CTest)
|
||||
|
@ -8,9 +8,9 @@
|
||||
[](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
|
||||
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
|
||||
[](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x)
|
||||
[](https://www.ardu-badge.com/ArduinoJson/6.21.4)
|
||||
[](https://registry.platformio.org/packages/libraries/bblanchon/ArduinoJson?version=6.21.4)
|
||||
[](https://components.espressif.com/components/bblanchon/arduinojson)
|
||||
[](https://www.ardu-badge.com/ArduinoJson/6.21.5)
|
||||
[](https://registry.platformio.org/packages/libraries/bblanchon/ArduinoJson?version=6.21.5)
|
||||
[](https://components.espressif.com/components/bblanchon/arduinojson)
|
||||
[](https://github.com/bblanchon/ArduinoJson/stargazers)
|
||||
[](https://github.com/sponsors/bblanchon)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: 6.21.4.{build}
|
||||
version: 6.21.5.{build}
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
|
||||
|
@ -140,6 +140,13 @@ TEST_CASE("volatile") {
|
||||
DynamicJsonDocument doc(4096);
|
||||
JsonVariant variant = doc.to<JsonVariant>();
|
||||
|
||||
SECTION("volatile bool") { // issue #2029
|
||||
volatile bool f = true;
|
||||
variant.set(f);
|
||||
CHECK(variant.is<bool>() == true);
|
||||
CHECK(variant.as<bool>() == true);
|
||||
}
|
||||
|
||||
SECTION("volatile int") {
|
||||
volatile int f = 42;
|
||||
variant.set(f);
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: "6.21.4"
|
||||
version: "6.21.5"
|
||||
description: >-
|
||||
A simple and efficient JSON library for embedded C++.
|
||||
ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more.
|
||||
|
10
library.json
10
library.json
@ -7,16 +7,14 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/bblanchon/ArduinoJson.git"
|
||||
},
|
||||
"version": "6.21.4",
|
||||
"version": "6.21.5",
|
||||
"authors": {
|
||||
"name": "Benoit Blanchon",
|
||||
"url": "https://blog.benoitblanchon.fr"
|
||||
},
|
||||
"exclude": [
|
||||
".devcontainer",
|
||||
".github",
|
||||
"extras"
|
||||
],
|
||||
"export": {
|
||||
"include": ["src", "examples", "LICENSE.txt", "ArduinoJson.h"]
|
||||
},
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
"build": {
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=ArduinoJson
|
||||
version=6.21.4
|
||||
version=6.21.5
|
||||
author=Benoit Blanchon <blog.benoitblanchon.fr>
|
||||
maintainer=Benoit Blanchon <blog.benoitblanchon.fr>
|
||||
sentence=A simple and efficient JSON library for embedded C++.
|
||||
|
@ -110,6 +110,13 @@ inline JsonVariant VariantRefBase<TDerived>::add() const {
|
||||
variantAddElement(getOrCreateData(), getPool()));
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
template <typename T>
|
||||
inline typename enable_if<ConverterNeedsWriteableRef<T>::value, T>::type
|
||||
VariantRefBase<TDerived>::as() const {
|
||||
return Converter<T>::fromJson(getVariant());
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
inline JsonVariant VariantRefBase<TDerived>::getVariant() const {
|
||||
return JsonVariant(getPool(), getData());
|
||||
@ -120,6 +127,30 @@ inline JsonVariant VariantRefBase<TDerived>::getOrCreateVariant() const {
|
||||
return JsonVariant(getPool(), getOrCreateData());
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
template <typename T>
|
||||
inline typename enable_if<ConverterNeedsWriteableRef<T>::value, bool>::type
|
||||
VariantRefBase<TDerived>::is() const {
|
||||
return Converter<T>::checkJson(getVariant());
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
template <typename T>
|
||||
inline bool VariantRefBase<TDerived>::set(const T& value) const {
|
||||
Converter<typename detail::remove_cv<T>::type>::toJson(value,
|
||||
getOrCreateVariant());
|
||||
MemoryPool* pool = getPool();
|
||||
return pool && !pool->overflowed();
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
template <typename T>
|
||||
inline bool VariantRefBase<TDerived>::set(T* value) const {
|
||||
Converter<T*>::toJson(value, getOrCreateVariant());
|
||||
MemoryPool* pool = getPool();
|
||||
return pool && !pool->overflowed();
|
||||
}
|
||||
|
||||
template <typename TDerived>
|
||||
template <typename T>
|
||||
inline typename enable_if<is_same<T, JsonArray>::value, JsonArray>::type
|
||||
|
@ -57,9 +57,7 @@ class VariantRefBase : public VariantTag {
|
||||
// https://arduinojson.org/v6/api/jsonvariant/as/
|
||||
template <typename T>
|
||||
FORCE_INLINE typename enable_if<ConverterNeedsWriteableRef<T>::value, T>::type
|
||||
as() const {
|
||||
return Converter<T>::fromJson(getVariant());
|
||||
}
|
||||
as() const;
|
||||
|
||||
template <typename T,
|
||||
typename = typename enable_if<!is_same<T, TDerived>::value>::type>
|
||||
@ -92,9 +90,7 @@ class VariantRefBase : public VariantTag {
|
||||
template <typename T>
|
||||
FORCE_INLINE
|
||||
typename enable_if<ConverterNeedsWriteableRef<T>::value, bool>::type
|
||||
is() const {
|
||||
return Converter<T>::checkJson(getVariant());
|
||||
}
|
||||
is() const;
|
||||
|
||||
// Returns true if the value is of the specified type.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/is/
|
||||
@ -123,20 +119,12 @@ class VariantRefBase : public VariantTag {
|
||||
// Copies the specified value.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/set/
|
||||
template <typename T>
|
||||
FORCE_INLINE bool set(const T& value) const {
|
||||
Converter<T>::toJson(value, getOrCreateVariant());
|
||||
MemoryPool* pool = getPool();
|
||||
return pool && !pool->overflowed();
|
||||
}
|
||||
FORCE_INLINE bool set(const T& value) const;
|
||||
|
||||
// Copies the specified value.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/set/
|
||||
template <typename T>
|
||||
FORCE_INLINE bool set(T* value) const {
|
||||
Converter<T*>::toJson(value, getOrCreateVariant());
|
||||
MemoryPool* pool = getPool();
|
||||
return pool && !pool->overflowed();
|
||||
}
|
||||
FORCE_INLINE bool set(T* value) const;
|
||||
|
||||
// Returns the size of the array or object.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/size/
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define ARDUINOJSON_VERSION "6.21.4"
|
||||
#define ARDUINOJSON_VERSION "6.21.5"
|
||||
#define ARDUINOJSON_VERSION_MAJOR 6
|
||||
#define ARDUINOJSON_VERSION_MINOR 21
|
||||
#define ARDUINOJSON_VERSION_REVISION 4
|
||||
#define ARDUINOJSON_VERSION_MACRO V6214
|
||||
#define ARDUINOJSON_VERSION_REVISION 5
|
||||
#define ARDUINOJSON_VERSION_MACRO V6215
|
||||
|
Reference in New Issue
Block a user