Commit Graph
521 Commits
Author SHA1 Message Date
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
Benoit Blanchon 1b66a217bf Replace ARDUINOJSON_NAMESPACE with an inline namespace (#1820) 2023-02-14 10:04:48 +01:00
Benoit Blanchon 407fc2cd45 Drop support for C++98/C++03 (closes #1820) 2023-02-10 17:02:52 +01:00
Benoit Blanchon b33966c755 Set version to 6.20.1 2023-02-08 16:42:04 +01:00
Benoit Blanchon b350a96643 Remove explicit exclusion of as<char*>() and as<char>() (#1860)
If you try to call them, you'll now get the same error message as any unsupported type.
You could also add a custom converter for `char*` and `char`.
2023-01-18 22:10:37 +01:00
Benoit Blanchon 5094b84a46 Set version to 6.20.0 2022-12-26 17:35:54 +01:00
Benoit Blanchon 191fc5dff4 Remove support for naked char (was deprecated since 6.18.0) 2022-12-26 11:02:34 +01:00
Benoit Blanchon de725e0a4e Add documentation to most public symbols 2022-12-21 19:20:51 +01:00
Benoit Blanchon d602232b9f Update change log 2022-12-19 14:41:53 +01:00
Benoit Blanchon 0f85a55cac Implement VariantRefBase with a CRTP 2022-12-05 21:00:24 +01:00
Benoit Blanchon 92d6bae25c Remove ArrayIterator::internal() and ObjectIterator::internal() 2022-10-14 18:11:55 +02:00
Benoit Blanchon cf4436e581 Extract VariantProxy from ElementProxy and MemberProxy 2022-08-30 10:25:03 +02:00
Benoit Blanchon 62e83133cd Remove JsonDocument::data() and JsonDocument::memoryPool() 2022-08-09 10:38:36 +02:00
Benoit Blanchon 1d21027e2a Fix lax parsing of true, false, and null (fixes #1781) 2022-08-06 09:15:07 +02:00
Benoit Blanchon 5705247e5f Fix replacement for getOrAddElement() and getOrAddMember() 2022-08-04 10:47:02 +02:00
Benoit Blanchon c5838a876b Remove getElement(), getOrAddElement(), getMember(), and getOrAddMember() 2022-07-07 14:32:43 +02:00
Benoit Blanchon 758580bfb6 Rename addElement() to add() 2022-07-07 14:32:43 +02:00
Benoit Blanchon cd8373ad32 Change link() to shallowCopy() (issue #1343)
Instead of storing a pointer, the function copies the `VariantData`.

Benefits:
* smaller code
* no impact on programs that don't use this feature

Drawbacks:
* changes to the original variant are not always reflected on the copy
* modifying the original from the shallow copy leads to UB
2022-07-05 17:07:43 +02:00
Benoit Blanchon 5b06b1564e Remove undocumented accept() functions 2022-07-03 17:38:03 +02:00
Benoit Blanchon e2bb2cec7b Fix comparison operators for JsonObject and JsonObjectConst 2022-06-10 11:14:59 +02:00
Benoit Blanchon ff4e837df5 Fix comparison operators for JsonArray and JsonArrayConst 2022-06-09 21:06:32 +02:00
Benoit Blanchon 3d6c328a4f Add JsonVariant::link() (resolves #1343) 2022-04-27 15:08:13 +02:00
Benoit Blanchon ccfbb5fd1d Fix 9.22337e+18 outside range of representable values of type 'long' 2022-04-07 20:59:20 +02:00
Benoit Blanchon 67b6797b6d Set version to 6.19.4 2022-04-05 10:53:11 +02:00
Benoit Blanchon 8d9504239b Fix comparisons operators with const JsonDocument& 2022-04-05 10:12:17 +02:00
Benoit Blanchon bf5d0c790c Add implicit conversion from JsonDocument to JsonVariant 2022-03-23 17:17:35 +01:00
Benoit Blanchon 3dc67c5663 Add memoryUsage() to ElementProxy and MemberProxy (fixes #1730) 2022-03-19 12:11:40 +01:00
Benoit Blanchon 7abf875071 Set version to 6.19.3 2022-03-08 17:24:14 +01:00
Benoit Blanchon e3e375f5cd MessagePack: serialize round floats as integers (fixes #1718) 2022-02-28 19:38:26 +01:00
Benoit Blanchon 89ed54362b Fix -Wsign-conversion on GCC 8 (fixes #1715) 2022-02-25 10:28:42 +01:00
Benoit Blanchon f831ed395d Fix JsonString operator == and != for non-zero-terminated string 2022-02-17 17:33:16 +01:00
Benoit Blanchon a880614a75 Fix call of overloaded 'String(const char*, int)' is ambiguous 2022-02-17 17:33:16 +01:00
Benoit Blanchon ef8379df1b Set version to 6.19.2 2022-02-14 09:06:06 +01:00
Benoit Blanchon 702f8c2e2f Fix cannot convert 'pgm_p' to 'const void*' (fixes #1707) 2022-02-06 11:14:23 +01:00
Benoit Blanchon 6ea2815341 Set version to 6.19.1 2022-01-14 08:49:57 +01:00
Benoit Blanchon 21b2c76524 Fix filter not working in zero-copy mode (fixes #1697) 2022-01-13 20:25:49 +01:00
Benoit Blanchon ee12155617 Fix crash when adding an object member in a too small JsonDocument 2022-01-13 11:52:45 +01:00
Benoit Blanchon 4b4c68df5f Changelog: remove empty line 2022-01-13 11:52:45 +01:00