From a8c5dba54187f7dc79a5647148351ecdb7673035 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 16 Oct 2026 15:17:41 +0200 Subject: [PATCH] Say that json_view converts integers while parsing Signed-off-by: Niels Lohmann --- docs/mkdocs/docs/features/json_view.md | 5 +++-- docs/mkdocs/docs/features/performance.md | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/mkdocs/docs/features/json_view.md b/docs/mkdocs/docs/features/json_view.md index 34fc045e3..f57cc6e58 100644 --- a/docs/mkdocs/docs/features/json_view.md +++ b/docs/mkdocs/docs/features/json_view.md @@ -16,8 +16,9 @@ most of the resulting tree is thrown away almost immediately. [`basic_json_document::parse()`](../api/basic_json_document/parse.md) parses the same JSON grammar, with the same options, but instead of a tree it builds a flat index of the values it found: one [16-byte entry](../home/architecture.md#node-index-of-json-views) per value (and one per object key), in document -order. Strings and numbers are referenced in place in the source text; only strings that contain escape sequences -are decoded, into one shared buffer owned by the document. +order. Integers are converted while parsing and stored in their entry. Floating-point numbers and strings are +referenced in place in the source text: a float is converted when it is read, and only strings that contain escape +sequences are decoded, into one shared buffer owned by the document. [`basic_json_view`](../api/basic_json_view/index.md) is a small, trivially copyable handle (two pointers) into that index. It gives you the read-only, type-inspection part of the `basic_json` interface -- diff --git a/docs/mkdocs/docs/features/performance.md b/docs/mkdocs/docs/features/performance.md index 87ccff787..ad24bd069 100644 --- a/docs/mkdocs/docs/features/performance.md +++ b/docs/mkdocs/docs/features/performance.md @@ -65,8 +65,8 @@ a DOM, three alternatives avoid building it: unparsed remainder of the input) instead of the whole document -- see the [recipe for streaming a large homogeneous array](parsing/parser_callbacks.md#recipe-streaming-a-large-homogeneous-array). - Parse into a [`json_document`](json_view.md) (`#!cpp `) instead of a `basic_json`. It keeps - the input text and builds a flat index of 16 bytes per value; strings and numbers are not copied, but read from the - text when needed. Read-only [views](../api/basic_json_view/index.md) give the familiar element access, and only the + the input text and builds a flat index of 16 bytes per value; strings and floating-point numbers are not copied, but + read from the text when needed. Read-only [views](../api/basic_json_view/index.md) give the familiar element access, and only the parts you [`materialize()`](../api/basic_json_view/materialize.md) become `basic_json` values. A document that borrows the text instead of owning a copy needs the text to outlive it; see [choosing between `json`, the SAX interface, and `json_view`](json_view.md#choosing-between-json-ordered_json-the-sax-interface-and-json_view).