Files
tomlplusplus/structtoml_1_1source__position.html
2021-06-24 18:16:11 +00:00

203 lines
14 KiB
HTML

<!DOCTYPE html>
<html lang="en"><head>
<meta charset="utf-8"/>
<title>toml::source_position struct | toml++ TOML for modern C++</title>
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" rel="stylesheet"/>
<link href="m-dark+documentation.compiled.css" rel="stylesheet"/>
<link href="favicon.ico" rel="icon" type="image/vnd.microsoft.icon"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta content="#22272e" name="theme-color"/>
<meta content="toml++" name="twitter:title"/>
<meta content="toml++" property="og:title"/>
<meta content="toml++" itemprop="name"/>
<meta content="Mark Gillard" name="author"/>
<meta content="Mark Gillard" property="article:author"/>
<meta content="TOML for modern C++" name="description"/>
<meta content="TOML for modern C++" name="twitter:description"/>
<meta content="TOML for modern C++" property="og:description"/>
<meta content="TOML for modern C++" itemprop="description"/>
<meta content="telephone=no" name="format-detection"/>
<meta content="Poxy v0.4.5" name="generator"/>
<meta content="no-referrer-when-downgrade" name="referrer"/>
<meta content="gbtcNgKlNiPSMKkYMw4zWFVWGPH_oU93m9n_-nb4qK8" name="google-site-verification"/>
<link href="poxy-0.4.5.css" rel="stylesheet"/>
<link href="poxy-0.4.5-dark.css" rel="stylesheet"/>
<script src="poxy-0.4.5.js"></script>
</head>
<body>
<header><nav id="navigation">
<div class="m-container">
<div class="m-row">
<a class="m-col-t-8 m-col-m-none m-left-m" href="index.html" id="m-navbar-brand"><img alt="" src="logo.png"/>toml++ <span class="m-thin">TOML for modern C++</span></a>
<div class="m-col-t-4 m-hide-m m-text-right m-nopadr">
<a class="m-doc-search-icon" href="#search" onclick="return showSearch()" title="Search"><svg style="height: 0.9rem;" viewBox="0 0 16 16">
<path d="m6 0c-3.31 0-6 2.69-6 6 0 3.31 2.69 6 6 6 1.49 0 2.85-0.541 3.89-1.44-0.0164 0.338 0.147 0.759 0.5 1.15l3.22 3.79c0.552 0.614 1.45 0.665 2 0.115 0.55-0.55 0.499-1.45-0.115-2l-3.79-3.22c-0.392-0.353-0.812-0.515-1.15-0.5 0.895-1.05 1.44-2.41 1.44-3.89 0-3.31-2.69-6-6-6zm0 1.56a4.44 4.44 0 0 1 4.44 4.44 4.44 4.44 0 0 1-4.44 4.44 4.44 4.44 0 0 1-4.44-4.44 4.44 4.44 0 0 1 4.44-4.44z" id="m-doc-search-icon-path"></path>
</svg></a>
<a href="#navigation" id="m-navbar-show" title="Show navigation"></a>
<a href="#" id="m-navbar-hide" title="Hide navigation"></a>
</div>
<div class="m-col-t-12 m-show-m m-col-m-none m-right-m" id="m-navbar-collapse">
<div class="m-row">
<ol class="m-col-t-6 m-col-m-none">
<li><a href="namespaces.html">Namespaces</a></li>
<li><a href="annotated.html">Classes</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="3">
<li><a class="github poxy-external" href="https://github.com/marzer/tomlplusplus/" target="_blank">Github</a></li>
<li class="m-show-m"><a class="m-doc-search-icon" href="#search" onclick="return showSearch()" title="Search"><svg style="height: 0.9rem;" viewBox="0 0 16 16">
<use href="#m-doc-search-icon-path"></use>
</svg></a></li>
</ol>
</div>
</div>
</div>
</div>
</nav></header>
<main><article>
<div class="m-container m-container-inflatable">
<div class="m-row">
<div class="m-col-l-10 m-push-l-1">
<h1>
<span class="m-breadcrumb"><a href="namespacetoml.html">toml</a>::<wbr/></span>source_position <span class="m-thin">struct</span>
</h1>
<p>A source document line-and-column pair.</p>
<div class="m-block m-default poxy-toc">
<h3>Contents</h3>
<ul>
<li>
Reference
<ul>
<li><a href="#typeless-methods">Constructors, destructors, conversion operators</a></li>
<li><a href="#pub-attribs">Public variables</a></li>
<li><a href="#friends">Friends</a></li>
</ul>
</li>
</ul>
</div>
<pre class="m-code"><span class="k">auto</span> <span class="n">table</span> <span class="o">=</span> <span class="ns">toml</span><span class="o">::</span><span class="n">parse_file</span><span class="p">(</span><span class="s">"config.toml"</span><span class="sa">sv</span><span class="p">);</span>
<span class="ns">std</span><span class="o">::</span><span class="ut">cout</span> <span class="o">&lt;&lt;</span> <span class="s">"The node 'description' was defined at "</span><span class="sa">sv</span>
<span class="o">&lt;&lt;</span> <span class="n">table</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="s">"description"</span><span class="p">)</span><span class="o">-&gt;</span><span class="n">source</span><span class="p">().</span><span class="n">begin</span><span class="p">()</span>
<span class="o">&lt;&lt;</span> <span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">;</span></pre><pre class="m-console"><span class="go">The value 'description' was defined at line 7, column 15</span></pre><aside class="m-note m-default"><h4>Remark</h4><p>toml++'s parser is unicode-aware insofar as it knows how to handle various non-conventional whitespace and newline characters, but it doesn't give much thought to combining marks, grapheme clusters vs. characters, et cetera. If a TOML document contains lots of codepoints outside of the ASCII range you may find that your source_positions don't match those given by a text editor (typically the line numbers will be accurate but column numbers will be too high). <strong>This is not an error.</strong> I've chosen this behaviour as a deliberate trade-off between parser complexity and correctness.</p></aside>
<section id="typeless-methods">
<h2><a href="#typeless-methods">Constructors, destructors, conversion operators</a></h2>
<dl class="m-doc">
<dt id="accba2f34a07d8b453b8f2f6baf2d73cf">
<span class="m-doc-wrap-bumper"><a class="m-doc-self" href="#accba2f34a07d8b453b8f2f6baf2d73cf">operator bool</a>(</span><span class="m-doc-wrap">) const <span class="m-label m-flat m-info">explicit</span> <span class="m-label m-flat m-primary">constexpr</span> <span class="m-label m-flat m-success">noexcept</span></span>
</dt>
<dd>Returns true if both line and column numbers are non-zero.</dd>
</dl>
</section>
<section id="pub-attribs">
<h2><a href="#pub-attribs">Public variables</a></h2>
<dl class="m-doc">
<dt>
<a class="m-doc" href="namespacetoml.html#ae845239fd7271e3d8e529302d300ad5b">source_<wbr/>index</a> <a class="m-doc" href="#ab21cac59798d70e25fe97ac7433763cc">line</a>
</dt>
<dd>The line number.</dd>
<dt>
<a class="m-doc" href="namespacetoml.html#ae845239fd7271e3d8e529302d300ad5b">source_<wbr/>index</a> <a class="m-doc" href="#a1ca6d0db40c69d2784703011f7cf5434">column</a>
</dt>
<dd>The column number.</dd>
</dl>
</section>
<section id="friends">
<h2><a href="#friends">Friends</a></h2>
<dl class="m-doc">
<dt id="a90fec8fa1014a1358a362f9171cdb073">
<span class="m-doc-wrap-bumper">auto <a class="m-doc-self" href="#a90fec8fa1014a1358a362f9171cdb073">operator!=</a>(</span><span class="m-doc-wrap">const <a class="m-doc" href="structtoml_1_1source__position.html">source_<wbr/>position</a>&amp; lhs,
const <a class="m-doc" href="structtoml_1_1source__position.html">source_<wbr/>position</a>&amp; rhs) -&gt; friend bool <span class="m-label m-flat m-primary">constexpr</span> <span class="m-label m-flat m-success">noexcept</span></span>
</dt>
<dd>Returns true if two source_positions do not represent the same line and column.</dd>
<dt id="a771714902fb113445597a1fd2a24e8cd">
<span class="m-doc-wrap-bumper">auto <a class="m-doc-self" href="#a771714902fb113445597a1fd2a24e8cd">operator&lt;</a>(</span><span class="m-doc-wrap">const <a class="m-doc" href="structtoml_1_1source__position.html">source_<wbr/>position</a>&amp; lhs,
const <a class="m-doc" href="structtoml_1_1source__position.html">source_<wbr/>position</a>&amp; rhs) -&gt; friend bool <span class="m-label m-flat m-primary">constexpr</span> <span class="m-label m-flat m-success">noexcept</span></span>
</dt>
<dd>Returns true if the LHS position is before the RHS position.</dd>
<dt id="abb7d47c85374301ec48e7c5f3ee1c71a">
<span class="m-doc-wrap-bumper">auto <a class="m-doc-self" href="#abb7d47c85374301ec48e7c5f3ee1c71a">operator&lt;=</a>(</span><span class="m-doc-wrap">const <a class="m-doc" href="structtoml_1_1source__position.html">source_<wbr/>position</a>&amp; lhs,
const <a class="m-doc" href="structtoml_1_1source__position.html">source_<wbr/>position</a>&amp; rhs) -&gt; friend bool <span class="m-label m-flat m-primary">constexpr</span> <span class="m-label m-flat m-success">noexcept</span></span>
</dt>
<dd>Returns true if the LHS position is before the RHS position or equal to it.</dd>
<dt id="a2661adb822c0291c5328d9d00e4b9a8f">
<span class="m-doc-wrap-bumper">auto <a class="m-doc-self" href="#a2661adb822c0291c5328d9d00e4b9a8f">operator==</a>(</span><span class="m-doc-wrap">const <a class="m-doc" href="structtoml_1_1source__position.html">source_<wbr/>position</a>&amp; lhs,
const <a class="m-doc" href="structtoml_1_1source__position.html">source_<wbr/>position</a>&amp; rhs) -&gt; friend bool <span class="m-label m-flat m-primary">constexpr</span> <span class="m-label m-flat m-success">noexcept</span></span>
</dt>
<dd>Returns true if two source_positions represent the same line and column.</dd>
</dl>
</section>
<section>
<h2>Variable documentation</h2>
<section class="m-doc-details" id="ab21cac59798d70e25fe97ac7433763cc"><div>
<h3>
<a class="m-doc" href="namespacetoml.html#ae845239fd7271e3d8e529302d300ad5b">source_<wbr/>index</a> toml::<wbr/>source_position::<wbr/><a class="m-doc-self" href="#ab21cac59798d70e25fe97ac7433763cc">line</a>
</h3>
<p>The line number.</p>
<aside class="m-note m-default"><h4>Remark</h4><p>Valid line numbers start at 1.</p></aside>
</div></section>
<section class="m-doc-details" id="a1ca6d0db40c69d2784703011f7cf5434"><div>
<h3>
<a class="m-doc" href="namespacetoml.html#ae845239fd7271e3d8e529302d300ad5b">source_<wbr/>index</a> toml::<wbr/>source_position::<wbr/><a class="m-doc-self" href="#a1ca6d0db40c69d2784703011f7cf5434">column</a>
</h3>
<p>The column number.</p>
<aside class="m-note m-default"><h4>Remark</h4><p>Valid column numbers start at 1.</p></aside>
</div></section>
</section>
</div>
</div>
</div>
</article></main>
<div class="m-doc-search" id="search">
<a href="#!" onclick="return hideSearch()"></a>
<div class="m-container">
<div class="m-row">
<div class="m-col-m-8 m-push-m-2">
<div class="m-doc-search-header m-text m-small">
<div><span class="m-label m-default">Tab</span> / <span class="m-label m-default">T</span> to search, <span class="m-label m-default">Esc</span> to close</div>
<div id="search-symbolcount"></div>
</div>
<div class="m-doc-search-content">
<form>
<input autocomplete="off" autofocus="autofocus" disabled="disabled" id="search-input" name="q" placeholder="Loading …" spellcheck="false" type="search"/>
</form>
<noscript class="m-text m-danger m-text-center">Unlike everything else in the docs, the search functionality <em>requires</em> JavaScript.</noscript>
<div class="m-text m-dim m-text-center" id="search-help">
<p class="m-noindent">Search for symbols, directories, files, pages or
modules. You can omit any prefix from the symbol or file path; adding a
<code>:</code> or <code>/</code> suffix lists all members of given symbol or
directory.</p>
<p class="m-noindent">Use <span class="m-label m-dim"></span>
/ <span class="m-label m-dim"></span> to navigate through the list,
<span class="m-label m-dim">Enter</span> to go.
<span class="m-label m-dim">Tab</span> autocompletes common prefix, you can
copy a link to the result using <span class="m-label m-dim"></span>
<span class="m-label m-dim">L</span> while <span class="m-label m-dim"></span>
<span class="m-label m-dim">M</span> produces a Markdown link.</p>
</div>
<div class="m-text m-warning m-text-center" id="search-notfound">Sorry, nothing was found.</div>
<ul id="search-results"></ul>
</div>
</div>
</div>
</div>
</div>
<script src="search-v1.js"></script>
<script async="async" src="searchdata-v1.js"></script>
<footer><nav>
<div class="m-container">
<div class="m-row">
<div class="m-col-l-10 m-push-l-1">
<a class="poxy-external" href="https://github.com/marzer/tomlplusplus/" target="_blank">Github</a>
<a class="poxy-external" href="https://github.com/marzer/tomlplusplus/issues" target="_blank">Report an issue</a>
<a class="poxy-external" href="https://github.com/marzer/tomlplusplus/blob/master/LICENSE" target="_blank">License</a>
<a download="" href="toml++.tagfile.xml" target="_blank" type="text/xml">Doxygen tagfile</a>
<br/><br/>
Site generated using <a class="poxy-external" href="https://github.com/marzer/poxy/" target="_blank">Poxy</a>
</div>
</div>
</div>
</nav></footer>
</body></html>