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

209 lines
12 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::json_sax_dom_parser&lt; BasicJsonType &gt; Class Template 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_1json__sax__dom__parser.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classnlohmann_1_1detail_1_1json__sax__dom__parser-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">nlohmann::detail::json_sax_dom_parser&lt; BasicJsonType &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>SAX implementation to create a JSON value from SAX events.
<a href="classnlohmann_1_1detail_1_1json__sax__dom__parser.html#details">More...</a></p>
<p><code>#include &lt;json.hpp&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:afc50fee0a92ce84afb84041ebbdfba80"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnlohmann_1_1detail_1_1json__sax__dom__parser.html#afc50fee0a92ce84afb84041ebbdfba80">json_sax_dom_parser</a> (BasicJsonType &amp;r, const bool allow_exceptions_=true)</td></tr>
<tr class="separator:afc50fee0a92ce84afb84041ebbdfba80"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:aa1a5e21be350727cf61a101aa5c6796e"><td class="memTemplParams" colspan="2">template&lt;typename Value &gt; </td></tr>
<tr class="memitem:aa1a5e21be350727cf61a101aa5c6796e"><td class="memTemplItemLeft" align="right" valign="top">JSON_HEDLEY_RETURNS_NON_NULL BasicJsonType *&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classnlohmann_1_1detail_1_1json__sax__dom__parser.html#aa1a5e21be350727cf61a101aa5c6796e">handle_value</a> (Value &amp;&amp;v)</td></tr>
<tr class="separator:aa1a5e21be350727cf61a101aa5c6796e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:aef0477277389e399d7128898841b71c0"><td class="memItemLeft" align="right" valign="top"><a id="aef0477277389e399d7128898841b71c0"></a>
BasicJsonType &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnlohmann_1_1detail_1_1json__sax__dom__parser.html#aef0477277389e399d7128898841b71c0">root</a></td></tr>
<tr class="memdesc:aef0477277389e399d7128898841b71c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">the parsed JSON value <br /></td></tr>
<tr class="separator:aef0477277389e399d7128898841b71c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa7526e7ae7be7f63803a23fd8cf36e5d"><td class="memItemLeft" align="right" valign="top"><a id="aa7526e7ae7be7f63803a23fd8cf36e5d"></a>
std::vector&lt; BasicJsonType * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnlohmann_1_1detail_1_1json__sax__dom__parser.html#aa7526e7ae7be7f63803a23fd8cf36e5d">ref_stack</a> {}</td></tr>
<tr class="memdesc:aa7526e7ae7be7f63803a23fd8cf36e5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">stack to model hierarchy of values <br /></td></tr>
<tr class="separator:aa7526e7ae7be7f63803a23fd8cf36e5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c03c76d3a8e89c8928097ba0b92c2db"><td class="memItemLeft" align="right" valign="top"><a id="a9c03c76d3a8e89c8928097ba0b92c2db"></a>
BasicJsonType *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnlohmann_1_1detail_1_1json__sax__dom__parser.html#a9c03c76d3a8e89c8928097ba0b92c2db">object_element</a> = nullptr</td></tr>
<tr class="memdesc:a9c03c76d3a8e89c8928097ba0b92c2db"><td class="mdescLeft">&#160;</td><td class="mdescRight">helper to hold the reference for the next object element <br /></td></tr>
<tr class="separator:a9c03c76d3a8e89c8928097ba0b92c2db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31ccb472ed855e2f2370fd091d91aad7"><td class="memItemLeft" align="right" valign="top"><a id="a31ccb472ed855e2f2370fd091d91aad7"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnlohmann_1_1detail_1_1json__sax__dom__parser.html#a31ccb472ed855e2f2370fd091d91aad7">errored</a> = false</td></tr>
<tr class="memdesc:a31ccb472ed855e2f2370fd091d91aad7"><td class="mdescLeft">&#160;</td><td class="mdescRight">whether a syntax error occurred <br /></td></tr>
<tr class="separator:a31ccb472ed855e2f2370fd091d91aad7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0953e8d888339421d909d9016bc6e2c"><td class="memItemLeft" align="right" valign="top"><a id="ad0953e8d888339421d909d9016bc6e2c"></a>
const bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnlohmann_1_1detail_1_1json__sax__dom__parser.html#ad0953e8d888339421d909d9016bc6e2c">allow_exceptions</a> = true</td></tr>
<tr class="memdesc:ad0953e8d888339421d909d9016bc6e2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">whether to throw exceptions in case of errors <br /></td></tr>
<tr class="separator:ad0953e8d888339421d909d9016bc6e2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename BasicJsonType&gt;<br />
class nlohmann::detail::json_sax_dom_parser&lt; BasicJsonType &gt;</h3>
<p>SAX implementation to create a JSON value from SAX events. </p>
<p>This class implements the <a class="el" href="structnlohmann_1_1json__sax.html">json_sax</a> interface and processes the SAX events to create a JSON value which makes it basically a DOM parser. The structure or hierarchy of the JSON value is managed by the stack <code>ref_stack</code> which contains a pointer to the respective array or object for each recursion depth.</p>
<p>After successful parsing, the value that is passed by reference to the constructor contains the parsed value.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">BasicJsonType</td><td>the JSON type </td></tr>
</table>
</dd>
</dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="afc50fee0a92ce84afb84041ebbdfba80"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afc50fee0a92ce84afb84041ebbdfba80">&#9670;&nbsp;</a></span>json_sax_dom_parser()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BasicJsonType &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classnlohmann_1_1detail_1_1json__sax__dom__parser.html">nlohmann::detail::json_sax_dom_parser</a>&lt; BasicJsonType &gt;::<a class="el" href="classnlohmann_1_1detail_1_1json__sax__dom__parser.html">json_sax_dom_parser</a> </td>
<td>(</td>
<td class="paramtype">BasicJsonType &amp;&#160;</td>
<td class="paramname"><em>r</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const bool&#160;</td>
<td class="paramname"><em>allow_exceptions_</em> = <code>true</code>&#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">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in,out]</td><td class="paramname">r</td><td>reference to a JSON value that is manipulated while parsing </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">allow_exceptions_</td><td>whether parse errors yield exceptions </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aa1a5e21be350727cf61a101aa5c6796e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa1a5e21be350727cf61a101aa5c6796e">&#9670;&nbsp;</a></span>handle_value()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BasicJsonType &gt; </div>
<div class="memtemplate">
template&lt;typename Value &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">JSON_HEDLEY_RETURNS_NON_NULL BasicJsonType* <a class="el" href="classnlohmann_1_1detail_1_1json__sax__dom__parser.html">nlohmann::detail::json_sax_dom_parser</a>&lt; BasicJsonType &gt;::handle_value </td>
<td>(</td>
<td class="paramtype">Value &amp;&amp;&#160;</td>
<td class="paramname"><em>v</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section invariant"><dt>Invariant</dt><dd>If the ref stack is empty, then the passed value will be the new root. </dd>
<dd>
If the ref stack contains a value, then it is an array or an object to which we can add elements </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_1json__sax__dom__parser.html">json_sax_dom_parser</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>