tclap
1.4.0
|
ArgGroup is the base class for implementing groups of arguments that are mutually exclusive (it replaces the deprecated xor handler). More...
#include <ArgGroup.h>
Public Types | |
typedef std::list< Arg * > | Container |
typedef Container::iterator | iterator |
typedef Container::const_iterator | const_iterator |
Public Member Functions | |
virtual | ~ArgGroup () |
virtual ArgContainer & | add (Arg &arg) |
Add an argument to this arg group. More... | |
virtual ArgContainer & | add (Arg *arg) |
Add an argument to this arg group. More... | |
virtual bool | validate ()=0 |
Validates that the constraints of the ArgGroup are satisfied. More... | |
virtual bool | isRequired () const =0 |
Returns true if this argument group is required. More... | |
virtual bool | isExclusive () const =0 |
Returns true if this argument group is exclusive. More... | |
void | setParser (CmdLineInterface &parser) |
Used by the parser to connect itself to this arg group. More... | |
virtual bool | showAsGroup () const |
If arguments in this group should show up as grouped in help. More... | |
const std::string | getName () const |
Returns the argument group's name. More... | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
![]() | |
virtual | ~ArgContainer () |
Protected Member Functions | |
ArgGroup () | |
Protected Attributes | |
CmdLineInterface * | _parser |
Container | _args |
ArgGroup is the base class for implementing groups of arguments that are mutually exclusive (it replaces the deprecated xor handler).
It is not expected to be used directly, rather one of the EitherOf or OneOf derived classes are used.
Definition at line 41 of file ArgGroup.h.
typedef Container::const_iterator TCLAP::ArgGroup::const_iterator |
Definition at line 45 of file ArgGroup.h.
typedef std::list<Arg *> TCLAP::ArgGroup::Container |
Definition at line 43 of file ArgGroup.h.
typedef Container::iterator TCLAP::ArgGroup::iterator |
Definition at line 44 of file ArgGroup.h.
|
inlinevirtual |
Definition at line 47 of file ArgGroup.h.
|
inlineprotected |
Definition at line 116 of file ArgGroup.h.
|
inlinevirtual |
Add an argument to this arg group.
Implements TCLAP::ArgContainer.
Reimplemented in TCLAP::ExclusiveArgGroup.
Definition at line 50 of file ArgGroup.h.
References add(), isExclusive(), isRequired(), and validate().
Referenced by add(), and TCLAP::ExclusiveArgGroup::add().
|
inlinevirtual |
Add an argument to this arg group.
Implements TCLAP::ArgContainer.
Reimplemented in TCLAP::ExclusiveArgGroup, and TCLAP::StandaloneArgs.
Definition at line 192 of file ArgGroup.h.
References _args, _parser, TCLAP::CmdLineInterface::addToArgList(), begin(), end(), and TCLAP::Arg::longID().
|
inline |
Definition at line 109 of file ArgGroup.h.
References _args.
Referenced by TCLAP::StdOutput::_longUsage(), TCLAP::StdOutput::_shortUsage(), add(), TCLAP::StandaloneArgs::add(), TCLAP::CountVisibleArgs(), getName(), setParser(), and TCLAP::ExclusiveArgGroup::validate().
|
inline |
Definition at line 111 of file ArgGroup.h.
References _args.
|
inline |
Definition at line 110 of file ArgGroup.h.
References _args.
Referenced by TCLAP::StdOutput::_longUsage(), TCLAP::StdOutput::_shortUsage(), add(), TCLAP::StandaloneArgs::add(), TCLAP::CountVisibleArgs(), getName(), setParser(), and TCLAP::ExclusiveArgGroup::validate().
|
inline |
Definition at line 112 of file ArgGroup.h.
References _args.
|
inline |
Returns the argument group's name.
Definition at line 230 of file ArgGroup.h.
References begin(), and end().
Referenced by showAsGroup().
|
pure virtual |
Returns true if this argument group is exclusive.
Implemented in TCLAP::AnyOf, and TCLAP::ExclusiveArgGroup.
Referenced by TCLAP::StdOutput::_longUsage(), and add().
|
pure virtual |
Returns true if this argument group is required.
Implemented in TCLAP::AnyOf, TCLAP::OneOf, and TCLAP::EitherOf.
Referenced by TCLAP::StdOutput::_longUsage(), TCLAP::StdOutput::_shortUsage(), add(), TCLAP::internal::GroupChoice(), and TCLAP::ExclusiveArgGroup::validate().
|
inline |
Used by the parser to connect itself to this arg group.
Definition at line 90 of file ArgGroup.h.
References _parser, TCLAP::CmdLineInterface::addToArgList(), begin(), and end().
Referenced by TCLAP::CmdLine::add(), and TCLAP::CmdLine::CmdLine().
|
inlinevirtual |
If arguments in this group should show up as grouped in help.
Reimplemented in TCLAP::StandaloneArgs.
Definition at line 104 of file ArgGroup.h.
References getName().
Referenced by TCLAP::internal::GroupChoice().
|
pure virtual |
Validates that the constraints of the ArgGroup are satisfied.
Implemented in TCLAP::AnyOf, and TCLAP::ExclusiveArgGroup.
Referenced by add().
|
protected |
Definition at line 124 of file ArgGroup.h.
Referenced by add(), TCLAP::StandaloneArgs::add(), begin(), and end().
|
protected |
Definition at line 123 of file ArgGroup.h.
Referenced by add(), and setParser().