mirror of
https://github.com/nlohmann/json.git
synced 2026-11-01 10:25:43 +00:00
json_view: pass accept()'s validate-only request as a parameter
Address review of #5970: - build() takes validate_only as an argument; the validate_only members of document_data and basic_json_document are removed, so neither grows - the internal read path takes an on_error mode (discard, raise, validate) instead of allow_exceptions; accept() calls it with on_error::validate - build_with() has no default for Store - drop the unneeded static_casts in push_node() - name the NulIsEnd argument so astyle keeps build<...> intact - explain in the docs and code why comments/trailing commas keep the index Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
6 files changed
+109
-79
No files matched your search
@@ -59,7 +59,7 @@ built build(const std::string& text, bool comments, bool trailing_commas, bool s
|
||||
r.copy.assign(text.begin(), text.end());
|
||||
src = r.copy.data();
|
||||
}
|
||||
r.ok = nlohmann::detail::view::build < FloatType, !nlohmann::detail::abi_config::strict_nul_handling > (*r.data, src, text.size(), comments, trailing_commas, sentinel, r.failure);
|
||||
r.ok = nlohmann::detail::view::build < FloatType, !nlohmann::detail::abi_config::strict_nul_handling > (*r.data, src, text.size(), comments, trailing_commas, sentinel, false, r.failure);
|
||||
r.data->src = src;
|
||||
r.data->base[0] = src;
|
||||
r.data->base[1] = r.data->arena.data();
|
||||
|
||||
Reference in new issue
Block a user