Renamed constraint modifier method to be more descriptive
This commit is contained in:
parent
e3fe859b9e
commit
c58237b028
@ -78,7 +78,7 @@ namespace Hazelnp
|
|||||||
//! Daisychain-method. Will add a the "incompatiblity" aspect.
|
//! Daisychain-method. Will add a the "incompatiblity" aspect.
|
||||||
//! This means, that the following parameters are NOT compatible with this one and will throw an error if passed together.
|
//! This means, that the following parameters are NOT compatible with this one and will throw an error if passed together.
|
||||||
//! Syntactical-sugar proxy method that will convert the lonely string to an initializer list for you :3
|
//! Syntactical-sugar proxy method that will convert the lonely string to an initializer list for you :3
|
||||||
ParamConstraint AddIncompatibility(const std::string& incompatibleParameters)
|
ParamConstraint AddIncompatibilities(const std::string& incompatibleParameters)
|
||||||
{
|
{
|
||||||
ParamConstraint pc = *this;
|
ParamConstraint pc = *this;
|
||||||
pc.incompatibleParameters = { incompatibleParameters };
|
pc.incompatibleParameters = { incompatibleParameters };
|
||||||
@ -86,6 +86,16 @@ namespace Hazelnp
|
|||||||
return pc;
|
return pc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Daisychain-method. Will add a the "incompatiblity" aspect.
|
||||||
|
//! This means, that the following parameters are NOT compatible with this one and will throw an error if passed together.
|
||||||
|
ParamConstraint AddIncompatibilities(const std::initializer_list<std::string>& incompatibleParameters)
|
||||||
|
{
|
||||||
|
ParamConstraint pc = *this;
|
||||||
|
pc.incompatibleParameters = incompatibleParameters;
|
||||||
|
|
||||||
|
return pc;
|
||||||
|
}
|
||||||
|
|
||||||
//! Whole constructor
|
//! Whole constructor
|
||||||
ParamConstraint(bool constrainType, DATA_TYPE requiredType, const std::initializer_list<std::string>& defaultValue, bool required, const std::initializer_list<std::string>& incompatibleParameters)
|
ParamConstraint(bool constrainType, DATA_TYPE requiredType, const std::initializer_list<std::string>& defaultValue, bool required, const std::initializer_list<std::string>& incompatibleParameters)
|
||||||
:
|
:
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#define HAZELNUPP_VERSION (1.12)
|
#define HAZELNUPP_VERSION (1.121)
|
||||||
|
@ -695,7 +695,7 @@ namespace TestHazelnupp
|
|||||||
"--width",
|
"--width",
|
||||||
ParamConstraint::Require()
|
ParamConstraint::Require()
|
||||||
.AddTypeSafety(DATA_TYPE::FLOAT)
|
.AddTypeSafety(DATA_TYPE::FLOAT)
|
||||||
.AddIncompatibility({ "--antiwidth" })
|
.AddIncompatibilities({ "--antiwidth" })
|
||||||
);
|
);
|
||||||
|
|
||||||
cmdArgsI.Parse(C_Ify(args));
|
cmdArgsI.Parse(C_Ify(args));
|
||||||
@ -725,7 +725,7 @@ namespace TestHazelnupp
|
|||||||
"--width",
|
"--width",
|
||||||
ParamConstraint::TypeSafety(DATA_TYPE::FLOAT)
|
ParamConstraint::TypeSafety(DATA_TYPE::FLOAT)
|
||||||
.AddRequire()
|
.AddRequire()
|
||||||
.AddIncompatibility({ "--antiwidth" })
|
.AddIncompatibilities({ "--antiwidth" })
|
||||||
);
|
);
|
||||||
|
|
||||||
cmdArgsI.Parse(C_Ify(args));
|
cmdArgsI.Parse(C_Ify(args));
|
||||||
@ -784,7 +784,7 @@ namespace TestHazelnupp
|
|||||||
"--width",
|
"--width",
|
||||||
ParamConstraint::Require()
|
ParamConstraint::Require()
|
||||||
.AddTypeSafety(DATA_TYPE::FLOAT)
|
.AddTypeSafety(DATA_TYPE::FLOAT)
|
||||||
.AddIncompatibility({ "--antiwidth" })
|
.AddIncompatibilities({ "--antiwidth" })
|
||||||
);
|
);
|
||||||
|
|
||||||
cmdArgsI.Parse(C_Ify(args));
|
cmdArgsI.Parse(C_Ify(args));
|
||||||
|
@ -283,7 +283,7 @@ args.RegisterConstraint(
|
|||||||
"--width",
|
"--width",
|
||||||
ParamConstraint::Require() // Make this parameter mandatory
|
ParamConstraint::Require() // Make this parameter mandatory
|
||||||
.AddTypeSafety(DATA_TYPE::FLOAT) // Force this param to be a float
|
.AddTypeSafety(DATA_TYPE::FLOAT) // Force this param to be a float
|
||||||
.AddIncompatibility({ "--antiwidth" }) // Make this param incompatible with '--antiwidth'
|
.AddIncompatibilities({ "--antiwidth" }) // Make this param incompatible with '--antiwidth'
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user