Hazelnupp/docs/index.html
2021-06-04 02:44:09 +02:00

350 lines
29 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>Leonetienne/Hazelnupp: Hazelnupp</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="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>
<link href="doxygen.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="projectlogo"><img alt="Logo" src="nupp_small.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Leonetienne/Hazelnupp
</div>
<div id="projectbrief">Simple, easy to use, command line parameter interface</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="PageDoc"><div class="header">
<div class="headertitle">
<div class="title">Hazelnupp </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>is a simple, easy to use command line parameter parser. <br />
Hazelnupp does not support windows-, or bsd-style arguments. Only linux-style. <br />
</p>
<p>What is the linux-style? This: </p><div class="fragment"><div class="line"># Using a long parameter</div>
<div class="line">a.out --long-parameter 1234</div>
</div><!-- fragment --><div class="fragment"><div class="line"># Using an abbreviated parameter</div>
<div class="line">a.out -lp 1234</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md1"></a>
Note</h1>
<p>These examples reference exceptions. These are not enabled by default. The default behaviour for user-fault exceptions is to produce output to <code>stderr</code> and kill the process. <br />
To enable exceptions, call this method: </p><div class="fragment"><div class="line">Hazelnupp args;</div>
<div class="line">args.SetCrashOnFail(<span class="keyword">false</span>);</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md2"></a>
Importing into a project</h1>
<blockquote class="doxtable">
<p>How do i actually import this into my existing project? </p>
</blockquote>
<p>Super easily! Just grab the latest files (2) from <a href="https://github.com/Leonetienne/Hazelnupp/tree/master/INCLUDE">/INCLUDE</a> and put them into your project! You may have to add the .cpp to your compile list, but most IDEs should do this automatically.</p>
<h1><a class="anchor" id="autotoc_md3"></a>
What's the concept?</h1>
<p>The concept is that each parameter must be one of five types. These are:</p><ul>
<li>Void</li>
<li>Int</li>
<li>Float</li>
<li>String</li>
<li>List (non-recursive)</li>
</ul>
<p>Here are examples on how to create them </p><div class="fragment"><div class="line"># Void</div>
<div class="line">a.out --foo</div>
<div class="line"> </div>
<div class="line"># Int</div>
<div class="line">a.out --foo 5</div>
<div class="line"> </div>
<div class="line"># Float</div>
<div class="line">a.out --foo 5.5</div>
<div class="line"> </div>
<div class="line"># String</div>
<div class="line">a.out --foo peter</div>
<div class="line"> </div>
<div class="line"># List (any type above works)</div>
<div class="line">a.out --foo peter jake jeff billy</div>
<div class="line"> </div>
<div class="line"># List, mixed types</div>
<div class="line">a.out --foo 1 2 3 4 peter willy billy bob 3</div>
</div><!-- fragment --><p>These parameters can then be accessed via a simple lookup!</p>
<h1><a class="anchor" id="autotoc_md4"></a>
Minimal working example</h1>
<p>So what's the simplest way to use Hazelnupp to work with command-line parameters? See: </p><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="Hazelnupp_8h.html">Hazelnupp.h</a>&quot;</span></div>
<div class="line"><span class="keyword">using namespace </span><a class="code" href="namespaceHazelnp.html">Hazelnp</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> <a class="code" href="main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv)</div>
<div class="line">{</div>
<div class="line"> <a class="code" href="classHazelnp_1_1Hazelnupp.html">Hazelnupp</a> args(argc, argv);</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> (args.HasParam(<span class="stringliteral">&quot;--force&quot;</span>))</div>
<div class="line"> <span class="comment">// do forced</span></div>
<div class="line"> <span class="keywordflow">else</span></div>
<div class="line"> <span class="comment">// be gentle</span></div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
</div><!-- fragment --><p>Looks super easy! But what about actual values? </p><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="Hazelnupp_8h.html">Hazelnupp.h</a>&quot;</span></div>
<div class="line"><span class="keyword">using namespace </span><a class="code" href="namespaceHazelnp.html">Hazelnp</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> <a class="code" href="main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv)</div>
<div class="line">{</div>
<div class="line"> <a class="code" href="classHazelnp_1_1Hazelnupp.html">Hazelnupp</a> args(argc, argv);</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Either check via HasParam(), or do a try-catch</span></div>
<div class="line"> <span class="keywordflow">try</span></div>
<div class="line"> {</div>
<div class="line"> <span class="keywordtype">int</span> myInt = args[<span class="stringliteral">&quot;--my-int&quot;</span>].GetInt32();</div>
<div class="line"> <span class="keywordtype">double</span> myFlt = args[<span class="stringliteral">&quot;--my-float&quot;</span>].GetFloat32();</div>
<div class="line"> std::string myStr = args[<span class="stringliteral">&quot;--my-string&quot;</span>].GetString();</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">catch</span> (<a class="code" href="classHazelnp_1_1HazelnuppInvalidKeyException.html">HazelnuppInvalidKeyException</a>&amp;)</div>
<div class="line"> {</div>
<div class="line"> <span class="keywordflow">return</span> -1;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
</div><!-- fragment --><p>What about lists? </p><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="Hazelnupp_8h.html">Hazelnupp.h</a>&quot;</span></div>
<div class="line"><span class="keyword">using namespace </span><a class="code" href="namespaceHazelnp.html">Hazelnp</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> <a class="code" href="main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv)</div>
<div class="line">{</div>
<div class="line"> <a class="code" href="classHazelnp_1_1Hazelnupp.html">Hazelnupp</a> args(argc, argv);</div>
<div class="line"> </div>
<div class="line"> <span class="keyword">const</span> <span class="keyword">auto</span>&amp; myList = args[<span class="stringliteral">&quot;--my-list&quot;</span>].GetList(); <span class="comment">// std::vector&lt;Value*&gt;</span></div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>* it : myList)</div>
<div class="line"> {</div>
<div class="line"> <span class="comment">// Should probably check for type-correctness with it-&gt;GetDataType()</span></div>
<div class="line"> std::cout &lt;&lt; it-&gt;GetString() &lt;&lt; std::endl;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md5"></a>
Abbreviations</h1>
<p>Abbreviations are a very important part of command line arguments. Like, typing <code>-f</code> instead of <code>--force</code>. Here's how to use them in Hazelnupp: </p><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="Hazelnupp_8h.html">Hazelnupp.h</a>&quot;</span></div>
<div class="line"><span class="keyword">using namespace </span><a class="code" href="namespaceHazelnp.html">Hazelnp</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> <a class="code" href="main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv)</div>
<div class="line">{</div>
<div class="line"> <a class="code" href="classHazelnp_1_1Hazelnupp.html">Hazelnupp</a> args;</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Register abbreviations</span></div>
<div class="line"> args.<a class="code" href="classHazelnp_1_1Hazelnupp.html#abf1e0ebf0207ca2327fcde81f7372124">RegisterAbbreviation</a>(<span class="stringliteral">&quot;-f&quot;</span>, <span class="stringliteral">&quot;--force&quot;</span>);</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Parse</span></div>
<div class="line"> args.<a class="code" href="classHazelnp_1_1Hazelnupp.html#a1ccb88faca1a8deb77161888479c300b">Parse</a>(argc, argv);</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> (args.<a class="code" href="classHazelnp_1_1Hazelnupp.html#a8b79a79d40420ae748c108c691111040">HasParam</a>(<span class="stringliteral">&quot;--force&quot;</span>)) <span class="comment">// This key will be present, even if the user passed &#39;-f&#39;</span></div>
<div class="line"> <span class="comment">// do forced</span></div>
<div class="line"> <span class="keywordflow">else</span></div>
<div class="line"> <span class="comment">// be gentle</span></div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md6"></a>
Constraints</h1>
<blockquote class="doxtable">
<p>That's all cool and stuff, but this looks like a <b>LOT</b> of error-checking and not elegant at all! How would i <em>actually</em> use this? </p>
</blockquote>
<p>For exactly this reason, there are constraints. With this, you can control what the data looks like! Constraints serve two main purposes:</p>
<h2><a class="anchor" id="autotoc_md7"></a>
Requiring data</h2>
<p>With <code>ParamConstraint::Require()</code> you can declare that a paramater must either always be present, or provide a default value. <br />
</p><ul>
<li>If a parameter is not present, but has a default value, it will be automatically created.</li>
<li>If a parameter is not present, and has no default value, an exception will be thrown.</li>
</ul>
<p>Minimal working example: </p><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="Hazelnupp_8h.html">Hazelnupp.h</a>&quot;</span></div>
<div class="line"><span class="keyword">using namespace </span><a class="code" href="namespaceHazelnp.html">Hazelnp</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> <a class="code" href="main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv)</div>
<div class="line">{</div>
<div class="line"> <a class="code" href="classHazelnp_1_1Hazelnupp.html">Hazelnupp</a> args;</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Register constraints</span></div>
<div class="line"> args.<a class="code" href="classHazelnp_1_1Hazelnupp.html#a8a3331836b9ea1f920e77f6d332019d5">RegisterConstraints</a>({</div>
<div class="line"> <a class="code" href="structHazelnp_1_1ParamConstraint.html#afbcc75c428381ab3a292d3f55945eb32">ParamConstraint::Require</a>(<span class="stringliteral">&quot;--this-is-required&quot;</span>), <span class="comment">// This missing throws an exception</span></div>
<div class="line"> <a class="code" href="structHazelnp_1_1ParamConstraint.html#afbcc75c428381ab3a292d3f55945eb32">ParamConstraint::Require</a>(<span class="stringliteral">&quot;--also-required-but-defaulted&quot;</span>, {<span class="stringliteral">&quot;122&quot;</span>}), <span class="comment">// This will default to 122</span></div>
<div class="line"> });</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Parse</span></div>
<div class="line"> args.<a class="code" href="classHazelnp_1_1Hazelnupp.html#a1ccb88faca1a8deb77161888479c300b">Parse</a>(argc, argv);</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md8"></a>
Type safety</h2>
<p>With type safety you can always be certain that you are working with the correct type! <br />
By creating a type-constraint you force Hazelnupp to use a certain type. <br />
If a supplied type does not match, but is convertible, it will be converted. <br />
If it is not convertible, an exception will be thrown.</p>
<p>These conversions are:</p><ul>
<li>int -&gt; [float, string, list, void]</li>
<li>float -&gt;[int, string, list, void]</li>
<li>string -&gt; [list, void]</li>
<li>list -&gt; [void]</li>
<li>void -&gt; [list]</li>
</ul>
<p>The conversions <code>*-&gt;list</code> just create a list with a single entry (except for <code>void-&gt;list</code> which produces an empty list). <br />
The <code>*-&gt;void</code> conversions just drop their value.</p>
<p>Minimal working example: </p><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="Hazelnupp_8h.html">Hazelnupp.h</a>&quot;</span></div>
<div class="line"><span class="keyword">using namespace </span><a class="code" href="namespaceHazelnp.html">Hazelnp</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> <a class="code" href="main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv)</div>
<div class="line">{</div>
<div class="line"> <a class="code" href="classHazelnp_1_1Hazelnupp.html">Hazelnupp</a> args;</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Register constraints</span></div>
<div class="line"> args.<a class="code" href="classHazelnp_1_1Hazelnupp.html#a8a3331836b9ea1f920e77f6d332019d5">RegisterConstraints</a>({</div>
<div class="line"> <a class="code" href="structHazelnp_1_1ParamConstraint.html#ab85210bb37bbace962ff08fcccdafaf2">ParamConstraint::TypeSafety</a>(<span class="stringliteral">&quot;--this-must-be-int&quot;</span>, <a class="code" href="namespaceHazelnp.html#a07b61ac22ce9cd97eceebdf9487f803fa53f93baa3057821107c750323892fa92">DATA_TYPE::INT</a>)</div>
<div class="line"> });</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Parse</span></div>
<div class="line"> args.<a class="code" href="classHazelnp_1_1Hazelnupp.html#a1ccb88faca1a8deb77161888479c300b">Parse</a>(argc, argv);</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
</div><!-- fragment --><p>If <code>--this-must-be-int</code> would be passed as a float, it would be converted to int. If it was passed, for example, as a string, it would throw an exception.</p>
<hr />
<p> Note that you can also combine these two constraint-types by populating the struct yourself: </p><div class="fragment"><div class="line">ParamConstraint pc;</div>
<div class="line">pc.key = <span class="stringliteral">&quot;--my-key&quot;</span>;</div>
<div class="line">pc.constrainType = <span class="keyword">true</span>;</div>
<div class="line">pc.wantedType = DATA_TYPE::STRING;</div>
<div class="line">pc.defaultValue = {}; <span class="comment">// no default value</span></div>
<div class="line">pc.required = <span class="keyword">true</span>;</div>
<div class="line"> </div>
<div class="line">args.<a class="code" href="classHazelnp_1_1Hazelnupp.html#a8a3331836b9ea1f920e77f6d332019d5">RegisterConstraints</a>({pc});</div>
</div><!-- fragment --><p>What doesn't work is inserting multiple constraints for one key. It will just discard the oldest one. But that's okay because one can describe all possible constraints for a single key in <b>one</b> struct.</p>
<h1><a class="anchor" id="autotoc_md10"></a>
Automatic parameter documentation</h1>
<p>Hazelnupp does automatically create a parameter documentation, accessible via <code>--help</code>. <br />
If you want to use <code>--help</code> yourself, just turn it off. </p><div class="fragment"><div class="line">Hazelnupp args;</div>
<div class="line">args.<a class="code" href="classHazelnp_1_1Hazelnupp.html#a60e0a51cd92014a87e44322158e45872">SetCatchHelp</a>(<span class="keyword">false</span>);</div>
</div><!-- fragment --><p>What does this automatically generated documentation look like? </p><div class="fragment"><div class="line">$ a.out --help</div>
<div class="line"> </div>
<div class="line">This is the testing application for Hazelnupp.</div>
<div class="line"> </div>
<div class="line">==== AVAILABLE PARAMETERS ====</div>
<div class="line"> </div>
<div class="line">--help This will display the parameter documentation.</div>
<div class="line"> </div>
<div class="line">--name LIST default=[&#39;peter&#39; &#39;hannes&#39;] The names to target</div>
<div class="line"> </div>
<div class="line">--force -f Just forces it.</div>
<div class="line"> </div>
<div class="line">--width -w FLOAT The width of something...</div>
<div class="line"> </div>
<div class="line">--fruit STRING [[REQUIRED]] The fruit to use</div>
<div class="line"> </div>
<div class="line">--height -h</div>
</div><!-- fragment --><p>This documentation is automatically fed by any information provided on parameters. <br />
You have to set the brief descriptions yourself though. </p><div class="fragment"><div class="line">Hazelnupp args;</div>
<div class="line">args.RegisterDescription(<span class="stringliteral">&quot;--force&quot;</span>, <span class="stringliteral">&quot;Just forces it.&quot;</span>);</div>
</div><!-- fragment --><p>Additionally you can provide a brief description of your application to be added right above the parameter list. </p><div class="fragment"><div class="line">Hazelnupp args;</div>
<div class="line">args.SetBriefDescription(<span class="stringliteral">&quot;This is the testing application for Hazelnupp.&quot;</span>);</div>
</div><!-- fragment --><p>If you want to display this information somewhere else, you can always access it as a string via <code>args.GenerateDocumentation()</code>.</p>
<h1><a class="anchor" id="autotoc_md11"></a>
More examples?</h1>
<p>Check out the unit tests! They may help you out! <br />
Also make sure to check out the <a href="https://leonetienne.github.io/Hazelnupp/">doxygen docs</a>!</p>
<h1><a class="anchor" id="autotoc_md12"></a>
Further notes</h1>
<p>This is still in alpha! There is no guarantee at all that this actually works. <br />
Whilst i did my best do make sure it does, i bet there are still a few flaws i did overlook. <br />
Please know that i am not obliged to work on fixes. I do have other stuff to do. This does not mean that i won't do it, but i'm not sure when. <br />
Feel free to submit a PR if you fixed something :)</p>
<h1><a class="anchor" id="autotoc_md13"></a>
What is not supported?</h1>
<p>Chaining abbreviated parameters, like this: </p><div class="fragment"><div class="line"># This is not supported. It would think -ltr is one parameter.</div>
<div class="line">a.out -ltr</div>
<div class="line"> </div>
<div class="line"># Instead do this</div>
<div class="line">a.out -l -t -r</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md14"></a>
LICENSE</h1>
<div class="fragment"><div class="line">Copyright (c) 2021, Leon Etienne</div>
<div class="line"> </div>
<div class="line">Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</div>
<div class="line"> </div>
<div class="line">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</div>
<div class="line">Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</div>
<div class="line"> </div>
<div class="line">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</div>
</div><!-- fragment --> </div></div><!-- PageDoc -->
</div><!-- contents -->
<div class="ttc" id="anamespaceHazelnp_html"><div class="ttname"><a href="namespaceHazelnp.html">Hazelnp</a></div><div class="ttdef"><b>Definition:</b> <a href="DataType_8h_source.html#l00004">DataType.h:4</a></div></div>
<div class="ttc" id="aclassHazelnp_1_1HazelnuppInvalidKeyException_html"><div class="ttname"><a href="classHazelnp_1_1HazelnuppInvalidKeyException.html">Hazelnp::HazelnuppInvalidKeyException</a></div><div class="ttdoc">Gets thrown when an non-existent key gets dereferenced.</div><div class="ttdef"><b>Definition:</b> <a href="HazelnuppException_8h_source.html#l00026">HazelnuppException.h:26</a></div></div>
<div class="ttc" id="aclassHazelnp_1_1Hazelnupp_html"><div class="ttname"><a href="classHazelnp_1_1Hazelnupp.html">Hazelnp::Hazelnupp</a></div><div class="ttdoc">The main class to interface with.</div><div class="ttdef"><b>Definition:</b> <a href="Hazelnupp_8h_source.html#l00011">Hazelnupp.h:11</a></div></div>
<div class="ttc" id="amain_8cpp_html_a3c04138a5bfe5d72780bb7e82a18e627"><div class="ttname"><a href="main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a></div><div class="ttdeci">int main(int argc, char **argv)</div><div class="ttdef"><b>Definition:</b> <a href="main_8cpp_source.html#l00007">main.cpp:7</a></div></div>
<div class="ttc" id="aclassHazelnp_1_1Hazelnupp_html_a60e0a51cd92014a87e44322158e45872"><div class="ttname"><a href="classHazelnp_1_1Hazelnupp.html#a60e0a51cd92014a87e44322158e45872">Hazelnp::Hazelnupp::SetCatchHelp</a></div><div class="ttdeci">void SetCatchHelp(bool catchHelp)</div><div class="ttdoc">Sets whether the Hazelnupp should automatically catch the help parameter, print the parameter docume...</div><div class="ttdef"><b>Definition:</b> <a href="Hazelnupp_8cpp_source.html#l00295">Hazelnupp.cpp:295</a></div></div>
<div class="ttc" id="aclassHazelnp_1_1Hazelnupp_html_a8b79a79d40420ae748c108c691111040"><div class="ttname"><a href="classHazelnp_1_1Hazelnupp.html#a8b79a79d40420ae748c108c691111040">Hazelnp::Hazelnupp::HasParam</a></div><div class="ttdeci">bool HasParam(const std::string &amp;key) const</div><div class="ttdoc">Will check wether a parameter exists given a key, or not.</div><div class="ttdef"><b>Definition:</b> <a href="Hazelnupp_8cpp_source.html#l00164">Hazelnupp.cpp:164</a></div></div>
<div class="ttc" id="aclassHazelnp_1_1Hazelnupp_html_a1ccb88faca1a8deb77161888479c300b"><div class="ttname"><a href="classHazelnp_1_1Hazelnupp.html#a1ccb88faca1a8deb77161888479c300b">Hazelnp::Hazelnupp::Parse</a></div><div class="ttdeci">void Parse(const int argc, const char *const *argv)</div><div class="ttdoc">Will parse command line arguments.</div><div class="ttdef"><b>Definition:</b> <a href="Hazelnupp_8cpp_source.html#l00035">Hazelnupp.cpp:35</a></div></div>
<div class="ttc" id="aclassHazelnp_1_1Hazelnupp_html_abf1e0ebf0207ca2327fcde81f7372124"><div class="ttname"><a href="classHazelnp_1_1Hazelnupp.html#abf1e0ebf0207ca2327fcde81f7372124">Hazelnp::Hazelnupp::RegisterAbbreviation</a></div><div class="ttdeci">void RegisterAbbreviation(const std::string &amp;abbrev, const std::string &amp;target)</div><div class="ttdoc">Will register an abbreviation (like -f for force)</div><div class="ttdef"><b>Definition:</b> <a href="Hazelnupp_8cpp_source.html#l00499">Hazelnupp.cpp:499</a></div></div>
<div class="ttc" id="aclassHazelnp_1_1Hazelnupp_html_a8a3331836b9ea1f920e77f6d332019d5"><div class="ttname"><a href="classHazelnp_1_1Hazelnupp.html#a8a3331836b9ea1f920e77f6d332019d5">Hazelnp::Hazelnupp::RegisterConstraints</a></div><div class="ttdeci">void RegisterConstraints(const std::vector&lt; ParamConstraint &gt; &amp;constraints)</div><div class="ttdoc">Will register parameter constraints.</div><div class="ttdef"><b>Definition:</b> <a href="Hazelnupp_8cpp_source.html#l00521">Hazelnupp.cpp:521</a></div></div>
<div class="ttc" id="aHazelnupp_8h_html"><div class="ttname"><a href="Hazelnupp_8h.html">Hazelnupp.h</a></div></div>
<div class="ttc" id="astructHazelnp_1_1ParamConstraint_html_afbcc75c428381ab3a292d3f55945eb32"><div class="ttname"><a href="structHazelnp_1_1ParamConstraint.html#afbcc75c428381ab3a292d3f55945eb32">Hazelnp::ParamConstraint::Require</a></div><div class="ttdeci">static ParamConstraint Require(const std::string &amp;key, const std::vector&lt; std::string &gt; &amp;defaultValue={}, bool required=true)</div><div class="ttdoc">Constructs a require constraint.</div><div class="ttdef"><b>Definition:</b> <a href="ParamConstraint_8h_source.html#l00016">ParamConstraint.h:16</a></div></div>
<div class="ttc" id="anamespaceHazelnp_html_a07b61ac22ce9cd97eceebdf9487f803fa53f93baa3057821107c750323892fa92"><div class="ttname"><a href="namespaceHazelnp.html#a07b61ac22ce9cd97eceebdf9487f803fa53f93baa3057821107c750323892fa92">Hazelnp::DATA_TYPE::INT</a></div><div class="ttdeci">@ INT</div></div>
<div class="ttc" id="astructHazelnp_1_1ParamConstraint_html_ab85210bb37bbace962ff08fcccdafaf2"><div class="ttname"><a href="structHazelnp_1_1ParamConstraint.html#ab85210bb37bbace962ff08fcccdafaf2">Hazelnp::ParamConstraint::TypeSafety</a></div><div class="ttdeci">static ParamConstraint TypeSafety(const std::string &amp;key, DATA_TYPE wantedType, bool constrainType=true)</div><div class="ttdoc">Constructs a type-safety constraint.</div><div class="ttdef"><b>Definition:</b> <a href="ParamConstraint_8h_source.html#l00027">ParamConstraint.h:27</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Jun 4 2021 02:43:55 for Leonetienne/Hazelnupp by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>