23#ifndef TCLAP_RANGE_CONSTRAINT_H
24#define TCLAP_RANGE_CONSTRAINT_H
50 : _min(min), _max(max), _shortId() {
51 std::ostringstream os;
52 os <<
'[' << _min <<
'-' << _max <<
']';
57 std::ostringstream os;
58 os <<
"value must be between " << _min <<
" and " << _max
63 std::string
shortID()
const {
return _shortId; }
65 bool check(
const T &value)
const {
67 return _min <= value && value <= _max;
The interface that defines the interaction between the Arg and Constraint.
A Constraint that requires a value to fall within a closed [min, max] range, for the common "between ...
bool check(const T &value) const
The method used to verify that the value parsed from the command line meets the constraint.
RangeConstraint(const T &min, const T &max)
Constructor.
std::string description() const
Returns a description of the Constraint.
std::string shortID() const
Returns the short ID for the Constraint.