updated to latest arduinojson patch

This commit is contained in:
proddy
2021-02-27 14:45:14 +01:00
parent d1b0bd729d
commit 333c5c16c0
144 changed files with 606 additions and 434 deletions

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#include "src/ArduinoJson.h"

View File

@@ -1,6 +1,65 @@
ArduinoJson: change log
=======================
HEAD
----
* Removed support for `char` values, see below (issue #1498)
* `deserializeJson()` leaves `\uXXXX` unchanged instead of returning `NotSupported`
* `deserializeMsgPack()` inserts `null` instead of returning `NotSupported`
* Removed `DeserializationError::NotSupported`
* Added `JsonVariant::is<JsonArrayConst/JsonObjectConst>()` (issue #1412)
* Added `JsonVariant::is<JsonVariant/JsonVariantConst>()` (issue #1412)
* Changed `JsonVariantConst::is<JsonArray/JsonObject>()` to return `false` (issue #1412)
> ### BREAKING CHANGES
>
> We cannot cast a `JsonVariant` to a `char` anymore, so the following will break:
> ```c++
> char age = doc["age"]; // error: no matching function for call to 'variantAs(VariantData*&)'
> ```
> Instead, you must use another integral type, such as `int8_t`:
> ```c++
> int8_t age = doc["age"]; // OK
> ```
>
> Similarly, we cannot assign from a `char` anymore, so the following will break:
> ```c++
> char age;
> doc["age"] = age; // error: no matching function for call to 'VariantRef::set(const char&)'
> ```
> Instead, you must use another integral type, such as `int8_t`:
> ```c++
> int8_t age;
> doc["age"] = age; // OK
> ```
>
> On a different topic, `DeserializationError::NotSupported` has been removed.
> Instead of returning this error:
>
> * `deserializeJson()` leaves `\uXXXX` unchanged (only when `ARDUINOJSON_DECODE_UNICODE` is `0`)
> * `deserializeMsgPack()` replaces unsupported values with `null`s
>
> Lastly, a very minor change conserns `JsonVariantConst::is<T>()`.
> It used to return `true` for `JsonArray` and `JsonOject`, but now it returns `false`.
> Instead, you must use `JsonArrayConst` and `JsonObjectConst`.
v6.17.3 (2021-02-15)
-------
* Made `JsonDocument`'s destructor protected (issue #1480)
* Added missing calls to `client.stop()` in `JsonHttpClient.ino` (issue #1485)
* Fixed error `expected ')' before 'char'` when `isdigit()` is a macro (issue #1487)
* Fixed error `definition of implicit copy constructor is deprecated` on Clang 10
* PlatformIO: set framework compatibility to `*` (PR #1490 by @maxgerhardt)
v6.17.2 (2020-11-14)
-------
* Fixed invalid conversion error in `operator|(JsonVariant, char*)` (issue #1432)
* Changed the default value of `ARDUINOJSON_ENABLE_PROGMEM` (issue #1433).
It now checks that the `pgm_read_XXX` macros are defined before enabling `PROGMEM`.
v6.17.1 (2020-11-07)
-------

View File

@@ -1,11 +0,0 @@
# Contribution to ArduinoJson
First, thank you for taking the time to contribute to this project.
You can submit changes via GitHub Pull Requests.
Please:
1. Unit test every change in behavior
2. Use clang-format in "file" mode to format the code
3. Consider using the Continuous Integration (Travis and AppVeyor)

View File

@@ -1,7 +1,7 @@
The MIT License (MIT)
---------------------
Copyright © 2014-2020 Benoit BLANCHON
Copyright © 2014-2021 Benoit BLANCHON
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@@ -2,9 +2,9 @@
---
[![arduino-library-badge](https://www.ardu-badge.com/badge/ArduinoJson.svg?version=6.17.1)](https://www.ardu-badge.com/ArduinoJson/6.17.1)
[![Build Status](https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/6.x?svg=true)](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
[![Build Status](https://travis-ci.org/bblanchon/ArduinoJson.svg?branch=6.x)](https://travis-ci.org/bblanchon/ArduinoJson)
[![arduino-library-badge](https://www.ardu-badge.com/badge/ArduinoJson.svg?version=6.17.3)](https://www.ardu-badge.com/ArduinoJson/6.17.3)
[![Continuous Integration](https://github.com/bblanchon/ArduinoJson/workflows/Continuous%20Integration/badge.svg?branch=6.x)](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A6.x)
[![Continuous Integration](https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/6.x?svg=true)](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/arduinojson.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
[![Coverage Status](https://coveralls.io/repos/github/bblanchon/ArduinoJson/badge.svg?branch=6.x)](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x)
[![GitHub stars](https://img.shields.io/github/stars/bblanchon/ArduinoJson?style=flat)](https://github.com/bblanchon/ArduinoJson/stargazers)
@@ -19,7 +19,7 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
* [Optionally supports comments in the input](https://arduinojson.org/v6/api/config/enable_comments/?utm_source=github&utm_medium=readme)
* [Optionally filters the input to keep only desired values](https://arduinojson.org/v6/api/json/deserializejson/?utm_source=github&utm_medium=readme#filtering)
* Supports single quotes as a string delimiter
* Compatible with NDJSON and JSON Lines
* Compatible with [NDJSON](http://ndjson.org/) and [JSON Lines](https://jsonlines.org/)
* [JSON serialization](https://arduinojson.org/v6/api/json/serializejson/?utm_source=github&utm_medium=readme)
* [Can write to a buffer or a stream](https://arduinojson.org/v6/api/json/serializejson/?utm_source=github&utm_medium=readme)
* [Optionally indents the document (prettified JSON)](https://arduinojson.org/v6/api/json/serializejsonpretty/?utm_source=github&utm_medium=readme)
@@ -58,11 +58,12 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
* [IAR Embedded Workbench](https://www.iar.com/iar-embedded-workbench/)
* [Keil uVision](http://www.keil.com/)
* [MPLAB X IDE](http://www.microchip.com/mplab/mplab-x-ide)
* [Particle](https://www.particle.io/)
* [PlatformIO](http://platformio.org/)
* [Sloeber plugin for Eclipse](https://eclipse.baeyens.it/)
* [Visual Micro](http://www.visualmicro.com/)
* [Visual Studio](https://www.visualstudio.com/)
* [Even works with online compilers like wandbox.org](https://wandbox.org/permlink/t7KP7I6dVuLhqzDl)
* [Even works with online compilers like wandbox.org](https://wandbox.org/permlink/RlZSKy17DjJ6HcdN)
* [CMake friendly](https://arduinojson.org/v6/how-to/use-arduinojson-with-cmake/?utm_source=github&utm_medium=readme)
* Well designed
* [Elegant API](http://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme)
@@ -76,8 +77,8 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
* [Unit test coverage close to 100%](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x)
* Continuously tested on
* [Visual Studio 2010, 2012, 2013, 2015, 2017, 2019](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
* [GCC 4.4, 4.6, 4.7, 4.8, 4.9, 5, 6, 7, 8](https://travis-ci.org/bblanchon/ArduinoJson)
* [Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8](https://travis-ci.org/bblanchon/ArduinoJson)
* [GCC 4.4, 4.6, 4.7, 4.8, 4.9, 5, 6, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22)
* [Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22)
* [Continuously fuzzed with Google OSS Fuzz](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
* Well documented
* [Tutorials](https://arduinojson.org/v6/doc/deserialization/?utm_source=github&utm_medium=readme)
@@ -85,6 +86,7 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
* [How-tos](https://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme)
* [FAQ](https://arduinojson.org/v6/faq/?utm_source=github&utm_medium=readme)
* [Book](https://arduinojson.org/book/?utm_source=github&utm_medium=readme)
* [Changelog](changelog.md)
* Vibrant user community
* Most popular of all Arduino libraries on [GitHub](https://github.com/search?o=desc&q=arduino+library&s=stars&type=Repositories) and [PlatformIO](https://platformio.org/lib/search)
* [Used in hundreds of projects](https://www.hackster.io/search?i=projects&q=arduinojson)

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,11 +1,12 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
#include <ArduinoJson/Array/ArrayRef.hpp>
#include <ArduinoJson/Document/JsonDocument.hpp>
#include <ArduinoJson/Variant/Visitor.hpp>
namespace ARDUINOJSON_NAMESPACE {
@@ -81,38 +82,6 @@ class ArrayCopier1D : public Visitor<size_t> {
return size;
}
size_t visitObject(const CollectionData&) {
return 0;
}
size_t visitFloat(Float) {
return 0;
}
size_t visitString(const char*) {
return 0;
}
size_t visitRawJson(const char*, size_t) {
return 0;
}
size_t visitNegativeInteger(UInt) {
return 0;
}
size_t visitPositiveInteger(UInt) {
return 0;
}
size_t visitBoolean(bool) {
return 0;
}
size_t visitNull() {
return 0;
}
private:
T* _destination;
size_t _capacity;
@@ -132,14 +101,6 @@ class ArrayCopier2D : public Visitor<void> {
slot = slot->next();
}
}
void visitObject(const CollectionData&) {}
void visitFloat(Float) {}
void visitString(const char*) {}
void visitRawJson(const char*, size_t) {}
void visitNegativeInteger(UInt) {}
void visitPositiveInteger(UInt) {}
void visitBoolean(bool) {}
void visitNull() {}
private:
T (*_destination)[N1][N2];

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
@@ -172,7 +172,8 @@
#endif // ARDUINO
#ifndef ARDUINOJSON_ENABLE_PROGMEM
#ifdef PROGMEM
#if defined(PROGMEM) && defined(pgm_read_byte) && defined(pgm_read_dword) && \
defined(pgm_read_ptr) && defined(pgm_read_float)
#define ARDUINOJSON_ENABLE_PROGMEM 1
#else
#define ARDUINOJSON_ENABLE_PROGMEM 0

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
@@ -26,7 +26,6 @@ class DeserializationError {
IncompleteInput,
InvalidInput,
NoMemory,
NotSupported,
TooDeep
};
@@ -81,8 +80,8 @@ class DeserializationError {
const char* c_str() const {
static const char* messages[] = {
"Ok", "EmptyInput", "IncompleteInput", "InvalidInput",
"NoMemory", "NotSupported", "TooDeep"};
"Ok", "EmptyInput", "IncompleteInput",
"InvalidInput", "NoMemory", "TooDeep"};
ARDUINOJSON_ASSERT(static_cast<size_t>(_code) <
sizeof(messages) / sizeof(messages[0]));
return messages[_code];
@@ -95,11 +94,9 @@ class DeserializationError {
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s2, "IncompleteInput");
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s3, "InvalidInput");
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s4, "NoMemory");
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s5, "NotSupported");
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s6, "TooDeep");
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s5, "TooDeep");
ARDUINOJSON_DEFINE_STATIC_ARRAY(
const char*, messages,
ARDUINOJSON_EXPAND7({s0, s1, s2, s3, s4, s5, s6}));
const char*, messages, ARDUINOJSON_EXPAND6({s0, s1, s2, s3, s4, s5}));
return ARDUINOJSON_READ_STATIC_ARRAY(const __FlashStringHelper*, messages,
_code);
}

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
@@ -17,11 +17,11 @@ class Filter {
}
bool allowArray() const {
return _variant == true || _variant.is<ArrayRef>();
return _variant == true || _variant.is<ArrayConstRef>();
}
bool allowObject() const {
return _variant == true || _variant.is<ObjectRef>();
return _variant == true || _variant.is<ObjectConstRef>();
}
bool allowValue() const {

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
@@ -35,6 +35,11 @@ class JsonDocument : public Visitable {
_data.setNull();
}
template <typename T>
bool is() {
return getVariant().template is<T>();
}
template <typename T>
bool is() const {
return getVariant().template is<T>();
@@ -310,6 +315,8 @@ class JsonDocument : public Visitable {
_data.setNull();
}
~JsonDocument() {}
void replacePool(MemoryPool pool) {
_pool = pool;
}

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
@@ -42,8 +42,6 @@ class JsonDeserializer {
}
private:
JsonDeserializer &operator=(const JsonDeserializer &); // non-copiable
char current() {
return _latch.current();
}
@@ -386,11 +384,10 @@ class JsonDeserializer {
return false;
if (codepoint.append(codeunit))
Utf8::encodeCodepoint(codepoint.value(), _stringStorage);
continue;
#else
_error = DeserializationError::NotSupported;
return false;
_stringStorage.append('\\');
#endif
continue;
}
// replace char

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
@@ -8,11 +8,6 @@
namespace ARDUINOJSON_NAMESPACE {
template <typename TResult>
struct Visitor {
typedef TResult result_type;
};
struct Visitable {
// template<Visitor>
// void accept(Visitor&) const;
@@ -22,5 +17,5 @@ template <typename T>
struct IsVisitable : is_base_of<Visitable, T> {};
template <typename T>
struct IsVisitable<T&> : IsVisitable<T> {};
struct IsVisitable<T &> : IsVisitable<T> {};
} // namespace ARDUINOJSON_NAMESPACE

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
@@ -40,15 +40,10 @@ class MsgPackDeserializer {
return false;
}
bool notSupported() {
_error = DeserializationError::NotSupported;
return false;
}
template <typename TFilter>
bool parseVariant(VariantData &variant, TFilter filter,
NestingLimit nestingLimit) {
uint8_t code = 0;
uint8_t code = 0; // TODO: why do we need to initialize this variable?
if (!readByte(code))
return false;
@@ -74,41 +69,23 @@ class MsgPackDeserializer {
variant.setBoolean(true);
return true;
case 0xc4: // bin 8
if (allowValue)
return notSupported();
else
return skipString<uint8_t>();
case 0xc4: // bin 8 (not supported)
return skipString<uint8_t>();
case 0xc5: // bin 16
if (allowValue)
return notSupported();
else
return skipString<uint16_t>();
case 0xc5: // bin 16 (not supported)
return skipString<uint16_t>();
case 0xc6: // bin 32
if (allowValue)
return notSupported();
else
return skipString<uint32_t>();
case 0xc6: // bin 32 (not supported)
return skipString<uint32_t>();
case 0xc7: // ext 8
if (allowValue)
return notSupported();
else
return skipExt<uint8_t>();
case 0xc7: // ext 8 (not supported)
return skipExt<uint8_t>();
case 0xc8: // ext 16
if (allowValue)
return notSupported();
else
return skipExt<uint16_t>();
case 0xc8: // ext 16 (not supported)
return skipExt<uint16_t>();
case 0xc9: // ext 32
if (allowValue)
return notSupported();
else
return skipExt<uint32_t>();
case 0xc9: // ext 32 (not supported)
return skipExt<uint32_t>();
case 0xca:
if (allowValue)
@@ -141,14 +118,14 @@ class MsgPackDeserializer {
return skipBytes(4);
case 0xcf:
if (allowValue)
#if ARDUINOJSON_USE_LONG_LONG
if (allowValue)
return readInteger<uint64_t>(variant);
#else
return notSupported();
#endif
else
return skipBytes(8);
#else
return skipBytes(8); // not supported
#endif
case 0xd0:
if (allowValue)
@@ -169,44 +146,29 @@ class MsgPackDeserializer {
return skipBytes(4);
case 0xd3:
if (allowValue)
#if ARDUINOJSON_USE_LONG_LONG
if (allowValue)
return readInteger<int64_t>(variant);
else
return skipBytes(8); // not supported
#else
return notSupported();
return skipBytes(8);
#endif
else
return skipBytes(8);
case 0xd4: // fixext 1
if (allowValue)
return notSupported();
else
return skipBytes(2);
case 0xd4: // fixext 1 (not supported)
return skipBytes(2);
case 0xd5: // fixext 2
if (allowValue)
return notSupported();
else
return skipBytes(3);
case 0xd5: // fixext 2 (not supported)
return skipBytes(3);
case 0xd6: // fixext 4
if (allowValue)
return notSupported();
else
return skipBytes(5);
case 0xd6: // fixext 4 (not supported)
return skipBytes(5);
case 0xd7: // fixext 8
if (allowValue)
return notSupported();
else
return skipBytes(9);
case 0xd7: // fixext 8 (not supported)
return skipBytes(9);
case 0xd8: // fixext 16
if (allowValue)
return notSupported();
else
return skipBytes(17);
case 0xd8: // fixext 16 (not supported)
return skipBytes(17);
case 0xd9:
if (allowValue)
@@ -508,7 +470,7 @@ class MsgPackDeserializer {
return readString<uint32_t>();
default:
return notSupported();
return invalidInput();
}
}

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
@@ -46,6 +46,20 @@ class MemberProxy : public VariantOperators<MemberProxy<TObject, TStringRef> >,
template <typename TValue>
FORCE_INLINE typename enable_if<!is_array<TValue>::value, this_type &>::type
operator=(const TValue &src) {
/********************************************************************
** THIS IS NOT A BUG IN THE LIBRARY **
** -------------------------------- **
** Get a compilation error pointing here? **
** It doesn't mean the error *is* here. **
** Often, it's because you try to assign the wrong value type. **
** **
** For example: **
** char age = 42 **
** doc["age"] = age; **
** Instead, use: **
** int8_t age = 42; **
** doc["age"] = age; **
********************************************************************/
getOrAddUpstreamMember().set(src);
return *this;
}

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
@@ -54,7 +54,7 @@ template <typename TObject>
template <typename TString>
inline typename enable_if<IsString<TString*>::value,
MemberProxy<TObject, TString*> >::type
ObjectShortcuts<TObject>::operator[](TString* key) const {
ObjectShortcuts<TObject>::operator[](TString* key) const {
return MemberProxy<TObject, TString*>(*impl(), key);
}
@@ -62,7 +62,7 @@ template <typename TObject>
template <typename TString>
inline typename enable_if<IsString<TString>::value,
MemberProxy<TObject, TString> >::type
ObjectShortcuts<TObject>::operator[](const TString& key) const {
ObjectShortcuts<TObject>::operator[](const TString& key) const {
return MemberProxy<TObject, TString>(*impl(), key);
}

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
@@ -8,9 +8,11 @@
namespace ARDUINOJSON_NAMESPACE {
#ifndef isdigit
inline bool isdigit(char c) {
return '0' <= c && c <= '9';
}
#endif
inline bool issign(char c) {
return '-' == c || c == '+';

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,11 +1,10 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
#define ARDUINOJSON_EXPAND6(a, b, c, d, e, f) a, b, c, d, e, f
#define ARDUINOJSON_EXPAND7(a, b, c, d, e, f, g) a, b, c, d, e, f, g
#define ARDUINOJSON_EXPAND9(a, b, c, d, e, f, g, h, i) a, b, c, d, e, f, g, h, i
#define ARDUINOJSON_EXPAND18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, \
q, r) \

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once
@@ -12,10 +12,12 @@
#pragma warning(disable : 4244)
#endif
// clang-format off
#ifdef __ICCARM__
// Suppress IAR Compiler Warning[Pa093]: implicit conversion from floating point to integer
#pragma diag_suppress=Pa093
#endif
// clang-format on
namespace ARDUINOJSON_NAMESPACE {
@@ -38,6 +40,8 @@ struct is_convertible {
#pragma warning(pop)
#endif
// clang-format off
#ifdef __ICCARM__
#pragma diag_default=Pa093
#endif
// clang-format on

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// Copyright Benoit Blanchon 2014-2021
// MIT License
#pragma once

Some files were not shown because too many files have changed in this diff Show More