tclap  1.4.0
Public Member Functions | List of all members
TCLAP::CmdLineInterface Class Referenceabstract

The base class that manages the command line definition and passes along the parsing to the appropriate Arg classes. More...

#include <CmdLineInterface.h>

Inheritance diagram for TCLAP::CmdLineInterface:
Inheritance graph
[legend]
Collaboration diagram for TCLAP::CmdLineInterface:
Collaboration graph
[legend]

Public Member Functions

virtual ~CmdLineInterface ()
 Destructor. More...
 
virtual ArgContaineradd (Arg &a)=0
 Adds an argument. More...
 
virtual ArgContaineradd (Arg *a)=0
 Adds an argument. More...
 
virtual void addToArgList (Arg *a)=0
 
virtual ArgContaineradd (ArgGroup &args)=0
 Adds an argument group to the list of arguments to be parsed. More...
 
virtual void xorAdd (Arg &a, Arg &b)=0
 
virtual void xorAdd (const std::vector< Arg *> &xors)=0
 
virtual void parse (int argc, const char *const *argv)=0
 Parses the command line. More...
 
void parse (std::vector< std::string > &args)
 Parses the command line. More...
 
virtual void setOutput (CmdLineOutput *co)=0
 
virtual std::string getVersion () const =0
 Returns the version string. More...
 
virtual std::string getProgramName () const =0
 Returns the program name string. More...
 
virtual std::list< ArgGroup * > getArgGroups ()=0
 Returns the list of ArgGroups. More...
 
virtual std::list< Arg * > getArgList () const =0
 
virtual char getDelimiter () const =0
 Returns the delimiter string. More...
 
virtual std::string getMessage () const =0
 Returns the message string. More...
 
virtual bool hasHelpAndVersion () const =0
 Indicates whether or not the help and version switches were created automatically. More...
 
virtual void reset ()=0
 Resets the instance as if it had just been constructed so that the instance can be reused. More...
 
virtual void beginIgnoring ()=0
 Begin ignoring arguments since the "--" argument was specified. More...
 
virtual bool ignoreRest ()=0
 Whether to ignore the rest. More...
 
- Public Member Functions inherited from TCLAP::ArgContainer
virtual ~ArgContainer ()
 

Detailed Description

The base class that manages the command line definition and passes along the parsing to the appropriate Arg classes.

Definition at line 46 of file CmdLineInterface.h.

Constructor & Destructor Documentation

◆ ~CmdLineInterface()

virtual TCLAP::CmdLineInterface::~CmdLineInterface ( )
inlinevirtual

Member Function Documentation

◆ add() [1/3]

virtual ArgContainer& TCLAP::CmdLineInterface::add ( Arg a)
pure virtual

Adds an argument.

Ownership is not transfered.

Parameters
a- Argument to be added.
Return values
Areference to this so that add calls can be chained

Implements TCLAP::ArgContainer.

Implemented in TCLAP::CmdLine.

Referenced by TCLAP::AnyOf::AnyOf(), TCLAP::ExclusiveArgGroup::ExclusiveArgGroup(), TCLAP::UnlabeledValueArg< T >::UnlabeledValueArg(), and ~CmdLineInterface().

◆ add() [2/3]

virtual ArgContainer& TCLAP::CmdLineInterface::add ( Arg a)
pure virtual

Adds an argument.

Ownership is not transfered.

Parameters
a- Argument to be added.
Return values
Areference to this so that add calls can be chained

Implements TCLAP::ArgContainer.

Implemented in TCLAP::CmdLine.

◆ add() [3/3]

virtual ArgContainer& TCLAP::CmdLineInterface::add ( ArgGroup args)
pure virtual

Adds an argument group to the list of arguments to be parsed.

All arguments in the group are added and the ArgGroup object will validate that the input matches its constraints.

Parameters
args- Argument group to be added.
Return values
Areference to this so that add calls can be chained

Implemented in TCLAP::CmdLine.

◆ addToArgList()

virtual void TCLAP::CmdLineInterface::addToArgList ( Arg a)
pure virtual

◆ beginIgnoring()

virtual void TCLAP::CmdLineInterface::beginIgnoring ( )
pure virtual

Begin ignoring arguments since the "--" argument was specified.

Implemented in TCLAP::CmdLine.

Referenced by TCLAP::IgnoreRestVisitor::visit(), and ~CmdLineInterface().

◆ getArgGroups()

virtual std::list<ArgGroup *> TCLAP::CmdLineInterface::getArgGroups ( )
pure virtual

◆ getArgList()

virtual std::list<Arg *> TCLAP::CmdLineInterface::getArgList ( ) const
pure virtual

Implemented in TCLAP::CmdLine.

Referenced by ~CmdLineInterface().

◆ getDelimiter()

virtual char TCLAP::CmdLineInterface::getDelimiter ( ) const
pure virtual

Returns the delimiter string.

Implemented in TCLAP::CmdLine.

Referenced by TCLAP::DocBookOutput::usage(), and ~CmdLineInterface().

◆ getMessage()

virtual std::string TCLAP::CmdLineInterface::getMessage ( ) const
pure virtual

Returns the message string.

Implemented in TCLAP::CmdLine.

Referenced by TCLAP::StdOutput::_longUsage(), TCLAP::DocBookOutput::usage(), and ~CmdLineInterface().

◆ getProgramName()

virtual std::string TCLAP::CmdLineInterface::getProgramName ( ) const
pure virtual

◆ getVersion()

virtual std::string TCLAP::CmdLineInterface::getVersion ( ) const
pure virtual

◆ hasHelpAndVersion()

virtual bool TCLAP::CmdLineInterface::hasHelpAndVersion ( ) const
pure virtual

Indicates whether or not the help and version switches were created automatically.

Implemented in TCLAP::CmdLine.

Referenced by TCLAP::StdOutput::failure(), and ~CmdLineInterface().

◆ ignoreRest()

virtual bool TCLAP::CmdLineInterface::ignoreRest ( )
pure virtual

Whether to ignore the rest.

Implemented in TCLAP::CmdLine.

Referenced by ~CmdLineInterface().

◆ parse() [1/2]

virtual void TCLAP::CmdLineInterface::parse ( int  argc,
const char *const *  argv 
)
pure virtual

Parses the command line.

Parameters
argc- Number of arguments.
argv- Array of arguments.

Implemented in TCLAP::CmdLine.

Referenced by ~CmdLineInterface().

◆ parse() [2/2]

void TCLAP::CmdLineInterface::parse ( std::vector< std::string > &  args)

Parses the command line.

Parameters
args- A vector of strings representing the args. args[0] is still the program name.

◆ reset()

virtual void TCLAP::CmdLineInterface::reset ( )
pure virtual

Resets the instance as if it had just been constructed so that the instance can be reused.

Implemented in TCLAP::CmdLine.

Referenced by ~CmdLineInterface().

◆ setOutput()

virtual void TCLAP::CmdLineInterface::setOutput ( CmdLineOutput co)
pure virtual
Parameters
co- CmdLineOutput object that we want to use instead.

Implemented in TCLAP::CmdLine.

Referenced by ~CmdLineInterface().

◆ xorAdd() [1/2]

virtual void TCLAP::CmdLineInterface::xorAdd ( Arg a,
Arg b 
)
pure virtual
Deprecated:
Use OneOf instead.

Implemented in TCLAP::CmdLine.

Referenced by ~CmdLineInterface().

◆ xorAdd() [2/2]

virtual void TCLAP::CmdLineInterface::xorAdd ( const std::vector< Arg *> &  xors)
pure virtual
Deprecated:
Use OneOf instead.

Implemented in TCLAP::CmdLine.


The documentation for this class was generated from the following file: