Template Class UnlabeledMultiArg
Defined in File unlabeled_multi_arg.hpp
Inheritance Relationships
Base Type
public ecl::MultiArg< T >
(Template Class MultiArg)
Class Documentation
-
template<class T>
class UnlabeledMultiArg : public ecl::MultiArg<T> Just like a MultiArg, except that the arguments are unlabeled. Basically, this Arg will slurp up everything that hasn’t been matched to another Arg.
Public Functions
-
UnlabeledMultiArg(const std::string &name, const std::string &desc, bool req, const std::string &typeDesc, bool ignoreable = false, Visitor *v = NULL)
Constructor.
- Parameters:
name – - The name of the Arg. Note that this is used for identification, not as a long flag.
desc – - A description of what the argument is for or does.
req – - Whether the argument is required on the command line.
typeDesc – - A short, human readable description of the type that this object expects. This is used in the generation of the USAGE statement. The goal is to be helpful to the end user of the program.
ignoreable – - Whether or not this argument can be ignored using the “–” flag.
v – - An optional visitor. You probably should not use this unless you have a very good reason.
-
UnlabeledMultiArg(const std::string &name, const std::string &desc, bool req, const std::string &typeDesc, CmdLineInterface &parser, bool ignoreable = false, Visitor *v = NULL)
Constructor.
- Parameters:
name – - The name of the Arg. Note that this is used for identification, not as a long flag.
desc – - A description of what the argument is for or does.
req – - Whether the argument is required on the command line.
typeDesc – - A short, human readable description of the type that this object expects. This is used in the generation of the USAGE statement. The goal is to be helpful to the end user of the program.
ignoreable – - Whether or not this argument can be ignored using the “–” flag.
v – - An optional visitor. You probably should not use this unless you have a very good reason.
-
UnlabeledMultiArg(const std::string &name, const std::string &desc, bool req, Constraint<T> *constraint, bool ignoreable = false, Visitor *v = NULL)
Constructor.
- Parameters:
name – - The name of the Arg. Note that this is used for identification, not as a long flag.
desc – - A description of what the argument is for or does.
req – - Whether the argument is required on the command line.
constraint – - A pointer to a Constraint object used to constrain this Arg.
ignoreable – - Whether or not this argument can be ignored using the “–” flag.
v – - An optional visitor. You probably should not use this unless you have a very good reason.
-
UnlabeledMultiArg(const std::string &name, const std::string &desc, bool req, Constraint<T> *constraint, CmdLineInterface &parser, bool ignoreable = false, Visitor *v = NULL)
Constructor.
- Parameters:
name – - The name of the Arg. Note that this is used for identification, not as a long flag.
desc – - A description of what the argument is for or does.
req – - Whether the argument is required on the command line.
constraint – - A pointer to a Constraint object used to constrain this Arg.
ignoreable – - Whether or not this argument can be ignored using the “–” flag.
v – - An optional visitor. You probably should not use this unless you have a very good reason.
-
virtual bool processArg(int *i, std::vector<std::string> &args)
Handles the processing of the argument. This re-implements the Arg version of this method to set the _value of the argument appropriately. It knows the difference between labeled and unlabeled.
- Parameters:
i – - Pointer the the current argument in the list.
args – - Mutable list of strings. Passed from main().
-
virtual std::string shortID(const std::string &val = "val") const
Returns the a short id string. Used in the usage.
- Parameters:
val – - value to be used.
-
virtual std::string longID(const std::string &val = "val") const
Returns the a long id string. Used in the usage.
- Parameters:
val – - value to be used.
-
UnlabeledMultiArg(const std::string &name, const std::string &desc, bool req, const std::string &typeDesc, bool ignoreable = false, Visitor *v = NULL)