Document json_document and json_view
- API pages for basic_json_document and basic_json_view, one per member, and for the four aliases, each with an example - features/json_view.md: the problem the view solves, ownership and lifetime, what matches basic_json::parse() and what differs, and when to choose json, ordered_json, SAX, or the view - the examples show why one would use the view, not only how: borrowed vs. owned input, reading a few fields and materializing one subtree, reusing a document across many messages - registered in the mkdocs navigation, llms.txt, the docset, the exceptions page (out_of_range.416), architecture.md, the integration page, and the README; the yyjson credit is added to the README and license.md Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
109 files changed
+2983
-1
No files matched your search
@@ -0,0 +1,38 @@
|
||||
# <small>nlohmann::</small>ordered_json_document
|
||||
|
||||
<small>Defined in header `<nlohmann/json_view.hpp>`</small>
|
||||
|
||||
```cpp
|
||||
using ordered_json_document = basic_json_document<ordered_json>;
|
||||
```
|
||||
|
||||
This type is a [`basic_json_document`](basic_json_document/index.md) of the [`ordered_json`](ordered_json.md)
|
||||
specialization: [`materialize()`](basic_json_view/materialize.md) on one of its views preserves the insertion order
|
||||
of object keys, instead of sorting them like [`json_document`](json_document.md) does.
|
||||
|
||||
## Examples
|
||||
|
||||
??? example
|
||||
|
||||
The example below demonstrates how `ordered_json_document` preserves the insertion order of object keys when
|
||||
materializing.
|
||||
|
||||
```cpp
|
||||
--8<-- "examples/ordered_json_document.cpp"
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
--8<-- "examples/ordered_json_document.output"
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [ordered_json_view](ordered_json_view.md) - a view of a value of an `ordered_json_document`
|
||||
- [json_document](json_document.md) - the corresponding document for the default `json` specialization
|
||||
- [Object Order](../features/object_order.md)
|
||||
|
||||
## Version history
|
||||
|
||||
Since version 3.13.0.
|
||||
Reference in new issue
Block a user