25 #ifndef TCLAP_XORHANDLER_H 26 #define TCLAP_XORHANDLER_H 60 void add(
const std::vector<Arg*>& ors );
89 const std::vector< std::vector<Arg*> >&
getXorList()
const;
105 for (
int i = 0;
static_cast<unsigned int>(i) <
_orList.size(); i++ )
117 if ( a != (*it) && (*it)->
isSet() )
119 "Mutually exclusive argument already set!",
130 if ( (*ait)->allowMore() )
133 return static_cast<int>(
_orList[i].size());
145 for (
int i = 0;
static_cast<unsigned int>(i) <
_orList.size(); i++ )
A virtual base class that defines the essential data for all arguments.
Thrown from CmdLine when the arguments on the command line are not properly specified, e.g.
const std::vector< std::vector< Arg * > > & getXorList() const
bool isSet() const
Indicates whether the argument has already been set.
int check(const Arg *a)
Checks whether the specified Arg is in one of the xor lists and if it does match one, returns the size of the xor list that the Arg matched.
virtual bool isRequired() const
Indicates whether the argument is required.
std::vector< Arg * >::const_iterator ArgVectorIterator
Typedef of an Arg vector iterator.
std::vector< std::vector< Arg * > > _orList
The list of of lists of Arg's to be or'd together.
void add(const std::vector< Arg *> &ors)
Add a list of Arg*'s that will be xor'd together.
bool contains(const Arg *a)
Simply checks whether the Arg is contained in one of the arg lists.
void printLongUsage(std::ostream &os)
Prints the XOR specific long usage.
std::string shortUsage()
Returns the XOR specific short usage.
This class handles lists of Arg's that are to be XOR'd on the command line.