109 Commits

Author SHA1 Message Date
Benoit Blanchon 7823e4a62b Update copyright year 2026-07-06 18:35:16 +02:00
Benoit Blanchon 21144d5691 Don't rely on array size to get the length of string literals
See #2189
2025-10-24 16:18:41 +02:00
Benoit Blanchon db2eec46c7 Add a pool dedicated to 8-byte values (double/int64_t/uint64_t)
This new pool replaced the "extension" slot where a secondary variant slot was used to store 8-byte values.
2025-08-30 09:55:32 +02:00
Benoit Blanchon dddc4912c4 Don't store string literals by pointer anymore
Fixes #2189
2025-08-28 10:04:11 +02:00
Benoit Blanchon 91397f9f06 Optimize storage of tiny strings (up to 3 characters) 2025-04-09 08:55:08 +02:00
Benoit Blanchon 67dd3120e6 Fix conversion from static string to number 2025-02-27 11:01:51 +01:00
Benoit Blanchon 01e49b33b7 Update copyright year 2025-02-24 15:18:26 +01:00
Benoit Blanchon e33e78d202 Rename undocumented JsonString::isLinked() to isStatic() 2024-11-26 14:32:50 +01:00
Benoit Blanchon ed5f890d28 Replace JsonString::Ownership with bool 2024-11-26 14:32:36 +01:00
Benoit Blanchon 594dc707cb Change string copy policy: only string literal are stored by pointer 2024-11-25 12:25:59 +01:00
Benoit Blanchon e007d71b4f Fix operator[](variant) ignoring NUL characters 2024-11-14 14:56:47 +01:00
Benoit Blanchon 31253dbe13 Add more tests with VLAs 2024-11-08 09:37:49 +01:00
Benoit Blanchon c6c0649d70 Replace typedef with using 2024-10-23 15:54:08 +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 1f7a3f3174 JsonDeserializer: use float when the value has few digits 2024-09-04 14:33:14 +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 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 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 68a13117dc Allow using a JsonVariant as a key or index
Closes #2080
2024-05-14 21:06:02 +02:00
Benoit Blanchon 5f5f927693 Add tests of as<MsgPackBinary>() 2024-05-01 19:26:19 +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 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
Benoit Blanchon 0e8a236583 Update copyright year 2024-01-03 08:47:06 +01: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 9a11d98117 Tests: make allocator assertions more readable 2023-07-26 09:28:21 +02:00
Benoit Blanchon 30ec507989 Tests: use a consistent naming convention for allocators 2023-07-25 14:53:54 +02:00
Benoit Blanchon 7a76da3bc7 Tests: rename ControllableAllocator to KillswitchAllocator 2023-07-25 14:46:25 +02:00
Benoit Blanchon 00c9d8680a Remove memoryUsage() 2023-07-24 17:21:25 +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 86772d33bc Rename VALUE_IS_OWNED_RAW to VALUE_IS_RAW_STRING 2023-05-02 10:03:37 +02:00
Benoit Blanchon 806fa907ab Always store serialized("string") by copy (#1915) 2023-05-02 09:36:40 +02:00
Benoit Blanchon dd46813dc0 Change naming convention from _member to member_ (fixes #1905)
Ported from 31ce648e63
2023-04-21 18:59:48 +02:00
Benoit Blanchon 5d796781fb Increase coverage 2023-04-21 18:39:47 +02:00
Benoit Blanchon 003087406c Reference-count shared strings 2023-04-21 16:11:54 +02:00
Benoit Blanchon b7c8e0d25c Decouple VariantData from MemoryPool 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 e9850152a7 Tests: replace constants with sizeofString(n) 2023-04-07 14:50:54 +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 17a482a9b1 Remove StaticJsonDocument 2023-03-20 10:40:35 +01:00
Benoit Blanchon 5edd435fe9 Add a constructor to VariantData 2023-03-20 10:14:54 +01:00
Benoit Blanchon 33a4773fbd Set clang-format standard to C++11 (#1820) 2023-02-16 11:51:02 +01:00