CmdLineInterface.h
Go to the documentation of this file.
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
/******************************************************************************
*
* file: CmdLineInterface.h
*
* Copyright (c) 2003, Michael E. Smoot .
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
* Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
* more information.
*
* THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*****************************************************************************/
#ifndef TCLAP_COMMANDLINE_INTERFACE_H
#define TCLAP_COMMANDLINE_INTERFACE_H
#include <string>
#include <vector>
#include <list>
#include <iostream>
#include <algorithm>
namespace TCLAP {
class Arg;
class CmdLineOutput;
class XorHandler;
class CmdLineInterface
{
public:
virtual ~CmdLineInterface() {}
virtual void add( Arg& a )=0;
virtual void add( Arg* a )=0;
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;
void parse(std::vector<std::string>& args);
virtual CmdLineOutput* getOutput()=0;
virtual void setOutput(CmdLineOutput* co)=0;
virtual std::string& getVersion()=0;
virtual std::string& getProgramName()=0;
virtual std::list<Arg*>& getArgList()=0;
virtual XorHandler& getXorHandler()=0;
virtual char getDelimiter()=0;
virtual std::string& getMessage()=0;
virtual bool hasHelpAndVersion()=0;
virtual void reset()=0;
};
} //namespace
#endif
TCLAP::Arg
A virtual base class that defines the essential data for all arguments.
Definition: Arg.h:56
TCLAP::CmdLineInterface
The base class that manages the command line definition and passes along the parsing to the appropria...
Definition: CmdLineInterface.h:47
TCLAP::CmdLineInterface::getVersion
virtual std::string & getVersion()=0
Returns the version string.
TCLAP::CmdLineInterface::getXorHandler
virtual XorHandler & getXorHandler()=0
Returns the XorHandler.
TCLAP::CmdLineInterface::add
virtual void add(Arg &a)=0
Adds an argument to the list of arguments to be parsed.
TCLAP::CmdLineInterface::getProgramName
virtual std::string & getProgramName()=0
Returns the program name string.
TCLAP::CmdLineInterface::parse
void parse(std::vector< std::string > &args)
Parses the command line.
TCLAP::CmdLineInterface::getMessage
virtual std::string & getMessage()=0
Returns the message string.
TCLAP::CmdLineInterface::hasHelpAndVersion
virtual bool hasHelpAndVersion()=0
Indicates whether or not the help and version switches were created automatically.
TCLAP::CmdLineInterface::getArgList
virtual std::list< Arg * > & getArgList()=0
Returns the argList.
TCLAP::CmdLineInterface::parse
virtual void parse(int argc, const char *const *argv)=0
Parses the command line.
TCLAP::CmdLineInterface::xorAdd
virtual void xorAdd(Arg &a, Arg &b)=0
Add two Args that will be xor'd.
TCLAP::CmdLineInterface::reset
virtual void reset()=0
Resets the instance as if it had just been constructed so that the instance can be reused.
TCLAP::CmdLineInterface::add
virtual void add(Arg *a)=0
An alternative add.
TCLAP::CmdLineInterface::getDelimiter
virtual char getDelimiter()=0
Returns the delimiter string.
TCLAP::CmdLineInterface::~CmdLineInterface
virtual ~CmdLineInterface()
Destructor.
Definition: CmdLineInterface.h:53
TCLAP::CmdLineInterface::setOutput
virtual void setOutput(CmdLineOutput *co)=0
TCLAP::CmdLineInterface::xorAdd
virtual void xorAdd(const std::vector< Arg * > &xors)=0
Add a list of Args that will be xor'd.
TCLAP::CmdLineInterface::getOutput
virtual CmdLineOutput * getOutput()=0
Returns the CmdLineOutput object.
TCLAP::CmdLineOutput
The interface that any output object must implement.
Definition: CmdLineOutput.h:45
TCLAP::XorHandler
This class handles lists of Arg's that are to be XOR'd on the command line.
Definition: XorHandler.h:41
TCLAP
Definition: Arg.h:48