 |
Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
|
DATA_TYPE wantedType
Constrain the parameter to this value. Requires constrainType to be set to true.
bool constrainType
Should this parameter be forced to be of a certain type? Remember to set constrainTo to the wanted ...
ParamConstraint()=default
Empty constructor.
std::string key
The key of the parameter to constrain.
bool required
If set to true, and no default value set, an error will be produced if this parameter is not supplied...
static ParamConstraint Require(const std::string &key, const std::vector< std::string > &defaultValue={}, bool required=true)
Constructs a require constraint.
ParamConstraint(const std::string &key, bool constrainType, DATA_TYPE wantedType, const std::vector< std::string > &defaultValue, bool required)
Whole constructor.
static ParamConstraint TypeSafety(const std::string &key, DATA_TYPE wantedType, bool constrainType=true)
Constructs a type-safety constraint.
DATA_TYPE
The different data types a paramater can be.
std::vector< std::string > defaultValue
The default value for this parameter.