mirror of
https://github.com/nlohmann/json.git
synced 2026-10-20 13:08:13 +00:00
Address the review of editable json documents
From gregmarr's review of #5630: - set() with a JSON pointer below a null value checks for "-" before scanning the token for digits. - node_flags::storage is defined as escaped | edited, and the comment on document_data::base says that the fourth slot is unused. - source_extent() names its root check. - The integer-index overloads of set(), insert(), and erase() use a named trait instead of a negated condition, which astyle formats like the library's other enable_ifs. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
4 files changed
+17
-11
No files matched your search
@@ -34,7 +34,7 @@ struct node_flags
|
||||
{
|
||||
static constexpr std::uint8_t escaped = 1; ///< string payload lives in the decode arena, not the source
|
||||
static constexpr std::uint8_t edited = 2; ///< string or number token lives in the edit arena (editable documents)
|
||||
static constexpr std::uint8_t storage = 3; ///< mask: where a string or number token lives (index into document_data::base)
|
||||
static constexpr std::uint8_t storage = escaped | edited; ///< mask: where a string or number token lives (index into document_data::base)
|
||||
static constexpr std::uint8_t is_true = 4; ///< boolean value
|
||||
static constexpr std::uint8_t moved = 8; ///< array/object: the elements live in a separate sequence (editable documents)
|
||||
static constexpr std::uint8_t is_new = 16; ///< written by an edit: no source position
|
||||
|
||||
Reference in new issue
Block a user