7#include <boost/optional.hpp>
12template<
typename ValueType>
20 virtual bool isValid(ValueType
const& value) = 0;
28template<
typename ValueType>
31 RangeArgumentValidator(boost::optional<ValueType>
const& lower, boost::optional<ValueType>
const& upper,
bool lowerIncluded,
bool upperIncluded);
33 virtual bool isValid(ValueType
const& value)
override;
34 virtual std::string
toString()
const override;
37 boost::optional<ValueType> lower;
38 boost::optional<ValueType> upper;
49 virtual bool isValid(std::string
const& value)
override;
50 virtual std::string
toString()
const override;
60 virtual bool isValid(std::string
const& value)
override;
61 virtual std::string
toString()
const override;
64 std::vector<std::string> legalValues;
90 template<
typename ValueType>
91 static std::shared_ptr<ArgumentValidator<ValueType>> createRangeValidatorExcluding(ValueType lowerBound, ValueType upperBound);
93 template<
typename ValueType>
94 static std::shared_ptr<ArgumentValidator<ValueType>> createRangeValidatorIncluding(ValueType lowerBound, ValueType upperBound);
96 template<
typename ValueType>
97 static std::shared_ptr<ArgumentValidator<ValueType>> createGreaterValidator(ValueType lowerBound,
bool equalAllowed);
static std::shared_ptr< ArgumentValidator< uint64_t > > createUnsignedRangeValidatorIncluding(uint64_t lowerBound, uint64_t upperBound)
static std::shared_ptr< ArgumentValidator< uint64_t > > createUnsignedRangeValidatorExcluding(uint64_t lowerBound, uint64_t upperBound)
static std::shared_ptr< ArgumentValidator< double > > createDoubleRangeValidatorExcluding(double lowerBound, double upperBound)
static std::shared_ptr< ArgumentValidator< double > > createDoubleGreaterValidator(double lowerBound)
static std::shared_ptr< ArgumentValidator< uint64_t > > createUnsignedGreaterValidator(uint64_t lowerBound)
static std::shared_ptr< ArgumentValidator< int64_t > > createIntegerGreaterEqualValidator(int_fast64_t lowerBound)
static std::shared_ptr< ArgumentValidator< int64_t > > createIntegerGreaterValidator(int_fast64_t lowerBound)
static std::shared_ptr< ArgumentValidator< double > > createDoubleGreaterEqualValidator(double lowerBound)
static std::shared_ptr< ArgumentValidator< uint64_t > > createUnsignedGreaterEqualValidator(uint64_t lowerBound)
static std::shared_ptr< ArgumentValidator< std::string > > createMultipleChoiceValidator(std::vector< std::string > const &choices)
static std::shared_ptr< ArgumentValidator< std::string > > createExistingFileValidator()
static std::shared_ptr< ArgumentValidator< int64_t > > createIntegerRangeValidatorExcluding(int_fast64_t lowerBound, int_fast64_t upperBound)
static std::shared_ptr< ArgumentValidator< double > > createDoubleRangeValidatorIncluding(double lowerBound, double upperBound)
static std::shared_ptr< ArgumentValidator< std::string > > createWritableFileValidator()
virtual std::string toString() const =0
Retrieves a string representation of the valid values.
virtual bool isValid(ValueType const &value)=0
Checks whether the argument passes the validation.
virtual ~ArgumentValidator()=default
virtual std::string toString() const override
Retrieves a string representation of the valid values.
virtual bool isValid(std::string const &value) override
Checks whether the argument passes the validation.
virtual bool isValid(std::string const &value) override
Checks whether the argument passes the validation.
virtual std::string toString() const override
Retrieves a string representation of the valid values.
virtual bool isValid(ValueType const &value) override
Checks whether the argument passes the validation.
virtual std::string toString() const override
Retrieves a string representation of the valid values.
SettingsType const & getModule()
Get module.