![]() |
Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
|
#include <ParamConstraint.h>

Public Member Functions | |
| ParamConstraint ()=default | |
| Empty constructor. More... | |
| ParamConstraint (const std::string &key, bool constrainType, DATA_TYPE wantedType, const std::vector< std::string > &defaultValue, bool required) | |
| Whole constructor. More... | |
Static Public Member Functions | |
| static ParamConstraint | Require (const std::string &key, const std::vector< std::string > &defaultValue={}, bool required=true) |
| Constructs a require constraint. More... | |
| static ParamConstraint | TypeSafety (const std::string &key, DATA_TYPE wantedType, bool constrainType=true) |
| Constructs a type-safety constraint. More... | |
Public Attributes | |
| std::string | key |
| The key of the parameter to constrain. More... | |
| bool | constrainType = false |
| Should this parameter be forced to be of a certain type? Remember to set constrainTo to the wanted type. More... | |
| DATA_TYPE | wantedType = DATA_TYPE::VOID |
Constrain the parameter to this value. Requires constrainType to be set to true. More... | |
| std::vector< std::string > | defaultValue |
| The default value for this parameter. More... | |
| bool | required = false |
| If set to true, and no default value set, an error will be produced if this parameter is not supplied by the user. More... | |
Definition at line 6 of file ParamConstraint.h.
|
default |
Empty constructor.
|
inline |
|
inlinestatic |
Constructs a require constraint.
Think of the default value like of a list ofparameters. Like {"--width", "800"}
Definition at line 14 of file ParamConstraint.h.
|
inlinestatic |
| bool ParamConstraint::constrainType = false |
Should this parameter be forced to be of a certain type?
Remember to set constrainTo to the wanted type.
Definition at line 52 of file ParamConstraint.h.
| std::vector<std::string> ParamConstraint::defaultValue |
The default value for this parameter.
Gets applied if this parameter was not given.
Think of this like a list of parameters. Like {"--width", "800"}
Definition at line 60 of file ParamConstraint.h.
| std::string ParamConstraint::key |
The key of the parameter to constrain.
Definition at line 48 of file ParamConstraint.h.
| bool ParamConstraint::required = false |
If set to true, and no default value set, an error will be produced if this parameter is not supplied by the user.
Definition at line 64 of file ParamConstraint.h.
| DATA_TYPE ParamConstraint::wantedType = DATA_TYPE::VOID |
Constrain the parameter to this value. Requires constrainType to be set to true.
Definition at line 55 of file ParamConstraint.h.
1.8.17