23#ifndef TCLAP_ARG_GROUP_H
24#define TCLAP_ARG_GROUP_H
108 const std::string
getName()
const;
141 "Required arguments are not allowed"
142 " in an exclusive grouping.",
197 "Argument with same flag/name already exists!", arg->
longID());
202 members.push_back(arg);
216 if ((*it)->isSet()) {
217 if (arg != NULL && arg != *it) {
221 "Only one is allowed.",
222 flag +
" AND " + (*it)->setBy() +
" provided.");
235 std::string sep =
"{";
238 name += sep + (*it)->
getName();
249 if ((*it)->visibleInHelp()) {
Groups arguments for presentation without imposing a selection rule.
bool isRequired() const
Returns true if this argument group is required.
bool isExclusive() const
Returns true if this argument group is exclusive.
AnyOf(CmdLineInterface &parser)
bool validate()
Validates that the constraints of the ArgGroup are satisfied.
Interface that allows adding an Arg to a "container".
ArgGroup is the base class for implementing groups of arguments that are mutually exclusive (it repla...
virtual bool isExclusive() const =0
Returns true if this argument group is exclusive.
void setParser(CmdLineInterface &parser)
Used by the parser to connect itself to this arg group.
CmdLineInterface * _parser
const_iterator begin() const
std::list< Arg * > Container
Container::const_iterator const_iterator
const_iterator end() const
const std::string getName() const
Returns the argument group's name.
virtual ArgContainer & add(Arg &arg)
Add an argument to this arg group.
virtual bool showAsGroup() const
If arguments in this group should show up as grouped in help.
virtual bool validate()=0
Validates that the constraints of the ArgGroup are satisfied.
Container::iterator iterator
virtual bool isRequired() const =0
Returns true if this argument group is required.
A virtual base class that defines the essential data for all arguments.
const std::string & setBy() const
Returns the value specified to set this flag (like -a or –all).
virtual std::string longID(const std::string &valueId="val") const
Returns a long ID for the usage.
bool conflictsWith(const Arg &a) const
Checks declared registration conflicts: the same object, the same name, or the same nonempty short fl...
const std::string & getName() const
Returns the argument name.
virtual bool isRequired() const
Indicates whether the argument is required.
The base class that manages the command line definition and passes along the parsing to the appropria...
virtual bool attachGroup(ArgGroup &)
virtual ArgContainer & add(Arg &a)=0
Adds an argument.
virtual void addToArgList(Arg *a)=0
Thrown from CmdLine when the arguments on the command line are not properly specified,...
The base class that manages the command line definition and passes along the parsing to the appropria...
Implements a group of arguments where at most one can be selected.
bool isRequired() const
Returns true if this argument group is required.
EitherOf(CmdLineInterface &parser)
Implements common functionality for exclusive argument groups.
bool isExclusive() const
Returns true if this argument group is exclusive.
ArgContainer & add(Arg &arg)
Add an argument to this arg group.
ExclusiveArgGroup(CmdLineInterface &parser)
bool validate()
Validates that the constraints of the ArgGroup are satisfied.
ArgContainer & add(Arg *arg)
Add an argument to this arg group.
Implements a group of arguments where exactly one must be selected.
bool isRequired() const
Returns true if this argument group is required.
OneOf(CmdLineInterface &parser)
Thrown from Arg and CmdLine when an Arg is improperly specified, e.g.
int CountVisibleArgs(const ArgGroup &g)