Built doxygen
This commit is contained in:
@@ -91,10 +91,7 @@ Importing into a project</h1>
|
||||
<blockquote class="doxtable">
|
||||
<p>How do i actually import this into my existing project? </p>
|
||||
</blockquote>
|
||||
<p>I am working on a proper way to make this a fast-and-easy include. <br />
|
||||
I am probably going to make it a single-header–single-cpp file solution. A namespace will obviously also be used. <br />
|
||||
</p>
|
||||
<p>If you want to use it NOW, the best idea would probably be to either compile a lib from source or set the entire Visual Studio project as a dependency, if you are using VS.</p>
|
||||
<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>
|
||||
@@ -273,23 +270,51 @@ Type safety</h2>
|
||||
<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 create an automatic 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=['peter' 'hannes'] 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">"--force"</span>, <span class="stringliteral">"Just forces it."</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">"This is the testing application for Hazelnupp."</span>);</div>
|
||||
</div><!-- fragment --><p>If you want to display this information somewhere else, you can always access it 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_md11"></a>
|
||||
<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_md12"></a>
|
||||
<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_md13"></a>
|
||||
</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>
|
||||
@@ -301,21 +326,22 @@ LICENSE</h1>
|
||||
<div class="line">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 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#l00003">DataType.h:3</a></div></div>
|
||||
<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_a8b79a79d40420ae748c108c691111040"><div class="ttname"><a href="classHazelnp_1_1Hazelnupp.html#a8b79a79d40420ae748c108c691111040">Hazelnp::Hazelnupp::HasParam</a></div><div class="ttdeci">bool HasParam(const std::string &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#l00153">Hazelnupp.cpp:153</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 &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 &abbrev, const std::string &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#l00332">Hazelnupp.cpp:332</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< ParamConstraint > &constraints)</div><div class="ttdoc">Will register parameter constraints.</div><div class="ttdef"><b>Definition:</b> <a href="Hazelnupp_8cpp_source.html#l00354">Hazelnupp.cpp:354</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 &abbrev, const std::string &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< ParamConstraint > &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 &key, const std::vector< std::string > &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 &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 Thu Jun 3 2021 16:39:51 for Leonetienne/Hazelnupp by  <a href="http://www.doxygen.org/index.html">
|
||||
Generated on Fri Jun 4 2021 02:30:29 for Leonetienne/Hazelnupp by  <a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||
</a> 1.8.17
|
||||
</small></address>
|
||||
|
Reference in New Issue
Block a user