forked from bblanchon/ArduinoJson
Improve message when user forgets third arg of serializeJson()
et al.
See #1449, #1491, #1543, #1665, and #2122
This commit is contained in:
@ -7,6 +7,7 @@ HEAD
|
||||
* Store object members with two slots: one for the key and one for the value
|
||||
* Store 64-bit numbers (`double` and `long long`) in an additional slot
|
||||
* Reduce the slot size (see table below)
|
||||
* Improve message when user forgets third arg of `serializeJson()` et al.
|
||||
|
||||
| Architecture | before | after |
|
||||
|--------------|----------|----------|
|
||||
|
@ -129,7 +129,8 @@ ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE
|
||||
// Produces a minified JSON document.
|
||||
// https://arduinojson.org/v7/api/json/serializejson/
|
||||
template <typename TDestination>
|
||||
size_t serializeJson(JsonVariantConst source, TDestination& destination) {
|
||||
detail::enable_if_t<!detail::is_pointer<TDestination>::value, size_t>
|
||||
serializeJson(JsonVariantConst source, TDestination& destination) {
|
||||
using namespace detail;
|
||||
return serialize<JsonSerializer>(source, destination);
|
||||
}
|
||||
|
@ -84,7 +84,8 @@ ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE
|
||||
// Produces JsonDocument to create a prettified JSON document.
|
||||
// https://arduinojson.org/v7/api/json/serializejsonpretty/
|
||||
template <typename TDestination>
|
||||
size_t serializeJsonPretty(JsonVariantConst source, TDestination& destination) {
|
||||
detail::enable_if_t<!detail::is_pointer<TDestination>::value, size_t>
|
||||
serializeJsonPretty(JsonVariantConst source, TDestination& destination) {
|
||||
using namespace ArduinoJson::detail;
|
||||
return serialize<PrettyJsonSerializer>(source, destination);
|
||||
}
|
||||
|
@ -219,7 +219,8 @@ ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE
|
||||
// Produces a MessagePack document.
|
||||
// https://arduinojson.org/v7/api/msgpack/serializemsgpack/
|
||||
template <typename TDestination>
|
||||
inline size_t serializeMsgPack(JsonVariantConst source, TDestination& output) {
|
||||
detail::enable_if_t<!detail::is_pointer<TDestination>::value, size_t>
|
||||
serializeMsgPack(JsonVariantConst source, TDestination& output) {
|
||||
using namespace ArduinoJson::detail;
|
||||
return serialize<MsgPackSerializer>(source, output);
|
||||
}
|
||||
|
Reference in New Issue
Block a user