24#ifndef TCLAP_UNLABELED_MULTI_ARG_H
25#define TCLAP_UNLABELED_MULTI_ARG_H
74 bool req,
const std::string &typeDesc,
75 bool ignoreable =
false,
Visitor *v =
nullptr);
95 bool req,
const std::string &typeDesc,
116 bool ignoreable =
false,
Visitor *v =
nullptr);
147 bool processArg(
int *i, std::vector<std::string> &args)
override;
152 [[nodiscard]] std::string
shortID(
const std::string &)
const override {
160 [[nodiscard]] std::string
longID(
const std::string &)
const override {
175 void addToList(std::list<Arg *> &argList)
const override;
177 [[nodiscard]]
bool hasLabel()
const override {
return false; }
182 const std::string &desc,
bool req,
183 const std::string &typeDesc,
185 :
MultiArg<T>(
"", name, desc, req, typeDesc, v) {
191 const std::string &desc,
bool req,
192 const std::string &typeDesc,
195 :
MultiArg<T>(
"", name, desc, req, typeDesc, v) {
202 const std::string &desc,
bool req,
205 :
MultiArg<T>(
"", name, desc, req, constraint, v) {
211 const std::string &desc,
bool req,
215 :
MultiArg<T>(
"", name, desc, req, constraint, v) {
222 if (_hasBlanks(args[*i]))
return false;
225 _extractValue(args[(*i)]);
229 this->_checkWithVisitor();
240 argList.push_back(
const_cast<Arg *
>(
static_cast<const Arg *const
>(
this)));
Interface that allows adding an Arg to a "container".
virtual ArgContainer & add(Arg &a)=0
Adds an argument.
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 interface that defines the interaction between the Arg and Constraint.
An argument that allows multiple values of type T to be specified.
std::string _typeDesc
The description of type T to be used in the usage.
void _extractValue(const std::string &val)
Extracts the value from the string.
Just like a MultiArg, except that the arguments are unlabeled.
UnlabeledMultiArg(const std::string &name, const std::string &desc, bool req, const std::string &typeDesc, bool ignoreable=false, Visitor *v=nullptr)
Constructor.
std::string longID(const std::string &) const override
Returns the a long id string.
bool processArg(int *i, std::vector< std::string > &args) override
Handles the processing of the argument.
void addToList(std::list< Arg * > &argList) const override
Pushes this to back of list rather than front.
bool operator==(const Arg &a) const override
Operator ==.
bool hasLabel() const override
std::string shortID(const std::string &) const override
Returns the a short id string.
A base class that defines the interface for visitors.