23 #ifndef TCLAP_ARG_GROUP_H 24 #define TCLAP_ARG_GROUP_H 96 for (iterator it =
begin(); it !=
end(); ++it) {
107 const std::string
getName()
const;
140 "Required arguments are not allowed" 141 " in an exclusive grouping.",
196 "Argument with same flag/name already exists!", arg->
longID());
200 _args.push_back(arg);
213 if ((*it)->isSet()) {
214 if (arg != NULL && !(*arg == **it)) {
218 "Only one is allowed.",
219 flag +
" AND " + (*it)->setBy() +
" provided.");
232 std::string sep =
"{";
235 name += sep + (*it)->getName();
246 if ((*it)->visibleInHelp()) {
256 #endif // TCLAP_ARG_GROUP_H
virtual bool isRequired() const =0
Returns true if this argument group is required.
Implements a group of arguments where exactly one must be selected.
bool isExclusive() const
Returns true if this argument group is exclusive.
void setParser(CmdLineInterface &parser)
Used by the parser to connect itself to this arg group.
A virtual base class that defines the essential data for all arguments.
Implements common functionality for exclusive argument groups.
Thrown from CmdLine when the arguments on the command line are not properly specified, e.g.
bool isRequired() const
Returns true if this argument group is required.
virtual ArgContainer & add(Arg &a)=0
Adds an argument.
Thrown from Arg and CmdLine when an Arg is improperly specified, e.g.
virtual std::string longID(const std::string &valueId="val") const
Returns a long ID for the usage.
bool isRequired() const
Returns true if this argument group is required.
Container::const_iterator const_iterator
virtual bool isRequired() const
Indicates whether the argument is required.
virtual void addToArgList(Arg *a)=0
virtual ArgContainer & add(Arg &arg)
Add an argument to this arg group.
Interface that allows adding an Arg to a "container".
OneOf(CmdLineInterface &parser)
ArgContainer & add(Arg *arg)
Add an argument to this arg group.
bool validate()
Validates that the constraints of the ArgGroup are satisfied.
virtual bool isExclusive() const =0
Returns true if this argument group is exclusive.
Container::iterator iterator
ArgContainer & add(Arg &arg)
Add an argument to this arg group.
const_iterator end() const
The base class that manages the command line definition and passes along the parsing to the appropria...
int CountVisibleArgs(const ArgGroup &g)
Implements a group of arguments where at most one can be selected.
const_iterator begin() const
virtual bool showAsGroup() const
If arguments in this group should show up as grouped in help.
bool validate()
Validates that the constraints of the ArgGroup are satisfied.
virtual bool validate()=0
Validates that the constraints of the ArgGroup are satisfied.
Implements a group of arguments where any combination is possible (including all or none)...
ExclusiveArgGroup(CmdLineInterface &parser)
bool isRequired() const
Returns true if this argument group is required.
EitherOf(CmdLineInterface &parser)
CmdLineInterface * _parser
std::list< Arg * > Container
ArgGroup is the base class for implementing groups of arguments that are mutually exclusive (it repla...
bool isExclusive() const
Returns true if this argument group is exclusive.
AnyOf(CmdLineInterface &parser)
const std::string getName() const
Returns the argument group's name.