deploy: cc917d7123
This commit is contained in:
1 parent
39c2507b2a
commit
41c601a7d1
57 files changed
+966
-468
No files matched your search
@@ -1,3 +1,3 @@
|
||||
<!doctype html><html lang=en class=no-js> <head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=author content="Niels Lohmann"><link href="https://json.nlohmann.me/api/basic_json_document/" rel="canonical"><link href=../basic_json/with_t/ rel=prev><link href=basic_json_document/ rel=next><link rel=icon href=../../assets/images/favicon.png><meta name=generator content="mkdocs-1.6.1, mkdocs-material-9.7.7"><title>Overview - JSON for Modern C++</title><link rel=stylesheet href=../../assets/stylesheets/main.ec1eaa64.min.css><link rel=stylesheet href=../../assets/stylesheets/palette.ab4e12ef.min.css><link rel="stylesheet" href="../../assets/external/fonts.googleapis.com/css.61a430c9.css"><style>:root{--md-text-font:"Roboto";--md-code-font:"JetBrains Mono"}</style><link rel=stylesheet href=../../css/custom.css><script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script></head> <body dir=ltr data-md-color-scheme=default data-md-color-primary=indigo data-md-color-accent=indigo> <input class=md-toggle data-md-toggle=drawer type=checkbox id=__drawer autocomplete=off> <input class=md-toggle data-md-toggle=search type=checkbox id=__search autocomplete=off> <label class=md-overlay for=__drawer></label> <div data-md-component=skip> <a href=#nlohmannbasic_json_document class=md-skip> Skip to content </a> </div> <div data-md-component=announce> </div> <header class=md-header data-md-component=header> <nav class="md-header__inner md-grid" aria-label=Header> <a href=../.. title="JSON for Modern C++" class="md-header__button md-logo" aria-label="JSON for Modern C++" data-md-component=logo> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg> </a> <label class="md-header__button md-icon" for=__drawer> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg> </label> <div class=md-header__title data-md-component=header-title> <div class=md-header__ellipsis> <div class=md-header__topic> <span class=md-ellipsis> JSON for Modern C++ </span> </div> <div class=md-header__topic data-md-component=header-topic> <span class=md-ellipsis> Overview </span> </div> </div> </div> <form class=md-header__option data-md-component=palette> <input class=md-option data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme=default data-md-color-primary=indigo data-md-color-accent=indigo aria-label="Switch to dark mode" type=radio name=__palette id=__palette_0> <label class="md-header__button md-icon" title="Switch to dark mode" for=__palette_1 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg> </label> <input class=md-option data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme=slate data-md-color-primary=indigo data-md-color-accent=indigo aria-label="Switch to light mode" type=radio name=__palette id=__palette_1> <label class="md-header__button md-icon" title="Switch to light mode" for=__palette_0 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg> </label> </form> <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script> <label class="md-header__button md-icon" for=__search> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg> <Line truncated
|
||||
<span class=k>class</span><span class=w> </span><span class=nc>basic_json_document</span><span class=p>;</span>
|
||||
</code></pre></div> <p>A parsed <abbr title="JavaScript Object Notation">JSON</abbr> text, held as a flat index of its values (<a href=../../home/architecture/#node-index-of-json-views>16 bytes per value</a>) instead of a tree of <code>BasicJsonType</code> values. Strings and numbers stay in the source text; only strings that contain escapes are decoded, into one buffer owned by the document. <a href=../basic_json_view/ ><code>basic_json_view</code></a> is a read-only handle to one value of a <code>basic_json_document</code>; <a href=../basic_json_view/materialize/ ><code>materialize()</code></a> turns a subtree into the <code>BasicJsonType</code> value that <a href=../basic_json/parse/ ><code>BasicJsonType::parse()</code></a> would have produced for it.</p> <p>A document may <strong>borrow</strong> the text it was parsed from (the caller's buffer must then outlive the document) or <strong>own</strong> it (a copy, or an rvalue <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>string</span></code> that was moved in); see <a href=owns_source/ ><code>owns_source</code></a>. <code>basic_json_document</code> is move-only: a copy would duplicate the whole index, the decoded-string buffer, and the owned text, and a move is enough in every use we know of. The index, the decoded strings, and the owned text live in one heap block that the document holds through a <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>unique_ptr</span></code>; this is also why views survive a move of the document.</p> <p>With <code class=highlight><span class=n>Editable</span><span class=w> </span><span class=o>==</span><span class=w> </span><span class=nb>true</span></code>, the document also offers <a href=set/ ><code>set</code></a>, <a href=push_back/ ><code>push_back</code></a>, <a href=insert/ ><code>insert</code></a>, and <a href=erase/ ><code>erase</code></a> to change values in place, see <a href=#edits>Edits</a> below. The source text itself is never written; a read-only document (<code class=highlight><span class=n>Editable</span><span class=w> </span><span class=o>==</span><span class=w> </span><span class=nb>false</span></code>, the default) does not carry any of the bookkeeping edits need, and calling any of them on one fails to compile (<code class=highlight><span class=k>static_assert</span></code>).</p> <h2 id=template-parameters>Template parameters<a class=headerlink href=#template-parameters title="Permanent link">¶</a></h2> <dl> <dt><code>BasicJsonType</code></dt> <dd>a specialization of <a href=../basic_json/ ><code>basic_json</code></a>, for instance <a href=../json/ ><code>json</code></a> or <a href=../ordered_json/ ><code>ordered_json</code></a>. Only 64-bit <code>number_integer_t</code>/<code>number_unsigned_t</code> types are supported; this is checked with a <code>static_assert</code>.</dd> <dt><code>Editable</code></dt> <dd>whether the document supports <a href=set/ ><code>set</code></a>, <a href=push_back/ ><code>push_back</code></a>, <a href=insert/ ><code>insert</code></a>, and <a href=erase/ ><code>erase</code></a> (optional, <code class=highlight><span class=nb>false</span></code> by default). See <a href=#edits>Edits</a> below.</dd> </dl> <h2 id=specializations>Specializations<a class=headerlink href=#specializations title="Permanent link">¶</a></h2> <ul> <li><a href=../json_document/ ><strong>json_document</strong></a> - read-only documents of the default specialization <a href=../json/ ><code>json</code></a></li> <li><a href=../ordered_json_document/ ><strong>ordered_json_document</strong></a> - read-only documents of <a href=../ordered_json/ ><code>ordered_json</code></a></li> <li><a href=../json_editable_document/ ><strong>json_editable_document</strong></a> - editable documents of <a href=../json/ ><code>json</code></a></li> <li><a href=../ordered_json_editable_document/ ><strong>ordered_json_editable_document</strong></a> - editable documents of <a href=../ordered_json/ ><code>ordered_json</code></a></li> </ul> <h2 id=member-types>Member types<a class=headerlink href=#member-types title="Permanent link">¶</a></h2> <ul> <li><strong>view_type</strong> - the type of view returned by <a href=root/ ><code>root()</code></a> (<code class=highlight><span class=n>basic_json_view</span><span class=o><</span><span class=n>BasicJsonType</span><span class=p>,</span><span class=w> </span><span class=n>Editable</span><span class=o>></span></code>)</li> <li><strong>value_t</strong> - the <abbr title="JavaScript Object Notation">JSON</abbr> type enumeration, see <a href=../basic_json/value_t/ ><code>basic_json::value_t</code></a></li> <li><strong>image_check</strong> - how <a href=load/ ><code>load()</code></a> validates an image (<code>full</code>, <code>bounds</code>, <code>none</code>), see <a href=load/#image_check><code>image_check</code></a></li> </ul> <h2 id=member-functions>Member functions<a class=headerlink href=#member-fLine truncated
|
||||
</code></pre></div> <p>A parsed <abbr title="JavaScript Object Notation">JSON</abbr> text, held as a flat index of its values (<a href=../../home/architecture/#node-index-of-json-views>16 bytes per value</a>) instead of a tree of <code>BasicJsonType</code> values. Strings and floating-point numbers stay in the source text; integers are converted while parsing, and strings that contain escapes are decoded into one buffer owned by the document. <a href=../basic_json_view/ ><code>basic_json_view</code></a> is a read-only handle to one value of a <code>basic_json_document</code>; <a href=../basic_json_view/materialize/ ><code>materialize()</code></a> turns a subtree into the <code>BasicJsonType</code> value that <a href=../basic_json/parse/ ><code>BasicJsonType::parse()</code></a> would have produced for it.</p> <p>A document may <strong>borrow</strong> the text it was parsed from (the caller's buffer must then outlive the document) or <strong>own</strong> it (a copy, or an rvalue <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>string</span></code> that was moved in); see <a href=owns_source/ ><code>owns_source</code></a>. <code>basic_json_document</code> is move-only: a copy would duplicate the whole index, the decoded-string buffer, and the owned text, and a move is enough in every use we know of. The index, the decoded strings, and the owned text live in one heap block that the document holds through a <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>unique_ptr</span></code>; this is also why views survive a move of the document.</p> <p>With <code class=highlight><span class=n>Editable</span><span class=w> </span><span class=o>==</span><span class=w> </span><span class=nb>true</span></code>, the document also offers <a href=set/ ><code>set</code></a>, <a href=push_back/ ><code>push_back</code></a>, <a href=insert/ ><code>insert</code></a>, and <a href=erase/ ><code>erase</code></a> to change values in place, see <a href=#edits>Edits</a> below. The source text itself is never written; a read-only document (<code class=highlight><span class=n>Editable</span><span class=w> </span><span class=o>==</span><span class=w> </span><span class=nb>false</span></code>, the default) does not carry any of the bookkeeping edits need, and calling any of them on one fails to compile (<code class=highlight><span class=k>static_assert</span></code>).</p> <h2 id=template-parameters>Template parameters<a class=headerlink href=#template-parameters title="Permanent link">¶</a></h2> <dl> <dt><code>BasicJsonType</code></dt> <dd>a specialization of <a href=../basic_json/ ><code>basic_json</code></a>, for instance <a href=../json/ ><code>json</code></a> or <a href=../ordered_json/ ><code>ordered_json</code></a>. Only 64-bit <code>number_integer_t</code>/<code>number_unsigned_t</code> types are supported; this is checked with a <code>static_assert</code>.</dd> <dt><code>Editable</code></dt> <dd>whether the document supports <a href=set/ ><code>set</code></a>, <a href=push_back/ ><code>push_back</code></a>, <a href=insert/ ><code>insert</code></a>, and <a href=erase/ ><code>erase</code></a> (optional, <code class=highlight><span class=nb>false</span></code> by default). See <a href=#edits>Edits</a> below.</dd> </dl> <h2 id=specializations>Specializations<a class=headerlink href=#specializations title="Permanent link">¶</a></h2> <ul> <li><a href=../json_document/ ><strong>json_document</strong></a> - read-only documents of the default specialization <a href=../json/ ><code>json</code></a></li> <li><a href=../ordered_json_document/ ><strong>ordered_json_document</strong></a> - read-only documents of <a href=../ordered_json/ ><code>ordered_json</code></a></li> <li><a href=../json_editable_document/ ><strong>json_editable_document</strong></a> - editable documents of <a href=../json/ ><code>json</code></a></li> <li><a href=../ordered_json_editable_document/ ><strong>ordered_json_editable_document</strong></a> - editable documents of <a href=../ordered_json/ ><code>ordered_json</code></a></li> </ul> <h2 id=member-types>Member types<a class=headerlink href=#member-types title="Permanent link">¶</a></h2> <ul> <li><strong>view_type</strong> - the type of view returned by <a href=root/ ><code>root()</code></a> (<code class=highlight><span class=n>basic_json_view</span><span class=o><</span><span class=n>BasicJsonType</span><span class=p>,</span><span class=w> </span><span class=n>Editable</span><span class=o>></span></code>)</li> <li><strong>value_t</strong> - the <abbr title="JavaScript Object Notation">JSON</abbr> type enumeration, see <a href=../basic_json/value_t/ ><code>basic_json::value_t</code></a></li> <li><strong>image_check</strong> - how <a href=load/ ><code>load()</code></a> validates an image (<code>full</code>, <code>bounds</code>, <code>none</code>), see <a href=load/#image_check><code>image_check</code></a></li> </ul> <h2 id=member-functionsLine truncated
|
||||
@@ -7,7 +7,7 @@ template<typename BasicJsonType, bool Editable = false>
|
||||
class basic_json_document;
|
||||
```
|
||||
|
||||
A parsed JSON text, held as a flat index of its values ([16 bytes per value](https://json.nlohmann.me/home/architecture/#node-index-of-json-views)) instead of a tree of `BasicJsonType` values. Strings and numbers stay in the source text; only strings that contain escapes are decoded, into one buffer owned by the document. [`basic_json_view`](https://json.nlohmann.me/api/basic_json_view/index.md) is a read-only handle to one value of a `basic_json_document`; [`materialize()`](https://json.nlohmann.me/api/basic_json_view/materialize/index.md) turns a subtree into the `BasicJsonType` value that [`BasicJsonType::parse()`](https://json.nlohmann.me/api/basic_json/parse/index.md) would have produced for it.
|
||||
A parsed JSON text, held as a flat index of its values ([16 bytes per value](https://json.nlohmann.me/home/architecture/#node-index-of-json-views)) instead of a tree of `BasicJsonType` values. Strings and floating-point numbers stay in the source text; integers are converted while parsing, and strings that contain escapes are decoded into one buffer owned by the document. [`basic_json_view`](https://json.nlohmann.me/api/basic_json_view/index.md) is a read-only handle to one value of a `basic_json_document`; [`materialize()`](https://json.nlohmann.me/api/basic_json_view/materialize/index.md) turns a subtree into the `BasicJsonType` value that [`BasicJsonType::parse()`](https://json.nlohmann.me/api/basic_json/parse/index.md) would have produced for it.
|
||||
|
||||
A document may **borrow** the text it was parsed from (the caller's buffer must then outlive the document) or **own** it (a copy, or an rvalue `std::string` that was moved in); see [`owns_source`](https://json.nlohmann.me/api/basic_json_document/owns_source/index.md). `basic_json_document` is move-only: a copy would duplicate the whole index, the decoded-string buffer, and the owned text, and a move is enough in every use we know of. The index, the decoded strings, and the owned text live in one heap block that the document holds through a `std::unique_ptr`; this is also why views survive a move of the document.
|
||||
|
||||
|
||||
@@ -21,17 +21,19 @@ static basic_json_document parse(IteratorType first, IteratorType last,
|
||||
|
||||
Both overloads accept the same JSON text as [`BasicJsonType::parse()`](../basic_json/parse.md), with the same
|
||||
`ignore_comments`/`ignore_trailing_commas` options, but build a [`basic_json_document`](index.md) (a flat index into
|
||||
the input) instead of a tree of `BasicJsonType` values. They take the same inputs as `BasicJsonType::parse()`. Byte
|
||||
inputs that stay alive can be borrowed; all others (streams, `#!cpp FILE*`, wide characters, non-contiguous
|
||||
iterators) are read into a copy that the document owns -- see the Notes. Use [`parse_copy()`](parse_copy.md) to get an
|
||||
owned copy of a borrowable input as well.
|
||||
the input) instead of a tree of `BasicJsonType` values. They accept every input `BasicJsonType::parse()` takes, and in
|
||||
addition a pointer to a null-terminated wide string (which `BasicJsonType::parse()` rejects). Contiguous inputs of
|
||||
single-byte characters that stay alive can be borrowed; all others (streams, `#!cpp FILE*`, wide characters, which
|
||||
must be converted to UTF-8, and non-contiguous iterators) are read into a copy that the document owns -- see the
|
||||
Notes. Use [`parse_copy()`](parse_copy.md) to get an owned copy of a borrowable input
|
||||
as well.
|
||||
|
||||
## Template parameters
|
||||
|
||||
`InputType`
|
||||
: A compatible input, for instance:
|
||||
|
||||
- a `#!cpp std::string`, `#!cpp std::string_view`, or a C-style array of single-byte characters
|
||||
- a `#!cpp std::string`, a `#!cpp std::string_view` (C++17), or a C-style array of single-byte characters
|
||||
- a pointer to a null-terminated string of single-byte characters (`#!cpp char`, `#!cpp signed char`,
|
||||
`#!cpp unsigned char`, `#!cpp std::uint8_t`)
|
||||
- a container for which `#!cpp obj.data()` and `#!cpp obj.size()` give contiguous single-byte access, e.g.
|
||||
@@ -47,6 +49,10 @@ owned copy of a borrowable input as well.
|
||||
`#!cpp std::string::iterator`; the iterators of single-byte characters are borrowed or read like the byte inputs
|
||||
above, those of wide characters are converted to UTF-8
|
||||
|
||||
Ill-formed UTF-16 and UTF-32 sequences are rejected: a lone surrogate, a high surrogate that is not followed by its low
|
||||
surrogate, and a code point above `U+10FFFF` all yield a
|
||||
[`parse_error.101`](../../home/exceptions.md#jsonexceptionparse_error101).
|
||||
|
||||
## Parameters
|
||||
|
||||
`input` (in)
|
||||
@@ -215,3 +221,5 @@ buffer of a given length, pass a pair of pointers: `#!cpp parse(ptr, ptr + len)`
|
||||
## Version history
|
||||
|
||||
- Added in version 3.13.0.
|
||||
- Ill-formed UTF-16 and UTF-32 input (a lone surrogate, a high surrogate that is not followed by its low surrogate, or
|
||||
a code point above `U+10FFFF`) is rejected with `parse_error.101`.
|
||||
@@ -11,7 +11,7 @@
|
||||
<span class=w> </span><span class=k>const</span><span class=w> </span><span class=kt>bool</span><span class=w> </span><span class=n>allow_exceptions</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=nb>true</span><span class=p>,</span>
|
||||
<span class=w> </span><span class=k>const</span><span class=w> </span><span class=kt>bool</span><span class=w> </span><span class=n>ignore_comments</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=nb>false</span><span class=p>,</span>
|
||||
<span class=w> </span><span class=k>const</span><span class=w> </span><span class=kt>bool</span><span class=w> </span><span class=n>ignore_trailing_commas</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=nb>false</span><span class=p>);</span>
|
||||
</code></pre></div> <ol> <li>Deserialize from a compatible input, borrowing or owning it depending on its value category and type (see Notes).</li> <li>Deserialize from a pair of input iterators.</li> </ol> <p>Both overloads accept the same <abbr title="JavaScript Object Notation">JSON</abbr> text as <a href=../../basic_json/parse/ ><code>BasicJsonType::parse()</code></a>, with the same <code>ignore_comments</code>/<code>ignore_trailing_commas</code> options, but build a <a href=../ ><code>basic_json_document</code></a> (a flat index into the input) instead of a tree of <code>BasicJsonType</code> values. They take the same inputs as <code>BasicJsonType::parse()</code>. Byte inputs that stay alive can be borrowed; all others (streams, <code class=highlight><span class=kt>FILE</span><span class=o>*</span></code>, wide characters, non-contiguous iterators) are read into a copy that the document owns -- see the Notes. Use <a href=../parse_copy/ ><code>parse_copy()</code></a> to get an owned copy of a borrowable input as well.</p> <h2 id=template-parameters>Template parameters<a class=headerlink href=#template-parameters title="Permanent link">¶</a></h2> <dl> <dt><code>InputType</code></dt> <dd> <p>A compatible input, for instance:</p> <ul> <li>a <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>string</span></code>, <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>string_view</span></code>, or a C-style array of single-byte characters</li> <li>a pointer to a null-terminated string of single-byte characters (<code class=highlight><span class=kt>char</span></code>, <code class=highlight><span class=kt>signed</span><span class=w> </span><span class=kt>char</span></code>, <code class=highlight><span class=kt>unsigned</span><span class=w> </span><span class=kt>char</span></code>, <code class=highlight><span class=n>std</span><span class=o>::</span><span class=kt>uint8_t</span></code>)</li> <li>a container for which <code class=highlight><span class=n>obj</span><span class=p>.</span><span class=n>data</span><span class=p>()</span></code> and <code class=highlight><span class=n>obj</span><span class=p>.</span><span class=n>size</span><span class=p>()</span></code> give contiguous single-byte access, e.g. <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>vector</span><span class=o><</span><span class=kt>char</span><span class=o>></span></code> or <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>vector</span><span class=o><</span><span class=n>std</span><span class=o>::</span><span class=kt>uint8_t</span><span class=o>></span></code></li> <li>an <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>istream</span></code> object</li> <li>a <code class=highlight><span class=kt>FILE</span><span class=o>*</span></code> pointer</li> <li>wide characters (<code class=highlight><span class=kt>wchar_t</span></code>, <code class=highlight><span class=kt>char16_t</span></code>, <code class=highlight><span class=kt>char32_t</span></code>), which are converted to <abbr title="Unicode Transformation Format">UTF</abbr>-8: a wide string object (<code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>wstring</span></code>, <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>u16string</span></code>, <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>u32string</span></code>), an array (e.g. a wide string literal), or a pointer to a null-terminated wide string</li> </ul> </dd> <dt><code>IteratorType</code></dt> <dd>an input iterator type, for instance a pair of pointers such as <code>ptr</code> and <code>ptr + len</code>, or a pair of <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>string</span><span class=o>::</span><span class=n>iterator</span></code>; the iterators of single-byte characters are borrowed or read like the byte inputs above, those of wide characters are converted to <abbr title="Unicode Transformation Format">UTF</abbr>-8</dd> </dl> <h2 id=parameters>Parameters<a class=headerlink href=#parameters title="Permanent link">¶</a></h2> <dl> <dt><code>input</code> (in)</dt> <dd>Input to parse from.</dd> <dt><code>allow_exceptions</code> (in)</dt> <dd>whether to throw exceptions in case of a parse error (optional, <code class=highlight><span class=nb>true</span></code> by default)</dd> <dt><code>ignore_comments</code> (in)</dt> <dd>whether comments should be ignored and treated like whitespace (<code class=highlight><span class=nb>true</span></code>) or yield a parse error (<code class=highlight><span class=nb>false</span></code>); (optional, <code class=highlight><span class=nb>false</span></code> by default)</dd> <dt><code>ignore_trailing_commas</code> (in)</dt> <dd>whether trailing commas in arrays or objects should be ignoLine truncated
|
||||
</code></pre></div> <ol> <li>Deserialize from a compatible input, borrowing or owning it depending on its value category and type (see Notes).</li> <li>Deserialize from a pair of input iterators.</li> </ol> <p>Both overloads accept the same <abbr title="JavaScript Object Notation">JSON</abbr> text as <a href=../../basic_json/parse/ ><code>BasicJsonType::parse()</code></a>, with the same <code>ignore_comments</code>/<code>ignore_trailing_commas</code> options, but build a <a href=../ ><code>basic_json_document</code></a> (a flat index into the input) instead of a tree of <code>BasicJsonType</code> values. They accept every input <code>BasicJsonType::parse()</code> takes, and in addition a pointer to a null-terminated wide string (which <code>BasicJsonType::parse()</code> rejects). Contiguous inputs of single-byte characters that stay alive can be borrowed; all others (streams, <code class=highlight><span class=kt>FILE</span><span class=o>*</span></code>, wide characters, which must be converted to <abbr title="Unicode Transformation Format">UTF</abbr>-8, and non-contiguous iterators) are read into a copy that the document owns -- see the Notes. Use <a href=../parse_copy/ ><code>parse_copy()</code></a> to get an owned copy of a borrowable input as well.</p> <h2 id=template-parameters>Template parameters<a class=headerlink href=#template-parameters title="Permanent link">¶</a></h2> <dl> <dt><code>InputType</code></dt> <dd> <p>A compatible input, for instance:</p> <ul> <li>a <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>string</span></code>, a <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>string_view</span></code> (C++17), or a C-style array of single-byte characters</li> <li>a pointer to a null-terminated string of single-byte characters (<code class=highlight><span class=kt>char</span></code>, <code class=highlight><span class=kt>signed</span><span class=w> </span><span class=kt>char</span></code>, <code class=highlight><span class=kt>unsigned</span><span class=w> </span><span class=kt>char</span></code>, <code class=highlight><span class=n>std</span><span class=o>::</span><span class=kt>uint8_t</span></code>)</li> <li>a container for which <code class=highlight><span class=n>obj</span><span class=p>.</span><span class=n>data</span><span class=p>()</span></code> and <code class=highlight><span class=n>obj</span><span class=p>.</span><span class=n>size</span><span class=p>()</span></code> give contiguous single-byte access, e.g. <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>vector</span><span class=o><</span><span class=kt>char</span><span class=o>></span></code> or <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>vector</span><span class=o><</span><span class=n>std</span><span class=o>::</span><span class=kt>uint8_t</span><span class=o>></span></code></li> <li>an <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>istream</span></code> object</li> <li>a <code class=highlight><span class=kt>FILE</span><span class=o>*</span></code> pointer</li> <li>wide characters (<code class=highlight><span class=kt>wchar_t</span></code>, <code class=highlight><span class=kt>char16_t</span></code>, <code class=highlight><span class=kt>char32_t</span></code>), which are converted to <abbr title="Unicode Transformation Format">UTF</abbr>-8: a wide string object (<code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>wstring</span></code>, <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>u16string</span></code>, <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>u32string</span></code>), an array (e.g. a wide string literal), or a pointer to a null-terminated wide string</li> </ul> </dd> <dt><code>IteratorType</code></dt> <dd>an input iterator type, for instance a pair of pointers such as <code>ptr</code> and <code>ptr + len</code>, or a pair of <code class=highlight><span class=n>std</span><span class=o>::</span><span class=n>string</span><span class=o>::</span><span class=n>iterator</span></code>; the iterators of single-byte characters are borrowed or read like the byte inputs above, those of wide characters are converted to <abbr title="Unicode Transformation Format">UTF</abbr>-8</dd> </dl> <p>Ill-formed <abbr title="Unicode Transformation Format">UTF</abbr>-16 and <abbr title="Unicode Transformation Format">UTF</abbr>-32 sequences are rejected: a lone surrogate, a high surrogate that is not followed by its low surrogate, and a code point above <code>U+10FFFF</code> all yield a <a href=../../../home/exceptions/#jsonexceptionparse_error101><code>parse_error.101</code></a>.</p> <h2 id=parameters>Parameters<a class=headerlink href=#parameters title="Permanent link">¶</a></h2> <dl> <dt><code>input</code> (in)</dt> <dd>Input to parse from.</dLine truncated
|
||||
<span class=cp>#include</span><span class=w> </span><span class=cpf><string></span>
|
||||
<span class=cp>#include</span><span class=w> </span><span class=cpf><nlohmann/json.hpp></span>
|
||||
<span class=cp>#include</span><span class=w> </span><span class=cpf><nlohmann/json_view.hpp></span>
|
||||
@@ -71,4 +71,4 @@
|
||||
<span class=p>}</span>
|
||||
</code></pre></div> <p>Output:</p> <div class=highlight><pre><span></span><code><span class=kc>true</span><span class=w> </span><span class=mi>2</span>
|
||||
<span class=kc>false</span>
|
||||
</code></pre></div> </details> <h2 id=see-also>See also<a class=headerlink href=#see-also title="Permanent link">¶</a></h2> <ul> <li><a href=../parse_copy/ >parse_copy</a> - deserialize a copy of a compatible input</li> <li><a href=../accept/ >accept</a> - check whether the input is valid <abbr title="JavaScript Object Notation">JSON</abbr></li> <li><a href=../read/ >read</a> - (re-)parse into this document, reusing its memory</li> <li><a href=../owns_source/ >owns_source</a> - return whether the document holds its own copy of the text</li> <li><a href=../load/ >load</a> - read a document from an image instead of parsing <abbr title="JavaScript Object Notation">JSON</abbr> text</li> <li><a href=../../basic_json/parse/ ><code>BasicJsonType::parse</code></a> - the corresponding function of <code>basic_json</code></li> </ul> <h2 id=version-history>Version history<a class=headerlink href=#version-history title="Permanent link">¶</a></h2> <ul> <li>Added in version 3.13.0 <span class=unreleased-version title="Not part of a release yet; the latest release is 3.12.0.">unreleased</span>.</li> </ul> <!-- https://squidfunk.github.io/mkdocs-material/reference/tooltips/#adding-a-glossary --> <aside class=md-source-file> <span class=md-source-file__fact> <span class=md-icon title="Last update"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"/></svg> </span> <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="October 21, 2026 08:21:29 UTC">October 21, 2026</span> </span> </aside> </article> </div> <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> Copyright © 2013-2026 Niels Lohmann </div> </div> <div class=md-social> <a href="https://github.com/nlohmann" target="_blank" rel="noopener" title="github.com" class="md-social__link"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 512 512"><!-- Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M173.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M252.8 8C114.1 8 8 113.3 8 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C436.2 457.8 504 362.9 504 252 504 113.3 391.5 8 252.8 8M105.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg> </a> <a href="https://www.linkedin.com/in/nielslohmann/" target="_blank" rel="noopener" title="www.linkedin.com" class="md-social__link"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 448 512"><!-- Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><patLine truncated
|
||||
</code></pre></div> </details> <h2 id=see-also>See also<a class=headerlink href=#see-also title="Permanent link">¶</a></h2> <ul> <li><a href=../parse_copy/ >parse_copy</a> - deserialize a copy of a compatible input</li> <li><a href=../accept/ >accept</a> - check whether the input is valid <abbr title="JavaScript Object Notation">JSON</abbr></li> <li><a href=../read/ >read</a> - (re-)parse into this document, reusing its memory</li> <li><a href=../owns_source/ >owns_source</a> - return whether the document holds its own copy of the text</li> <li><a href=../load/ >load</a> - read a document from an image instead of parsing <abbr title="JavaScript Object Notation">JSON</abbr> text</li> <li><a href=../../basic_json/parse/ ><code>BasicJsonType::parse</code></a> - the corresponding function of <code>basic_json</code></li> </ul> <h2 id=version-history>Version history<a class=headerlink href=#version-history title="Permanent link">¶</a></h2> <ul> <li>Added in version 3.13.0 <span class=unreleased-version title="Not part of a release yet; the latest release is 3.12.0.">unreleased</span>.</li> <li>Ill-formed <abbr title="Unicode Transformation Format">UTF</abbr>-16 and <abbr title="Unicode Transformation Format">UTF</abbr>-32 input (a lone surrogate, a high surrogate that is not followed by its low surrogate, or a code point above <code>U+10FFFF</code>) is rejected with <code>parse_error.101</code>.</li> </ul> <!-- https://squidfunk.github.io/mkdocs-material/reference/tooltips/#adding-a-glossary --> <aside class=md-source-file> <span class=md-source-file__fact> <span class=md-icon title="Last update"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"/></svg> </span> <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="October 25, 2026 05:18:07 UTC">October 25, 2026</span> </span> </aside> </article> </div> <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> Copyright © 2013-2026 Niels Lohmann </div> </div> <div class=md-social> <a href="https://github.com/nlohmann" target="_blank" rel="noopener" title="github.com" class="md-social__link"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 512 512"><!-- Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M173.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M252.8 8C114.1 8 8 113.3 8 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C436.2 457.8 504 362.9 504 252 504 113.3 391.5 8 252.8 8M105.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg> </a> <a href="https://www.linkedin.com/in/nielslohmann/" target="_blank" rel="noopener" title=Line truncated
|
||||
@@ -19,14 +19,14 @@ static basic_json_document parse(IteratorType first, IteratorType last,
|
||||
1. Deserialize from a compatible input, borrowing or owning it depending on its value category and type (see Notes).
|
||||
1. Deserialize from a pair of input iterators.
|
||||
|
||||
Both overloads accept the same JSON text as [`BasicJsonType::parse()`](https://json.nlohmann.me/api/basic_json/parse/index.md), with the same `ignore_comments`/`ignore_trailing_commas` options, but build a [`basic_json_document`](https://json.nlohmann.me/api/basic_json_document/index.md) (a flat index into the input) instead of a tree of `BasicJsonType` values. They take the same inputs as `BasicJsonType::parse()`. Byte inputs that stay alive can be borrowed; all others (streams, `FILE*`, wide characters, non-contiguous iterators) are read into a copy that the document owns -- see the Notes. Use [`parse_copy()`](https://json.nlohmann.me/api/basic_json_document/parse_copy/index.md) to get an owned copy of a borrowable input as well.
|
||||
Both overloads accept the same JSON text as [`BasicJsonType::parse()`](https://json.nlohmann.me/api/basic_json/parse/index.md), with the same `ignore_comments`/`ignore_trailing_commas` options, but build a [`basic_json_document`](https://json.nlohmann.me/api/basic_json_document/index.md) (a flat index into the input) instead of a tree of `BasicJsonType` values. They accept every input `BasicJsonType::parse()` takes, and in addition a pointer to a null-terminated wide string (which `BasicJsonType::parse()` rejects). Contiguous inputs of single-byte characters that stay alive can be borrowed; all others (streams, `FILE*`, wide characters, which must be converted to UTF-8, and non-contiguous iterators) are read into a copy that the document owns -- see the Notes. Use [`parse_copy()`](https://json.nlohmann.me/api/basic_json_document/parse_copy/index.md) to get an owned copy of a borrowable input as well.
|
||||
|
||||
## Template parameters
|
||||
|
||||
`InputType` : A compatible input, for instance:
|
||||
|
||||
```
|
||||
- a `std::string`, `std::string_view`, or a C-style array of single-byte characters
|
||||
- a `std::string`, a `std::string_view` (C++17), or a C-style array of single-byte characters
|
||||
- a pointer to a null-terminated string of single-byte characters (`char`, `signed char`,
|
||||
`unsigned char`, `std::uint8_t`)
|
||||
- a container for which `obj.data()` and `obj.size()` give contiguous single-byte access, e.g.
|
||||
@@ -40,6 +40,8 @@ Both overloads accept the same JSON text as [`BasicJsonType::parse()`](https://j
|
||||
|
||||
`IteratorType` : an input iterator type, for instance a pair of pointers such as `ptr` and `ptr + len`, or a pair of `std::string::iterator`; the iterators of single-byte characters are borrowed or read like the byte inputs above, those of wide characters are converted to UTF-8
|
||||
|
||||
Ill-formed UTF-16 and UTF-32 sequences are rejected: a lone surrogate, a high surrogate that is not followed by its low surrogate, and a code point above `U+10FFFF` all yield a [`parse_error.101`](https://json.nlohmann.me/home/exceptions/#jsonexceptionparse_error101).
|
||||
|
||||
## Parameters
|
||||
|
||||
`input` (in) : Input to parse from.
|
||||
@@ -179,3 +181,4 @@ false
|
||||
## Version history
|
||||
|
||||
- Added in version 3.13.0 unreleased.
|
||||
- Ill-formed UTF-16 and UTF-32 input (a lone surrogate, a high surrogate that is not followed by its low surrogate, or a code point above `U+10FFFF`) is rejected with `parse_error.101`.
|
||||
Reference in new issue
Block a user