Benoit Blanchon
f806a42cc2
Add support for escape sequence \'
...
Fixes #2124
2024-09-17 10:33:47 +02:00
Benoit Blanchon
a1809d0f31
Replace sizeof(VariantData) with sizeof(SlotData)
2024-09-10 18:26:58 +02:00
Benoit Blanchon
d92eee8736
Deprecate containsKey() in favor of doc["key"].is<T>()
...
See #2121
2024-09-06 17:32:09 +02:00
Benoit Blanchon
3b64197869
MsgPackDeserializer: check extension allocation result
2024-09-04 14:34:02 +02:00
Benoit Blanchon
1f7a3f3174
JsonDeserializer: use float when the value has few digits
2024-09-04 14:33:14 +02:00
Benoit Blanchon
fd6314e132
Move some numbers tests to use_double_0.cpp
2024-09-04 14:29:19 +02:00
Benoit Blanchon
e4e2557b76
Move test of decomposeFloat()
2024-09-03 13:27:39 +02:00
Benoit Blanchon
3b6bf45b8a
Serialize float with less decimal places than double
2024-09-03 11:44:35 +02:00
Benoit Blanchon
33452c1f37
Test JsonVariant::as<T>() with extension slots
2024-08-27 16:08:47 +02:00
Benoit Blanchon
ee02c0d573
Test extension slot allocation failure
2024-08-27 16:08:47 +02:00
Benoit Blanchon
7643dadaec
WIP
2024-08-27 14:40:24 +02:00
Benoit Blanchon
e297932a98
Store 64-bit numbers (double and long long) in an additional slot
...
This change allows slots to be twices maller on 32-bit architectures.
See #1650 and #2103
2024-08-27 08:02:09 +02:00
Benoit Blanchon
4ada3f849c
Decouple parseNumber() from VariantData
2024-08-25 16:46:55 +02:00
Benoit Blanchon
362201241f
Make MemoryPool generic
2024-08-25 14:58:23 +02:00
Benoit Blanchon
2be24eded8
Rename SlotWithId::slot() and VariantWithId::data() to ptr()
2024-08-25 14:54:45 +02:00
Benoit Blanchon
4327f72140
Remove VariantSlot
2024-08-25 14:45:59 +02:00
Benoit Blanchon
f2894552f2
Rename VariantPool to MemoryPool
2024-08-25 14:36:38 +02:00
Benoit Blanchon
d3721cb122
Make VariantSlot a union. Include next slot id in VariantData
2024-08-24 19:20:39 +02:00
Benoit Blanchon
09c89dcacf
Store object members with two slots: one for the key and one for the value
2024-08-24 10:45:51 +02:00
Benoit Blanchon
386105be90
Allocate slot before key
2024-08-23 15:27:46 +02:00
Benoit Blanchon
55c3b9b3a7
CI: update macOS runner to macos-13
2024-06-18 13:51:40 +02:00
Benoit Blanchon
e34c27723a
Fix build on modern compilers
2024-06-18 13:51:40 +02:00
Benoit Blanchon
556785dc1e
Read MsgPack's 64-bit ints even if ARDUINOJSON_USE_LONG_LONG is 0
2024-06-18 13:50:50 +02:00
Benoit Blanchon
208e7a3304
Fix integer overflow in MsgPackDeserializer
2024-06-11 09:47:11 +02:00
Benoit Blanchon
45611924f3
Tests: add user-defined literal ""_s for std::string
2024-06-07 09:35:45 +02:00
Benoit Blanchon
e4f3fd8c91
Add support for MsgPack extension
2024-06-06 18:33:48 +02:00
Benoit Blanchon
aec642be20
Rename tests in MixedConfiguration
2024-06-06 18:26:16 +02:00
Benoit Blanchon
5a60c55be7
Don't add partial objects when allocation fails
...
Fixes #2081
2024-05-23 18:36:24 +02:00
Benoit Blanchon
9e0c56acc3
Replace ConverterNeedsWriteableRef with function_traits
2024-05-22 09:27:14 +02:00
Benoit Blanchon
60f9f7eff6
Move CollectionData::releaseSlot() to ResourceManager::freeSlot()
2024-05-17 17:10:45 +02:00
Benoit Blanchon
98fca74f66
Fix undefined reference to VariantPool::usage()
2024-05-16 17:47:07 +02:00
Benoit Blanchon
60fb268d9a
Fix UBSAN error "member call does not point to an object of type"
...
runtime error: member call on address XXX which does not point to an object of type 'Allocator'
XXX: note: object is of type 'SpyingAllocator'
This is due to the fact that some of the compilation units have different library settings, so a different namespace, and therefore a different `Allocator` class.
2024-05-16 17:47:07 +02:00
Benoit Blanchon
aeb30ef307
Support ElementProxy and MemberProxy in JsonDocument's constructor
2024-05-15 13:37:33 +02:00
Benoit Blanchon
1c5e5db071
Test JsonDocument constructor with a JsonVariantConst argument
...
See #2091
2024-05-15 09:30:22 +02:00
Benoit Blanchon
68a13117dc
Allow using a JsonVariant as a key or index
...
Closes #2080
2024-05-14 21:06:02 +02:00
Benoit Blanchon
071f718473
MsgPack: test failing string allocation
2024-05-06 11:23:20 +02:00
Benoit Blanchon
00949f8276
Remove redundant test
2024-05-06 11:16:55 +02:00
Benoit Blanchon
2c670e0148
Implement MsgPackBinary using raw strings and converters
2024-05-06 11:10:02 +02:00
Benoit Blanchon
5f5f927693
Add tests of as<MsgPackBinary>()
2024-05-01 19:26:19 +02:00
Benoit Blanchon
4d074840da
Optimize deserializeMsgPack()
2024-05-01 18:00:59 +02:00
Benoit Blanchon
4d5c17b5f6
Remove unused #include statements
2024-04-29 18:30:29 +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
RoboSchmied
0d43e51d48
Fix typo in "endianness"
...
Closes #2071
2024-03-26 13:43:07 +01:00
Benoit Blanchon
af8c615266
Rename tests/JsonObject/copy.cpp to set.cpp
2024-03-16 14:02:56 +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
72642e3090
Fix compatibility with GCC 4.8
...
Closes #2045
2024-02-01 21:37:45 +01:00
Benoit Blanchon
1b143d383b
Fix assertion poolIndex < count_ after JsonDocument::clear()
...
Fixes #2034
2024-01-16 10:10:43 +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
315cc722e9
Add more tests for JsonVariantConst
2024-01-08 19:47:40 +01:00