mirror of
https://github.com/nlohmann/json.git
synced 2026-11-03 19:29:22 +00:00
The single features/json_view.md page grew to ~600 lines covering eight
topics. Split it into features/json_view/ with an overview page and
pages for ownership and lifetime, differences from basic_json, reading
values, generic code, editing, and images.
The new differences page collects what was spread over several sections
("What is the same", "What is different", "Duplicate keys", and notes in
the conversion and serialization sections) under one summary table, and
adds the parts of the basic_json interface a view does not have. The
other pages now link to it instead of restating the rules.
Internal links across the documentation point to the new pages.
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
908 B
908 B
nlohmann::json_document
Defined in header <nlohmann/json_view.hpp>
using json_document = basic_json_document<json, view_mode::read_only>;
This type is a basic_json_document of the default json
specialization.
Examples
??? example
The example below demonstrates how to use the type `nlohmann::json_document`.
```cpp
--8<-- "examples/json_document.cpp"
```
Output:
```json
--8<-- "examples/json_document.output"
```
See also
json_view- a view of a value of ajson_documentordered_json_document- the corresponding document forordered_json- Zero-copy JSON views - how to parse, inspect and edit a document without building a tree
Version history
Added in version 3.13.0.