renderd7/classnlohmann_1_1detail_1_1parse__error.html
2022-04-13 18:07:13 +00:00

239 lines
18 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Renderd7-nightly: nlohmann::detail::parse_error Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="docsn.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Renderd7-nightly
&#160;<span id="projectnumber">v0.7.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classnlohmann_1_1detail_1_1parse__error.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="classnlohmann_1_1detail_1_1parse__error-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">nlohmann::detail::parse_error Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>exception indicating a parse error
<a href="classnlohmann_1_1detail_1_1parse__error.html#details">More...</a></p>
<p><code>#include &lt;json.hpp&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for nlohmann::detail::parse_error:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center">
<img src="classnlohmann_1_1detail_1_1parse__error.png" usemap="#nlohmann::detail::parse_5Ferror_map" alt=""/>
<map id="nlohmann::detail::parse_5Ferror_map" name="nlohmann::detail::parse_5Ferror_map">
<area href="classnlohmann_1_1detail_1_1exception.html" title="general exception of the basic_json class" alt="nlohmann::detail::exception" shape="rect" coords="0,0,176,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a137ea4d27de45d8a844fd13451d40f3d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classnlohmann_1_1detail_1_1parse__error.html">parse_error</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnlohmann_1_1detail_1_1parse__error.html#a137ea4d27de45d8a844fd13451d40f3d">create</a> (int id_, const <a class="el" href="structnlohmann_1_1detail_1_1position__t.html">position_t</a> &amp;pos, const std::string &amp;what_arg)</td></tr>
<tr class="memdesc:a137ea4d27de45d8a844fd13451d40f3d"><td class="mdescLeft">&#160;</td><td class="mdescRight">create a parse error exception <a href="classnlohmann_1_1detail_1_1parse__error.html#a137ea4d27de45d8a844fd13451d40f3d">More...</a><br /></td></tr>
<tr class="separator:a137ea4d27de45d8a844fd13451d40f3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a9505aaa1ca943be927eec7cc579592ff"><td class="memItemLeft" align="right" valign="top">const std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnlohmann_1_1detail_1_1parse__error.html#a9505aaa1ca943be927eec7cc579592ff">byte</a></td></tr>
<tr class="memdesc:a9505aaa1ca943be927eec7cc579592ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">byte index of the parse error <a href="classnlohmann_1_1detail_1_1parse__error.html#a9505aaa1ca943be927eec7cc579592ff">More...</a><br /></td></tr>
<tr class="separator:a9505aaa1ca943be927eec7cc579592ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_attribs_classnlohmann_1_1detail_1_1exception"><td colspan="2" onclick="javascript:toggleInherit('pub_attribs_classnlohmann_1_1detail_1_1exception')"><img src="closed.png" alt="-"/>&#160;Public Attributes inherited from <a class="el" href="classnlohmann_1_1detail_1_1exception.html">nlohmann::detail::exception</a></td></tr>
<tr class="memitem:a0d4589a3fb54e81646d986c05efa3b9a inherit pub_attribs_classnlohmann_1_1detail_1_1exception"><td class="memItemLeft" align="right" valign="top"><a id="a0d4589a3fb54e81646d986c05efa3b9a"></a>
const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnlohmann_1_1detail_1_1exception.html#a0d4589a3fb54e81646d986c05efa3b9a">id</a></td></tr>
<tr class="memdesc:a0d4589a3fb54e81646d986c05efa3b9a inherit pub_attribs_classnlohmann_1_1detail_1_1exception"><td class="mdescLeft">&#160;</td><td class="mdescRight">the id of the exception <br /></td></tr>
<tr class="separator:a0d4589a3fb54e81646d986c05efa3b9a inherit pub_attribs_classnlohmann_1_1detail_1_1exception"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_methods_classnlohmann_1_1detail_1_1exception"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classnlohmann_1_1detail_1_1exception')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classnlohmann_1_1detail_1_1exception.html">nlohmann::detail::exception</a></td></tr>
<tr class="memitem:a11fe48748e811531614c84883b00ccd5 inherit pub_methods_classnlohmann_1_1detail_1_1exception"><td class="memItemLeft" align="right" valign="top"><a id="a11fe48748e811531614c84883b00ccd5"></a>
const JSON_HEDLEY_RETURNS_NON_NULL char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnlohmann_1_1detail_1_1exception.html#a11fe48748e811531614c84883b00ccd5">what</a> () const noexcept override</td></tr>
<tr class="memdesc:a11fe48748e811531614c84883b00ccd5 inherit pub_methods_classnlohmann_1_1detail_1_1exception"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the explanatory string <br /></td></tr>
<tr class="separator:a11fe48748e811531614c84883b00ccd5 inherit pub_methods_classnlohmann_1_1detail_1_1exception"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>exception indicating a parse error </p>
<p>This exception is thrown by the library when a parse error occurs. Parse errors can occur during the deserialization of JSON text, CBOR, MessagePack, as well as when using JSON Patch.</p>
<p>Member <em>byte</em> holds the byte index of the last read character in the input file.</p>
<p>Exceptions have ids 1xx.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">name / id </th><th class="markdownTableHeadNone">example message </th><th class="markdownTableHeadNone">description </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">json.exception.parse_error.101 </td><td class="markdownTableBodyNone">parse error at 2: unexpected end of input; expected string literal </td><td class="markdownTableBodyNone">This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member <em>byte</em> indicates the error position. </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">json.exception.parse_error.102 </td><td class="markdownTableBodyNone">parse error at 14: missing or wrong low surrogate </td><td class="markdownTableBodyNone">JSON uses the <code>\uxxxx</code> format to describe Unicode characters. Code points above above 0xFFFF are split into two <code>\uxxxx</code> entries ("surrogate pairs"). This error indicates that the surrogate pair is incomplete or contains an invalid code point. </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">json.exception.parse_error.103 </td><td class="markdownTableBodyNone">parse error: code points above 0x10FFFF are invalid </td><td class="markdownTableBodyNone">Unicode supports code points up to 0x10FFFF. Code points above 0x10FFFF are invalid. </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">json.exception.parse_error.104 </td><td class="markdownTableBodyNone">parse error: JSON patch must be an array of objects </td><td class="markdownTableBodyNone"><a href="https://tools.ietf.org/html/rfc6902">RFC 6902</a> requires a JSON Patch document to be a JSON document that represents an array of objects. </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">json.exception.parse_error.105 </td><td class="markdownTableBodyNone">parse error: operation must have string member 'op' </td><td class="markdownTableBodyNone">An operation of a JSON Patch document must contain exactly one "op" member, whose value indicates the operation to perform. Its value must be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors. </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">json.exception.parse_error.106 </td><td class="markdownTableBodyNone">parse error: array index '01' must not begin with '0' </td><td class="markdownTableBodyNone">An array index in a JSON Pointer (<a href="https://tools.ietf.org/html/rfc6901">RFC 6901</a>) may be <code>0</code> or any number without a leading <code>0</code>. </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">json.exception.parse_error.107 </td><td class="markdownTableBodyNone">parse error: JSON pointer must be empty or begin with '/' - was: 'foo' </td><td class="markdownTableBodyNone">A JSON Pointer must be a Unicode string containing a sequence of zero or more reference tokens, each prefixed by a <code>/</code> character. </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">json.exception.parse_error.108 </td><td class="markdownTableBodyNone">parse error: escape character '~' must be followed with '0' or '1' </td><td class="markdownTableBodyNone">In a JSON Pointer, only <code>~0</code> and <code>~1</code> are valid escape sequences. </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">json.exception.parse_error.109 </td><td class="markdownTableBodyNone">parse error: array index 'one' is not a number </td><td class="markdownTableBodyNone">A JSON Pointer array index must be a number. </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">json.exception.parse_error.110 </td><td class="markdownTableBodyNone">parse error at 1: cannot read 2 bytes from vector </td><td class="markdownTableBodyNone">When parsing CBOR or MessagePack, the byte vector ends before the complete value has been read. </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">json.exception.parse_error.112 </td><td class="markdownTableBodyNone">parse error at 1: error reading CBOR; last byte: 0xF8 </td><td class="markdownTableBodyNone">Not all types of CBOR or MessagePack are supported. This exception occurs if an unsupported byte was read. </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">json.exception.parse_error.113 </td><td class="markdownTableBodyNone">parse error at 2: expected a CBOR string; last byte: 0x98 </td><td class="markdownTableBodyNone">While parsing a map key, a value that is not a string has been read. </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">json.exception.parse_error.114 </td><td class="markdownTableBodyNone">parse error: Unsupported BSON record type 0x0F </td><td class="markdownTableBodyNone">The parsing of the corresponding BSON record type is not implemented (yet). </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">json.exception.parse_error.115 </td><td class="markdownTableBodyNone">parse error at byte 5: syntax error while parsing UBJSON high-precision number: invalid number text: 1A </td><td class="markdownTableBodyNone">A UBJSON high-precision number could not be parsed. </td></tr>
</table>
<dl class="section note"><dt>Note</dt><dd>For an input with n bytes, 1 is the index of the first character and n+1 is the index of the terminating null byte or the end of file. This also holds true when reading a byte vector (CBOR or MessagePack).</dd></dl>
<p>@liveexample{The following code shows how a <code><a class="el" href="classnlohmann_1_1detail_1_1parse__error.html" title="exception indicating a parse error">parse_error</a></code> exception can be caught.,<a class="el" href="classnlohmann_1_1detail_1_1parse__error.html" title="exception indicating a parse error">parse_error</a>}</p>
<dl class="section see"><dt>See also</dt><dd>- <a class="el" href="classnlohmann_1_1detail_1_1exception.html">exception</a> for the base class of the library exceptions </dd>
<dd>
- <a class="el" href="classnlohmann_1_1detail_1_1invalid__iterator.html">invalid_iterator</a> for exceptions indicating errors with iterators </dd>
<dd>
- <a class="el" href="classnlohmann_1_1detail_1_1type__error.html">type_error</a> for exceptions indicating executing a member function with a wrong type </dd>
<dd>
- <a class="el" href="classnlohmann_1_1detail_1_1out__of__range.html">out_of_range</a> for exceptions indicating access out of the defined range </dd>
<dd>
- <a class="el" href="classnlohmann_1_1detail_1_1other__error.html">other_error</a> for exceptions indicating other library errors</dd></dl>
<dl class="section since"><dt>Since</dt><dd>version 3.0.0 </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a137ea4d27de45d8a844fd13451d40f3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a137ea4d27de45d8a844fd13451d40f3d">&#9670;&nbsp;</a></span>create()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classnlohmann_1_1detail_1_1parse__error.html">parse_error</a> nlohmann::detail::parse_error::create </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>id_</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="structnlohmann_1_1detail_1_1position__t.html">position_t</a> &amp;&#160;</td>
<td class="paramname"><em>pos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>what_arg</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>create a parse error exception </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">id_</td><td>the id of the exception </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">pos</td><td>the position where the error occurred (or with chars_read_total=0 if the position cannot be determined) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">what_arg</td><td>the explanatory string </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classnlohmann_1_1detail_1_1parse__error.html" title="exception indicating a parse error">parse_error</a> object </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a9505aaa1ca943be927eec7cc579592ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9505aaa1ca943be927eec7cc579592ff">&#9670;&nbsp;</a></span>byte</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const std::size_t nlohmann::detail::parse_error::byte</td>
</tr>
</table>
</div><div class="memdoc">
<p>byte index of the parse error </p>
<p>The byte index of the last read character in the input file.</p>
<dl class="section note"><dt>Note</dt><dd>For an input with n bytes, 1 is the index of the first character and n+1 is the index of the terminating null byte or the end of file. This also holds true when reading a byte vector (CBOR or MessagePack). </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespacenlohmann.html">nlohmann</a></li><li class="navelem"><a class="el" href="namespacenlohmann_1_1detail.html">detail</a></li><li class="navelem"><a class="el" href="classnlohmann_1_1detail_1_1parse__error.html">parse_error</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
</ul>
</div>
</body>
</html>