mirror of
https://github.com/nlohmann/json.git
synced 2026-10-10 00:17:13 +00:00
Merge branch 'json-view/19-edit-set' into json-view/21-images
Signed-off-by: Niels Lohmann <mail@nlohmann.me> # Conflicts: # include/nlohmann/detail/view/document_data.hpp # single_include/nlohmann/json_view.hpp
This commit is contained in:
45 files changed
+888
-1094
No files matched your search
@@ -703,11 +703,19 @@ class basic_json_view
|
||||
return detail::view::view_side<BasicJsonType, basic_json_view>(v);
|
||||
}
|
||||
|
||||
/// the template argument as a runtime condition: testing it directly in
|
||||
/// `Editable && ...` makes the condition constant, which MSVC reports as
|
||||
/// C4127
|
||||
static bool editable() noexcept
|
||||
{
|
||||
return Editable;
|
||||
}
|
||||
|
||||
/// the number of source bytes of this value (estimated for values with
|
||||
/// decoded strings)
|
||||
std::size_t source_extent() const noexcept
|
||||
{
|
||||
if (Editable && m_doc->edits != nullptr)
|
||||
if (editable() && m_doc->edits != nullptr)
|
||||
{
|
||||
// positions of moved and new values are not source offsets
|
||||
return m_node == m_doc->tape ? m_doc->size + m_doc->edits->text_used : 64;
|
||||
|
||||
Reference in new issue
Block a user