diff --git a/docs/mkdocs/docs/css/fig-jsonview.css b/docs/mkdocs/docs/css/fig-jsonview.css index 6044b9115..7c1653d3a 100644 --- a/docs/mkdocs/docs/css/fig-jsonview.css +++ b/docs/mkdocs/docs/css/fig-jsonview.css @@ -1,4 +1,4 @@ -/* figures: jsonview (features/json_view/index.md; SVGs from scripts/figures/json_view_layout.py, stepper in js/fig-jsonview.js) */ +/* figures: jsonview (features/json_view/*.md; SVGs from scripts/figures/json_view_layout.py, stepper in js/fig-jsonview.js) */ /* one colour per concept, the same in every figure: structure (object/array, views) blue, keys navy, strings green, numbers orange, decoded strings purple, owned edit storage teal, dangling/invalid red */ diff --git a/docs/mkdocs/docs/features/json_view/differences.md b/docs/mkdocs/docs/features/json_view/differences.md index e763e70fd..262c73db4 100644 --- a/docs/mkdocs/docs/features/json_view/differences.md +++ b/docs/mkdocs/docs/features/json_view/differences.md @@ -20,7 +20,7 @@ does not: what a document parses differently, what a view's functions do differe | [Number spelling](#serialization) | lost when parsing | kept: `number_token()`, `number_format::source` | — | | [Comparison](#comparison) | `==`, `!=`, `<`, `<=>`, ... | `==` and `!=` only | `materialize()` | | [Modification](#what-a-view-does-not-have) | member functions of the value | only through an [editable document](editing.md) | `materialize()` | -| [Iterators](#what-a-view-does-not-have) | bidirectional, reverse iterators | forward only | `materialize()` | +| [Iterators](#what-a-view-does-not-have) | bidirectional (`rbegin()`/`rend()`) | forward only | `materialize()` |

Each row is one difference; the last column names the way to get `basic_json`'s behavior from a view, where there is one.

@@ -201,7 +201,6 @@ A view is a read-only handle. These parts of the `basic_json` interface have no [`set`](../../api/basic_json_document/set.md), [`push_back`](../../api/basic_json_document/push_back.md), [`insert`](../../api/basic_json_document/insert.md), and [`erase`](../../api/basic_json_document/erase.md). - **Reverse iteration.** A view's iterator is a forward iterator; there is no `rbegin()`/`rend()`. -- **Ordering comparisons**, see [Comparison](#comparison). - **JSON Patch and friends**: [`patch()`](../../api/basic_json/patch.md), [`merge_patch()`](../../api/basic_json/merge_patch.md), [`diff()`](../../api/basic_json/diff.md), [`flatten()`](../../api/basic_json/flatten.md). diff --git a/docs/mkdocs/docs/features/json_view/generic_code.md b/docs/mkdocs/docs/features/json_view/generic_code.md index a06178d05..c80476ada 100644 --- a/docs/mkdocs/docs/features/json_view/generic_code.md +++ b/docs/mkdocs/docs/features/json_view/generic_code.md @@ -76,10 +76,8 @@ Its body may only use what views and `basic_json` have in common: the type check functions a view does not have; such a type is converted through `materialize()`. A `from_json()` for `json` only is converted through `materialize()` as well. -One thing differs when a `from_json()` reads the view: members looked up by name (`at()`, `value()`, ... and thus -the macros) find the **first** member with a repeated key, see [Duplicate keys](differences.md#duplicate-keys); -`#!cpp materialize().get()` would see the last one. Containers built from an object, such as `#!cpp std::map`, -keep the **last** value either way, as [`parse()`](../../api/basic_json/parse.md) does. +Reading the view and `#!cpp materialize().get()` give the same result, except for an object with a repeated key; +see [Duplicate keys](differences.md#duplicate-keys). `to_json()` is unaffected: it writes `basic_json` values, never views. diff --git a/docs/mkdocs/docs/features/json_view/reading.md b/docs/mkdocs/docs/features/json_view/reading.md index 9040e85e4..2541ae6cd 100644 --- a/docs/mkdocs/docs/features/json_view/reading.md +++ b/docs/mkdocs/docs/features/json_view/reading.md @@ -25,7 +25,7 @@ Two conversions never copy at all: rounding it into a `#!cpp double`/`#!cpp int64_t` the way `#!cpp get()` (and [`basic_json::parse()`](../../api/basic_json/parse.md)) would. -Both results are only valid as long as the view — and, for a string with no escapes, the borrowed source text — is. +Both results are only valid as long as the document and, if it [borrows its source text](lifetime.md), that text. ### `string_view` members @@ -58,12 +58,8 @@ const record r = doc.root().get(); // r.name points into tex ## Writing a view back [`dump()`](../../api/basic_json_view/dump.md) serializes a view directly from the flat index, without ever building a -`basic_json` value. An object's members are written in document order, not sorted by key, and *every* occurrence of a -repeated key is written, not only the last one — the same two ways -[iteration differs](differences.md#object-member-order) from a -[`materialize()`](../../api/basic_json_view/materialize.md)d value, see -[Duplicate keys](differences.md#duplicate-keys). `#!cpp materialize().dump()` gives a different result in both -respects for a `json_view`. +`basic_json` value. It writes object members in document order and every occurrence of a repeated key, so it can +differ from `#!cpp materialize().dump()`; see [Serialization](differences.md#serialization). By default, numbers are written the way [`basic_json::dump()`](../../api/basic_json/dump.md) would. [`number_format::source`](../../api/basic_json_view/number_format.md) instead copies every number exactly as it was diff --git a/docs/mkdocs/docs/home/exceptions.md b/docs/mkdocs/docs/home/exceptions.md index 92e16b535..2f50bd6b4 100644 --- a/docs/mkdocs/docs/home/exceptions.md +++ b/docs/mkdocs/docs/home/exceptions.md @@ -889,7 +889,7 @@ from JSON text. !!! note - This exception was added in version 3.13.0, together with editable [`json_document`s](../features/json_view/index.md). + This exception was added in version 3.13.0, together with editable [`json_document`s](../features/json_view/editing.md). ### json.exception.type_error.320 diff --git a/docs/mkdocs/docs/js/fig-jsonview.js b/docs/mkdocs/docs/js/fig-jsonview.js index c49d3880e..93656ff9d 100644 --- a/docs/mkdocs/docs/js/fig-jsonview.js +++ b/docs/mkdocs/docs/js/fig-jsonview.js @@ -1,4 +1,4 @@ -/* figures: jsonview -- stepper for the edit frames on features/json_view/index.md. +/* figures: jsonview -- stepper for the edit frames on features/json_view/editing.md. Without JS the frames (.nj-jsonview-step) show one below the other; with JS one frame at a time, with previous/next and one button per step. Never advances on its own. */ (function () {