Commit Graph
558 Commits
Author SHA1 Message Date
Benoit Blanchon 4d074840da Optimize deserializeMsgPack() 2024-05-01 18:00:59 +02:00
David Gauchard 82de20ee14 Make string support even more generic
Ported from 57354de831
Closes #2084
2024-05-01 14:06:30 +02:00
Aubrey (Sanae) 18a9a5b590 Add MsgPack bin8/bin16/bin32 support
Closes #2078
Closes #922
2024-04-29 16:01:10 +02:00
Benoit Blanchon 2cfefe22ac Add ARDUINOJSON_STRING_LENGTH_SIZE to the namespace name 2024-04-18 14:19:43 +02:00
Benoit Blanchon 36e1eecc7d Set version to 7.0.4 2024-03-12 09:40:46 +01:00
Benoit Blanchon f17fc055d3 Make JSON_STRING_SIZE(N) return N+1 to fix third-party code
ThingsBoard uses this macro to compute size of char arrays ಠ_ಠ
https://github.com/thingsboard/thingsboard-client-sdk/blob/v0.12.2/src/Helper.h#L38

Closes #2054
2024-02-18 20:00:25 +01:00
Benoit Blanchon 04ac53d114 Remove final from JsonArray, JsonObject, and JsonVariant
`final` breaks ThingsBoard ಠ_ಠ
https://github.com/thingsboard/thingsboard-client-sdk/blob/v0.12.2/src/RPC_Response.h#L10

See #2056.
This reverts commit 483a2c9101.
2024-02-18 20:00:24 +01:00
Benoit Blanchon 483a2c9101 Mark JsonArray, JsonObject, and JsonVariant as final
See #2056
2024-02-18 10:52:07 +01:00
Benoit Blanchon 848c0cdc7e Set version to 7.0.3 2024-02-05 13:34:38 +01:00
Benoit Blanchon cb0dc94db4 Remove most FORCE_INLINEs
I kept only the ones that had a positive impact on code size AND no negative impact on stack memory.

Fixes #2046
2024-02-05 11:48:27 +01:00
Benoit Blanchon 72642e3090 Fix compatibility with GCC 4.8
Closes #2045
2024-02-01 21:37:45 +01:00
Benoit Blanchon 296fe79bfd Stop using CollectionIterator in JsonSerializer
This reduces stack consumption and code size.
See  #2046
2024-02-01 10:24:00 +01:00
Benoit Blanchon 650d537b5d Improve error messages when using char or char*
See #2043
2024-01-26 10:34:49 +01:00
Benoit Blanchon 0435945a62 Set version to 7.0.2 2024-01-19 14:36:16 +01:00
Benoit Blanchon 1b143d383b Fix assertion poolIndex < count_ after JsonDocument::clear()
Fixes #2034
2024-01-16 10:10:43 +01:00
Benoit Blanchon 94783fdd2a Set version to 7.0.1 2024-01-10 21:14:07 +01:00
Benoit Blanchon a7bfc2212c Fix volatile bool serialized as 1 or 0
Ported from 5d1d2721d1
2024-01-10 14:03:12 +01:00
Benoit Blanchon 3571db6290 Remove unused files in the PlatformIO package 2024-01-04 18:01:52 +01:00
Benoit Blanchon cc42373367 Fix "no matching function" with JsonObjectConst::operator[]
Fixes #2019
2024-01-03 16:30:44 +01:00
Benoit Blanchon 9dc43d14f3 Set version to 7.0.0 2024-01-03 09:19:34 +01:00
Benoit Blanchon 3fa6b6e04f Fix typo in change log 2024-01-03 09:19:14 +01:00
Benoit Blanchon e93fd7657f Add a "Breaking changes" section to the changelog 2023-08-10 09:54:47 +02:00
Benoit Blanchon 7f459adc4b Remove createNestedArray() and createNestedObject() 2023-08-09 12:08:21 +02:00
Benoit Blanchon f422b7b37d Replace add() with add<T>() (add(T) is still supported) 2023-08-09 10:57:52 +02:00
Benoit Blanchon af6954c224 serializeXxx() sets std::string and String instead of appending 2023-07-31 18:37:35 +02:00
Benoit Blanchon 218a12ca46 Call shrinkToFit() in deserializeJson() and deserializeMsgPack() 2023-07-31 17:34:17 +02:00
Benoit Blanchon 43eed00cd9 Add deserializeXxx(JsonVariant, ...) (resolves #1226) 2023-07-29 12:05:18 +02:00
Benoit Blanchon db5b5f9ee2 Fix a typo in the changelog 2023-07-29 06:33:44 +02:00
Benoit Blanchon a8329564e2 Remove JsonDocument::garbageCollect() 2023-07-25 14:37:25 +02:00
Benoit Blanchon 00c9d8680a Remove memoryUsage() 2023-07-24 17:21:25 +02:00
Benoit Blanchon 5458e916ea Show a link to the doc when user passes an unsupported input type
Ported from 7eec01cdd6
2023-07-23 18:08:21 +02:00
Benoit Blanchon 727a1013ca Recycle removed slots 2023-07-20 18:04:06 +02:00
Benoit Blanchon 0f319e7ca4 Remove capacity from JsonDocument's constructor 2023-07-18 09:08:55 +02:00
Benoit Blanchon 39e8b63746 Remove shallowCopy() 2023-07-17 11:20:46 +02:00
Benoit Blanchon 01b9b40bd2 Include ARDUINOJSON_SLOT_OFFSET_SIZE in the namespace name
Ported from 433fb4b961
2023-07-12 15:01:28 +02:00
Benoit Blanchon c8517ee5b6 Fix double call to size() in serializeMsgPack()
Ported from afbcc2106e
2023-07-12 12:00:23 +02:00
Benoit Blanchon 23b01a89b1 Fix double lookup in to<JsonVariant>() 2023-07-05 16:18:35 +02:00
Benoit Blanchon 37357086e2 Remove the zero-copy mode
After removing the string size from `VariantContent`, `deserializeJson()` and `deserializeMsgPack()` could not support NUL in strings in the zero-copy mode anymore.
Instead of adding a complicated warning in the documentation, I thought it was better to remove the zero-copy mode entirely.
The zero-copy mode has always been a source of bugs because many users used it without realizing it.
Also, the memory savings are smaller now that we deduplicate strings, so this feature should not be missed much.
2023-05-10 09:55:21 +02:00
Benoit Blanchon 806fa907ab Always store serialized("string") by copy (#1915) 2023-05-02 09:36:40 +02:00
Benoit Blanchon 003087406c Reference-count shared strings 2023-04-21 16:11:54 +02:00
Benoit Blanchon d8f3058efa Store the strings in the heap 2023-04-17 10:42:08 +02:00
Benoit Blanchon c4b879645a Remove JsonDocument::capacity() 2023-04-03 09:51:43 +02:00
Benoit Blanchon 035c913c72 Remove ARDUINOJSON_ENABLE_STRING_DEDUPLICATION 2023-03-29 19:28:44 +02:00
Benoit Blanchon 3f43c2b816 Remove JSON_ARRAY_SIZE(), JSON_OBJECT_SIZE(), and JSON_STRING_SIZE() 2023-03-29 19:18:06 +02:00
Benoit Blanchon 540901e219 Merge DynamicJsonDocument with JsonDocument 2023-03-20 14:49:51 +01:00
Benoit Blanchon db9258bcd7 Remove BasicJsonDocument 2023-03-20 14:49:08 +01:00
Benoit Blanchon 24aaab6e3e Add abstract Allocator class 2023-03-20 14:47:27 +01:00
Benoit Blanchon 17a482a9b1 Remove StaticJsonDocument 2023-03-20 10:40:35 +01:00
Benoit Blanchon de9239caab Set version to 6.21.0 2023-03-14 21:05:56 +01:00
Benoit Blanchon c89a2025ce Make string support generic (issue #1807) 2023-03-13 12:19:05 +01:00