25#ifndef TCLAP_UNLABELED_VALUE_ARG_H
26#define TCLAP_UNLABELED_VALUE_ARG_H
81 bool req, T value,
const std::string &typeDesc,
82 bool ignoreable =
false,
Visitor *v =
nullptr);
108 bool req, T value,
const std::string &typeDesc,
134 bool ignoreable =
false,
Visitor *v =
nullptr);
170 bool processArg(
int *i, std::vector<std::string> &args)
override;
175 [[nodiscard]] std::string
shortID(
const std::string &)
const override {
182 [[nodiscard]] std::string
longID(
const std::string &)
const override {
195 void addToList(std::list<Arg *> &argList)
const override;
197 [[nodiscard]]
bool hasLabel()
const override {
return false; }
205 const std::string &desc,
bool req,
206 T val,
const std::string &typeDesc,
208 :
ValueArg<T>(
"", name, desc, req, val, typeDesc, v) {
215 const std::string &desc,
bool req,
216 T val,
const std::string &typeDesc,
219 :
ValueArg<T>(
"", name, desc, req, val, typeDesc, v) {
229 const std::string &desc,
bool req,
232 :
ValueArg<T>(
"", name, desc, req, val, constraint, v) {
238 const std::string &desc,
bool req,
242 :
ValueArg<T>(
"", name, desc, req, val, constraint, v) {
252 if (_alreadySet)
return false;
254 if (_hasBlanks(args[*i]))
return false;
256 _extractValue(args[*i]);
259 this->_checkWithVisitor();
273 argList.push_back(
const_cast<Arg *
>(
static_cast<const Arg *const
>(
this)));
A virtual base class that defines the essential data for all arguments.
std::string _setBy
Indicates the value specified to set this flag (like -a or –all).
bool _hasBlanks(const std::string &s) const
Checks whether a given string has blank chars, indicating that it is a combined SwitchArg.
bool _alreadySet
Indicates whether the argument has been set.
bool _ignoreable
Whether this argument can be ignored, if desired.
std::string _description
Description of the argument.
std::string getDescription() const
Returns the argument description.
std::string _name
A single word namd identifying the argument.
const std::string & getName() const noexcept
Returns the argument name.
virtual std::string toString() const
Returns a simple string representation of the argument.
The base class that manages the command line definition and passes along the parsing to the appropria...
ArgContainer & add(Arg &a) override=0
Adds an argument.
The interface that defines the interaction between the Arg and Constraint.
The basic unlabeled argument that parses a value.
bool hasLabel() const override
UnlabeledValueArg(const std::string &name, const std::string &desc, bool req, T value, const std::string &typeDesc, bool ignoreable=false, Visitor *v=nullptr)
UnlabeledValueArg constructor.
bool operator==(const Arg &a) const override
Overrides operator== for specific behavior.
bool processArg(int *i, std::vector< std::string > &args) override
Handles the processing of the argument.
void addToList(std::list< Arg * > &argList) const override
Instead of pushing to the front of list, push to the back.
std::string shortID(const std::string &) const override
Overrides shortID for specific behavior.
std::string longID(const std::string &) const override
Overrides longID for specific behavior.
The basic labeled argument that parses a value.
std::string _typeDesc
A human readable description of the type to be parsed.
void _extractValue(const std::string &val)
Extracts the value from the string.
A base class that defines the interface for visitors.