2021-06-03 12:22:37 +02:00
<!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& 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& 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" >
2021-06-03 13:43:05 +02:00
< div class = "title" > Hazelnupp < / div > < / div >
2021-06-03 12:22:37 +02:00
< / div > <!-- header -->
< div class = "contents" >
< div class = "textblock" > < p > is a simple, easy to use command line parameter parser. < br / >
2021-06-03 13:43:05 +02:00
Hazelnupp does not support windows-, or bsd-style arguments. Only linux-style. < br / >
2021-06-03 12:22:37 +02:00
< / p >
< p > What is the linux-style? This: < / p > < div class = "fragment" > < div class = "line" > # Using a long parameter< / div >
2021-06-04 13:53:59 +02:00
< div class = "line" > $ a.out --long-parameter 1234< / div >
< div class = "line" > < / div >
< div class = "line" > # Using an abbreviated parameter< / div >
< div class = "line" > $ a.out -lp 1234< / div >
2021-06-03 12:22:37 +02:00
< / 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 / >
2021-06-08 14:02:49 +02:00
To enable exceptions, call this method: < / p > < div class = "fragment" > < div class = "line" > CmdArgsInterface args;< / div >
2021-06-03 13:43:05 +02:00
< div class = "line" > args.SetCrashOnFail(< span class = "keyword" > false< / span > );< / div >
2021-06-03 12:22:37 +02:00
< / div > <!-- fragment --> < h1 > < a class = "anchor" id = "autotoc_md2" > < / a >
2021-06-04 15:57:52 +02:00
Index< / h1 >
< ol type = "1" >
< li > < a href = "#importing-into-a-project" > Importing into a project< / a > < / li >
< li > < a href = "#whats-the-concept" > What's the concept?< / a > < / li >
< li > < a href = "#minimal-working-example" > Minimal working example< / a > < / li >
< li > < a href = "#abbreviations" > Abbreviations< / a > < / li >
< li > < a href = "#constraints" > Constraints< / a > < / li >
< li > < a href = "#automatic-parameter-documentation" > Automatic parameter documentation< / a > < / li >
2021-06-06 15:32:19 +02:00
< li > < a href = "#descriptive-error-messages" > Descriptive error messages< / a > < / li >
2021-06-04 15:57:52 +02:00
< li > < a href = "#more-examples" > More examples?< / a > < / li >
< li > < a href = "#what-is-not-supported" > What is not supported?< / a > < / li >
< li > < a href = "#further-notes" > Further notes< / a > < / li >
< li > < a href = "#contributing" > Contributing< / a > < / li >
< li > < a href = "#license" > LICENSE< / a > < / li >
< / ol >
< p > < span id = "importing-into-a-project" > < / span > < / p >
< h1 > < a class = "anchor" id = "autotoc_md3" > < / a >
2021-06-03 12:22:37 +02:00
Importing into a project< / h1 >
< blockquote class = "doxtable" >
< p > How do i actually import this into my existing project? < / p >
< / blockquote >
2021-06-04 02:30:58 +02:00
< 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 >
2021-06-04 15:57:52 +02:00
< p > < span id = "whats-the-concept" > < / span > < / p >
< h1 > < a class = "anchor" id = "autotoc_md4" > < / a >
2021-06-03 12:22:37 +02:00
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 >
2021-06-04 13:53:59 +02:00
< div class = "line" > $ a.out --foo< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > # Int< / div >
2021-06-04 13:53:59 +02:00
< div class = "line" > $ a.out --foo 5< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > # Float< / div >
2021-06-04 13:53:59 +02:00
< div class = "line" > $ a.out --foo 5.5< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > # String< / div >
2021-06-04 13:53:59 +02:00
< div class = "line" > $ a.out --foo peter< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
2021-06-05 12:40:24 +02:00
< div class = "line" > # List (any type above works, except void)< / div >
2021-06-04 13:53:59 +02:00
< div class = "line" > $ a.out --foo peter jake jeff billy< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > # List, mixed types< / div >
2021-06-04 13:53:59 +02:00
< div class = "line" > $ a.out --foo 1 2 3 4 peter willy billy bob 3< / div >
2021-06-03 12:22:37 +02:00
< / div > <!-- fragment --> < p > These parameters can then be accessed via a simple lookup!< / p >
2021-06-04 15:57:52 +02:00
< p > < span id = "minimal-working-example" > < / span > < / p >
< h1 > < a class = "anchor" id = "autotoc_md5" > < / a >
2021-06-03 12:22:37 +02:00
Minimal working example< / h1 >
2021-06-08 14:02:49 +02:00
< 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 " Hazelnupp.h" < / span > < / div >
2021-06-03 16:40:02 +02:00
< div class = "line" > < span class = "keyword" > using namespace < / span > < a class = "code" href = "namespaceHazelnp.html" > Hazelnp< / a > ;< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
2021-06-06 15:32:19 +02:00
< div class = "line" > < span class = "keywordtype" > int< / span > main(< span class = "keywordtype" > int< / span > argc, < span class = "keywordtype" > char< / span > ** argv)< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > {< / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > < a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html" > CmdArgsInterface< / a > args(argc, argv);< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
2021-06-03 13:43:05 +02:00
< div class = "line" > < span class = "keywordflow" > if< / span > (args.HasParam(< span class = "stringliteral" > " --force" < / span > ))< / div >
2021-06-03 12:22:37 +02:00
< 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 >
2021-06-08 14:02:49 +02:00
< / div > <!-- fragment --> < p > Looks super easy! But what about actual values? < / p > < div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #include " Hazelnupp.h" < / span > < / div >
2021-06-03 16:40:02 +02:00
< div class = "line" > < span class = "keyword" > using namespace < / span > < a class = "code" href = "namespaceHazelnp.html" > Hazelnp< / a > ;< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
2021-06-06 15:32:19 +02:00
< div class = "line" > < span class = "keywordtype" > int< / span > main(< span class = "keywordtype" > int< / span > argc, < span class = "keywordtype" > char< / span > ** argv)< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > {< / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > < a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html" > CmdArgsInterface< / a > args(argc, argv);< / div >
2021-06-03 12:22:37 +02:00
< 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" > " --my-int" < / span > ].GetInt32();< / div >
2021-06-03 16:40:02 +02:00
< div class = "line" > < span class = "keywordtype" > double< / span > myFlt = args[< span class = "stringliteral" > " --my-float" < / span > ].GetFloat32();< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > std::string myStr = args[< span class = "stringliteral" > " --my-string" < / span > ].GetString();< / div >
< div class = "line" > }< / div >
2021-06-03 16:40:02 +02:00
< div class = "line" > < span class = "keywordflow" > catch< / span > (< a class = "code" href = "classHazelnp_1_1HazelnuppInvalidKeyException.html" > HazelnuppInvalidKeyException< / a > & )< / div >
2021-06-03 12:22:37 +02:00
< 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 >
2021-06-08 14:02:49 +02:00
< / div > <!-- fragment --> < p > What about lists? < / p > < div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #include " Hazelnupp.h" < / span > < / div >
2021-06-03 16:40:02 +02:00
< div class = "line" > < span class = "keyword" > using namespace < / span > < a class = "code" href = "namespaceHazelnp.html" > Hazelnp< / a > ;< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
2021-06-06 15:32:19 +02:00
< div class = "line" > < span class = "keywordtype" > int< / span > main(< span class = "keywordtype" > int< / span > argc, < span class = "keywordtype" > char< / span > ** argv)< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > {< / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > < a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html" > CmdArgsInterface< / a > args(argc, argv);< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > < span class = "keyword" > const< / span > < span class = "keyword" > auto< / span > & myList = args[< span class = "stringliteral" > " --my-list" < / span > ].GetList(); < span class = "comment" > // std::vector< Value*> < / 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-> GetDataType()< / span > < / div >
< div class = "line" > std::cout < < it-> GetString() < < 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 >
2021-06-04 15:57:52 +02:00
< / div > <!-- fragment --> < p > < span id = "abbreviations" > < / span > < / p >
< h1 > < a class = "anchor" id = "autotoc_md6" > < / a >
2021-06-03 12:22:37 +02:00
Abbreviations< / h1 >
2021-06-08 14:02:49 +02:00
< 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 " Hazelnupp.h" < / span > < / div >
2021-06-03 16:40:02 +02:00
< div class = "line" > < span class = "keyword" > using namespace < / span > < a class = "code" href = "namespaceHazelnp.html" > Hazelnp< / a > ;< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
2021-06-06 15:32:19 +02:00
< div class = "line" > < span class = "keywordtype" > int< / span > main(< span class = "keywordtype" > int< / span > argc, < span class = "keywordtype" > char< / span > ** argv)< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > {< / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > < a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html" > CmdArgsInterface< / a > args;< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > < span class = "comment" > // Register abbreviations< / span > < / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#aaccf591a74408aeb4363033fe8cb2224" > RegisterAbbreviation< / a > (< span class = "stringliteral" > " -f" < / span > , < span class = "stringliteral" > " --force" < / span > );< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > < span class = "comment" > // Parse< / span > < / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#a1f4845041e08b3335510de44fafaee19" > Parse< / a > (argc, argv);< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > < span class = "keywordflow" > if< / span > (args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#a3a7fa36fe69ee8bf3b400983a21ecd24" > HasParam< / a > (< span class = "stringliteral" > " --force" < / span > )) < span class = "comment" > // This key will be present, even if the user passed ' -f' < / span > < / div >
2021-06-03 12:22:37 +02:00
< 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 >
2021-06-04 15:57:52 +02:00
< / div > <!-- fragment --> < p > < span id = "constraints" > < / span > < / p >
< h1 > < a class = "anchor" id = "autotoc_md7" > < / a >
2021-06-03 12:22:37 +02:00
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 >
2021-09-05 12:12:03 +02:00
< p > For exactly this reason, there are constraints. With this, you can control what your data looks like! Constraints serve three main purposes:< / p >
2021-06-04 15:57:52 +02:00
< h2 > < a class = "anchor" id = "autotoc_md8" > < / a >
2021-06-03 12:22:37 +02:00
Requiring data< / h2 >
2021-06-03 13:43:05 +02:00
< p > With < code > ParamConstraint::Require()< / code > you can declare that a paramater must either always be present, or provide a default value. < br / >
2021-06-03 12:22:37 +02:00
< / p > < ul >
< li > If a parameter is not present, but has a default value, it will be automatically created.< / li >
2021-09-05 12:12:03 +02:00
< li > If a parameter is not present, and has no default value, the process will terminate with a descriptive error message.< / li >
2021-06-03 12:22:37 +02:00
< / ul >
2021-06-08 14:02:49 +02:00
< p > Minimal working example: < / p > < div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #include " Hazelnupp.h" < / span > < / div >
2021-06-03 16:40:02 +02:00
< div class = "line" > < span class = "keyword" > using namespace < / span > < a class = "code" href = "namespaceHazelnp.html" > Hazelnp< / a > ;< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
2021-06-06 15:32:19 +02:00
< div class = "line" > < span class = "keywordtype" > int< / span > main(< span class = "keywordtype" > int< / span > argc, < span class = "keywordtype" > char< / span > ** argv)< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > {< / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > < a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html" > CmdArgsInterface< / a > args;< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > < span class = "comment" > // Register constraints< / span > < / div >
2021-09-05 12:12:03 +02:00
< div class = "line" > args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#aa30222df012f357455f90e3620346bb2" > RegisterConstraint< / a > (< span class = "stringliteral" > " --this-is-required" < / span > , < a class = "code" href = "structHazelnp_1_1ParamConstraint.html#a8a7e5d7ddffc3cfbb54ac6823dd7eded" > ParamConstraint::Require< / a > ()); < span class = "comment" > // This missing throws an exception< / span > < / div >
< div class = "line" > args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#aa30222df012f357455f90e3620346bb2" > RegisterConstraint< / a > (< span class = "stringliteral" > " --also-required-but-defaulted" < / span > , < a class = "code" href = "structHazelnp_1_1ParamConstraint.html#a8a7e5d7ddffc3cfbb54ac6823dd7eded" > ParamConstraint::Require< / a > ({< span class = "stringliteral" > " 122" < / span > })); < span class = "comment" > // This will default to 122< / span > < / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > < span class = "comment" > // Parse< / span > < / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#a1f4845041e08b3335510de44fafaee19" > Parse< / a > (argc, argv);< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > < span class = "keywordflow" > return< / span > 0;< / div >
< div class = "line" > }< / div >
2021-06-04 15:57:52 +02:00
< / div > <!-- fragment --> < h2 > < a class = "anchor" id = "autotoc_md9" > < / a >
2021-06-03 12:22:37 +02:00
Type safety< / h2 >
< p > With type safety you can always be certain that you are working with the correct type! < br / >
2021-09-05 12:12:03 +02:00
By creating a type-constraint, you force Hazelnupp to use a certain type. < br / >
2021-06-03 12:22:37 +02:00
If a supplied type does not match, but is convertible, it will be converted. < br / >
2021-09-05 12:12:03 +02:00
If it is not convertible, the process will terminate with a descriptive error message.< / p >
2021-06-03 12:22:37 +02:00
< p > These conversions are:< / p > < ul >
< li > int -> [float, string, list, void]< / li >
< li > float -> [int, string, list, void]< / li >
< li > string -> [list, void]< / li >
< li > list -> [void]< / li >
2021-06-05 12:40:24 +02:00
< li > void -> [list, string]< / li >
2021-06-03 12:22:37 +02:00
< / ul >
< p > The conversions < code > *-> list< / code > just create a list with a single entry (except for < code > void-> list< / code > which produces an empty list). < br / >
2021-06-05 12:40:24 +02:00
The < code > *-> void< / code > conversions just drop their value. < br / >
< code > void-> string< / code > just produces an empty string.< / p >
2021-06-08 14:02:49 +02:00
< p > Minimal working example: < / p > < div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #include " Hazelnupp.h" < / span > < / div >
2021-06-03 16:40:02 +02:00
< div class = "line" > < span class = "keyword" > using namespace < / span > < a class = "code" href = "namespaceHazelnp.html" > Hazelnp< / a > ;< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
2021-06-06 15:32:19 +02:00
< div class = "line" > < span class = "keywordtype" > int< / span > main(< span class = "keywordtype" > int< / span > argc, < span class = "keywordtype" > char< / span > ** argv)< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > {< / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > < a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html" > CmdArgsInterface< / a > args;< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > < span class = "comment" > // Register constraints< / span > < / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#aa30222df012f357455f90e3620346bb2" > RegisterConstraint< / a > (< span class = "stringliteral" > " --this-must-be-int" < / span > , < a class = "code" href = "structHazelnp_1_1ParamConstraint.html#a7df61dbc8dbaff4bc596fdf2c0532d5b" > ParamConstraint::TypeSafety< / a > (< a class = "code" href = "namespaceHazelnp.html#a07b61ac22ce9cd97eceebdf9487f803fa53f93baa3057821107c750323892fa92" > DATA_TYPE::INT< / a > ));< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > < span class = "comment" > // Parse< / span > < / div >
2021-06-08 14:02:49 +02:00
< div class = "line" > args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#a1f4845041e08b3335510de44fafaee19" > Parse< / a > (argc, argv);< / div >
2021-06-03 12:22:37 +02:00
< 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 >
2021-09-05 12:12:03 +02:00
< h2 > < a class = "anchor" id = "autotoc_md10" > < / a >
Parameter incompatibilities< / h2 >
< p > With parameter incompatibilities you can declare that certain parameters are just incompatible. < br / >
If they get passed together, the process will terminate with a descriptive error message.< / p >
< p > Minimal working example: < / p > < div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #include " Hazelnupp.h" < / 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 > main(< 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_1CmdArgsInterface.html" > CmdArgsInterface< / a > args;< / div >
< div class = "line" > < / div >
< div class = "line" > < span class = "comment" > // Register constraints< / span > < / div >
< div class = "line" > < / div >
< div class = "line" > < span class = "comment" > // Register a single incompatibility< / span > < / div >
< div class = "line" > args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#aa30222df012f357455f90e3620346bb2" > RegisterConstraint< / a > (< span class = "stringliteral" > " --be-vegan" < / span > , < a class = "code" href = "structHazelnp_1_1ParamConstraint.html#a20fa41460106b5327a51114f8a187871" > ParamConstraint::Incompatibility< / a > (< span class = "stringliteral" > " --be-carnivore" < / span > ));< / div >
< div class = "line" > < / div >
< div class = "line" > < span class = "comment" > // OR register a whole bunch of incompatibilities< / span > < / div >
< div class = "line" > args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#aa30222df012f357455f90e3620346bb2" > RegisterConstraint< / a > (< span class = "stringliteral" > " --be-vegan" < / span > , < a class = "code" href = "structHazelnp_1_1ParamConstraint.html#a20fa41460106b5327a51114f8a187871" > ParamConstraint::Incompatibility< / a > ({< / div >
< div class = "line" > < span class = "stringliteral" > " --be-carnivore" < / span > ,< / div >
< div class = "line" > < span class = "stringliteral" > " --like-meat" < / span > ,< / div >
< div class = "line" > < span class = "stringliteral" > " --buy-meat" < / span > ,< / div >
< div class = "line" > < span class = "stringliteral" > " --grill-meat" < / span > ,< / div >
< div class = "line" > < span class = "stringliteral" > " --eat-meat" < / span > < / div >
< div class = "line" > }));< / 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_1CmdArgsInterface.html#a1f4845041e08b3335510de44fafaee19" > 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 --> < hr / >
2021-09-05 12:57:10 +02:00
< p > Keep in mind that you can only register ONE constraint for each parameter! Adding another one will just overwrite the prior one. However, one constraint can do all three "types" at once if you daisychain them: < / p > < div class = "fragment" > < div class = "line" > args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#aa30222df012f357455f90e3620346bb2" > RegisterConstraint< / a > (< / div >
< div class = "line" > < span class = "stringliteral" > " --width" < / span > ,< / div >
< div class = "line" > ParamConstraint::Require() < span class = "comment" > // Make this parameter mandatory< / span > < / div >
< div class = "line" > .AddTypeSafety(DATA_TYPE::FLOAT) < span class = "comment" > // Force this param to be a float< / span > < / div >
2021-09-05 13:00:28 +02:00
< div class = "line" > .AddIncompatibilities({ < span class = "stringliteral" > " --antiwidth" < / span > }) < span class = "comment" > // Make this param incompatible with ' --antiwidth' < / span > < / div >
2021-09-05 12:57:10 +02:00
< div class = "line" > );< / div >
< / div > <!-- fragment --> < p > < span id = "automatic-parameter-documentation" > < / span > < / p >
2021-09-05 12:12:03 +02:00
< h1 > < a class = "anchor" id = "autotoc_md12" > < / a >
2021-06-04 02:30:58 +02:00
Automatic parameter documentation< / h1 >
2021-06-04 02:44:09 +02:00
< p > Hazelnupp does automatically create a parameter documentation, accessible via < code > --help< / code > . < br / >
2021-06-08 14:02:49 +02:00
If you want to use < code > --help< / code > yourself, just turn it off. < / p > < div class = "fragment" > < div class = "line" > CmdArgsInterface args;< / div >
< div class = "line" > args.< a class = "code" href = "classHazelnp_1_1CmdArgsInterface.html#abf553ed4acabf9e1db357715bc10533c" > SetCatchHelp< / a > (< span class = "keyword" > false< / span > );< / div >
2021-06-04 02:30:58 +02:00
< / 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 >
2021-06-04 13:53:59 +02:00
< div class = "line" > --names LIST default=[' peter' ' hannes' ] The names to target< / div >
2021-06-04 02:30:58 +02:00
< 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 / >
2021-06-08 14:02:49 +02:00
You have to set the brief descriptions yourself though. < / p > < div class = "fragment" > < div class = "line" > CmdArgsInterface args;< / div >
2021-06-04 02:30:58 +02:00
< div class = "line" > args.RegisterDescription(< span class = "stringliteral" > " --force" < / span > , < span class = "stringliteral" > " Just forces it." < / span > );< / div >
2021-06-08 14:02:49 +02:00
< / 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" > CmdArgsInterface args;< / div >
2021-06-04 02:30:58 +02:00
< div class = "line" > args.SetBriefDescription(< span class = "stringliteral" > " This is the testing application for Hazelnupp." < / span > );< / div >
2021-06-04 02:44:09 +02:00
< / 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 >
2021-06-06 15:32:19 +02:00
< p > < span id = "descriptive-error-messages" > < / span > < / p >
2021-09-05 12:12:03 +02:00
< h1 > < a class = "anchor" id = "autotoc_md13" > < / a >
2021-06-06 15:32:19 +02:00
Descriptive error messages< / h1 >
< p > Given that you did not disable crash-on-error, Hazelnupps default behaviour on user error is to terminate the process with a descriptive error message to stderr.< / p >
< p > Here's how they look like:< / p >
< p > Type mismatch: < / p > < div class = "fragment" > < div class = "line" > $ a.out --width " about 3 meters" < / div >
< div class = "line" > < < --help page gets printed here aswell > > < / div >
< div class = "line" > < / div >
< div class = "line" > Parameter error: Cannot convert parameter --width to type FLOAT. You supplied type: VOID.< / div >
< div class = "line" > --width => The width of something...< / div >
< / div > <!-- fragment --> < p > Missing required parameter: < / p > < div class = "fragment" > < div class = "line" > $ a.out" < / div >
< div class = "line" > < < --help page gets printed here aswell > > < / div >
< div class = "line" > < / div >
< div class = "line" > Parameter error: Missing required parameter --width.< / div >
< div class = "line" > --width => The width of something...< / div >
< / div > <!-- fragment --> < p > This assumes that you've set a description for, in this example, < code > --width< / code > . If a description is not set, the last line will simply be omitted.< / p >
< p > < span id = "more-examples" > < / span > < / p >
2021-09-05 12:12:03 +02:00
< h1 > < a class = "anchor" id = "autotoc_md14" > < / a >
2021-06-03 12:22:37 +02:00
More examples?< / h1 >
2021-06-04 13:53:59 +02:00
< p > Check out the < a href = "https://github.com/Leonetienne/Hazelnupp/tree/master/Test_Hazelnupp" > tests< / a > ! They may help you out! < br / >
2021-06-03 13:43:05 +02:00
Also make sure to check out the < a href = "https://leonetienne.github.io/Hazelnupp/" > doxygen docs< / a > !< / p >
2021-06-04 15:57:52 +02:00
< p > < span id = "what-is-not-supported" > < / span > < / p >
2021-09-05 12:12:03 +02:00
< h1 > < a class = "anchor" id = "autotoc_md15" > < / a >
2021-06-03 12:22:37 +02:00
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 >
2021-06-04 13:53:59 +02:00
< 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 --> < p > Using parameters multiple times < / p > < div class = "fragment" > < div class = "line" > # This is not supported.< / div >
< div class = "line" > # Let' s say -i is short for --input< / div >
< div class = "line" > $ a.out -i hello.txt -i shoe.txt -i somsang.txt< / div >
2021-06-03 12:22:37 +02:00
< div class = "line" > < / div >
< div class = "line" > # Instead do this< / div >
2021-06-04 13:53:59 +02:00
< div class = "line" > $ a.out -i hello.txt shoe.txt somsang.txt< / div >
2021-06-04 15:57:52 +02:00
< / div > <!-- fragment --> < p > < span id = "further-notes" > < / span > < / p >
2021-09-05 12:12:03 +02:00
< h1 > < a class = "anchor" id = "autotoc_md16" > < / a >
2021-06-04 13:53:59 +02:00
Further notes< / h1 >
< p > This is still in alpha! There is no guarantee at all that this actually works. < br / >
2021-06-06 15:32:19 +02:00
Whilst i did my best to make sure it does, i bet there are still a few flaws i've overlooked. < br / >
2021-06-04 13:53:59 +02:00
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, but i'm not sure when. < br / >
Feel free to submit a PR if you think you improved it in any way :)< / p >
2021-06-04 15:57:52 +02:00
< p > < span id = "#contributing" > < / span > < / p >
2021-09-05 12:12:03 +02:00
< h1 > < a class = "anchor" id = "autotoc_md17" > < / a >
2021-06-04 13:53:59 +02:00
Contributing< / h1 >
< p > If you want to contribute, feel free to fork the repository, and submit a pull request. < br / >
2021-06-06 15:32:19 +02:00
Bugfixes and tests are almost certain to be accepted, features should be agreed upon and come with tests. < br / >
2021-06-04 15:57:52 +02:00
Just create an issue with the tag < code > feature request< / code > . Don't forget to update the UML (< code > Hazelnupp.vpp< / code > )! The (free) modelling software used is < a href = "https://www.visual-paradigm.com" > Visual Paradigm< / a > . < br / >
2021-06-04 13:53:59 +02:00
< / p >
< p > Any code added must match the existing style!< / p > < ul >
< li > Objects begin with a lowercase initial< / li >
< li > Classifiers and Functions/Methods begin with an uppercase initial< / li >
< li > Classifiers are camel-case< / li >
< li > Classifiers get documented via < code > /** */< / code > for doxygen. See existing classifiers< / li >
2021-06-06 15:32:19 +02:00
< li > Members (methods and objects) get documented via < code > //!< / code > for doxygen. See existing definitions< / li >
2021-06-04 13:53:59 +02:00
< li > < code > {< / code > always gets a new line< / li >
< li > Enumerations (and their values) and macros are all-upper case snake-case< / li >
< li > No < code > using namespace std< / code > < / li >
< li > Do < code > using namespace < a class = "el" href = "namespaceHazelnp.html" > Hazelnp< / a > < / code > in cpp files. Don't do < code > < a class = "el" href = "namespaceHazelnp.html" > Hazelnp< / a > ::< / code > if possible< / li >
< li > Files outside the project (like STL) have to be included with < code > #include < > < / code > . Not < code > ""< / code > < / li >
< / ul >
2021-06-04 15:57:52 +02:00
< p > < span id = "license" > < / span > < / p >
2021-09-05 12:12:03 +02:00
< h1 > < a class = "anchor" id = "autotoc_md18" > < / a >
2021-06-03 12:22:37 +02:00
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 " 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 -->
2021-09-05 12:12:03 +02:00
< div class = "ttc" id = "anamespaceHazelnp_html" > < div class = "ttname" > < a href = "namespaceHazelnp.html" > Hazelnp< / a > < / div > < div class = "ttdef" > < b > Definition:< / b > < a href = "CmdArgsInterface_8h_source.html#l00009" > CmdArgsInterface.h:9< / a > < / div > < / div >
< div class = "ttc" id = "astructHazelnp_1_1ParamConstraint_html_a8a7e5d7ddffc3cfbb54ac6823dd7eded" > < div class = "ttname" > < a href = "structHazelnp_1_1ParamConstraint.html#a8a7e5d7ddffc3cfbb54ac6823dd7eded" > Hazelnp::ParamConstraint::Require< / a > < / div > < div class = "ttdeci" > static ParamConstraint Require(const std::initializer_list< 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 = "aclassHazelnp_1_1CmdArgsInterface_html" > < div class = "ttname" > < a href = "classHazelnp_1_1CmdArgsInterface.html" > Hazelnp::CmdArgsInterface< / a > < / div > < div class = "ttdoc" > The main class to interface with.< / div > < div class = "ttdef" > < b > Definition:< / b > < a href = "CmdArgsInterface_8h_source.html#l00013" > CmdArgsInterface.h:13< / a > < / div > < / div >
2021-09-05 12:57:10 +02:00
< div class = "ttc" id = "astructHazelnp_1_1ParamConstraint_html_a20fa41460106b5327a51114f8a187871" > < div class = "ttname" > < a href = "structHazelnp_1_1ParamConstraint.html#a20fa41460106b5327a51114f8a187871" > Hazelnp::ParamConstraint::Incompatibility< / a > < / div > < div class = "ttdeci" > static ParamConstraint Incompatibility(const std::initializer_list< std::string > & incompatibleParameters)< / div > < div class = "ttdoc" > Constructs an incompatibility constraint.< / div > < div class = "ttdef" > < b > Definition:< / b > < a href = "ParamConstraint_8h_source.html#l00059" > ParamConstraint.h:59< / a > < / div > < / div >
2021-09-05 12:12:03 +02:00
< div class = "ttc" id = "aclassHazelnp_1_1CmdArgsInterface_html_abf553ed4acabf9e1db357715bc10533c" > < div class = "ttname" > < a href = "classHazelnp_1_1CmdArgsInterface.html#abf553ed4acabf9e1db357715bc10533c" > Hazelnp::CmdArgsInterface::SetCatchHelp< / a > < / div > < div class = "ttdeci" > void SetCatchHelp(bool catchHelp)< / div > < div class = "ttdoc" > Sets whether the CmdArgsInterface should automatically catch the – help parameter, print the parameter...< / div > < div class = "ttdef" > < b > Definition:< / b > < a href = "CmdArgsInterface_8cpp_source.html#l00368" > CmdArgsInterface.cpp:368< / a > < / div > < / div >
2021-06-06 15:32:19 +02:00
< 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#l00029" > HazelnuppException.h:29< / a > < / div > < / div >
2021-09-05 12:24:50 +02:00
< div class = "ttc" id = "aclassHazelnp_1_1CmdArgsInterface_html_aa30222df012f357455f90e3620346bb2" > < div class = "ttname" > < a href = "classHazelnp_1_1CmdArgsInterface.html#aa30222df012f357455f90e3620346bb2" > Hazelnp::CmdArgsInterface::RegisterConstraint< / a > < / div > < div class = "ttdeci" > void RegisterConstraint(const std::string & key, const ParamConstraint & constraint)< / div > < div class = "ttdoc" > Will register a constraint for a parameter.< / div > < div class = "ttdef" > < b > Definition:< / b > < a href = "CmdArgsInterface_8cpp_source.html#l00663" > CmdArgsInterface.cpp:663< / a > < / div > < / div >
< div class = "ttc" id = "aclassHazelnp_1_1CmdArgsInterface_html_aaccf591a74408aeb4363033fe8cb2224" > < div class = "ttname" > < a href = "classHazelnp_1_1CmdArgsInterface.html#aaccf591a74408aeb4363033fe8cb2224" > Hazelnp::CmdArgsInterface::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 = "CmdArgsInterface_8cpp_source.html#l00632" > CmdArgsInterface.cpp:632< / a > < / div > < / div >
2021-09-05 12:12:03 +02:00
< div class = "ttc" id = "aclassHazelnp_1_1CmdArgsInterface_html_a3a7fa36fe69ee8bf3b400983a21ecd24" > < div class = "ttname" > < a href = "classHazelnp_1_1CmdArgsInterface.html#a3a7fa36fe69ee8bf3b400983a21ecd24" > Hazelnp::CmdArgsInterface::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 = "CmdArgsInterface_8cpp_source.html#l00199" > CmdArgsInterface.cpp:199< / a > < / div > < / div >
2021-06-08 14:02:49 +02:00
< div class = "ttc" id = "aclassHazelnp_1_1CmdArgsInterface_html_a1f4845041e08b3335510de44fafaee19" > < div class = "ttname" > < a href = "classHazelnp_1_1CmdArgsInterface.html#a1f4845041e08b3335510de44fafaee19" > Hazelnp::CmdArgsInterface::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 = "CmdArgsInterface_8cpp_source.html#l00036" > CmdArgsInterface.cpp:36< / a > < / div > < / div >
2021-09-05 12:57:10 +02:00
< div class = "ttc" id = "astructHazelnp_1_1ParamConstraint_html_a7df61dbc8dbaff4bc596fdf2c0532d5b" > < div class = "ttname" > < a href = "structHazelnp_1_1ParamConstraint.html#a7df61dbc8dbaff4bc596fdf2c0532d5b" > Hazelnp::ParamConstraint::TypeSafety< / a > < / div > < div class = "ttdeci" > static ParamConstraint TypeSafety(DATA_TYPE requiredType, 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#l00037" > ParamConstraint.h:37< / a > < / div > < / div >
2021-06-03 16:40:02 +02:00
< 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 >
2021-06-03 12:22:37 +02:00
<!-- start footer part -->
< hr class = "footer" / > < address class = "footer" > < small >
2021-09-05 13:00:28 +02:00
Generated on Sun Sep 5 2021 13:00:17 for Leonetienne/Hazelnupp by   < a href = "http://www.doxygen.org/index.html" >
2021-06-03 12:22:37 +02:00
< img class = "footer" src = "doxygen.png" alt = "doxygen" / >
< / a > 1.8.17
< / small > < / address >
< / body >
< / html >