tclap 1.2.1

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

CmdLineInterface.h
Go to the documentation of this file.
1
2 /******************************************************************************
3 *
4 * file: CmdLineInterface.h
5 *
6 * Copyright (c) 2003, Michael E. Smoot .
7 * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
8 * All rights reverved.
9 *
10 * See the file COPYING in the top directory of this distribution for
11 * more information.
12 *
13 * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
14 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 * DEALINGS IN THE SOFTWARE.
20 *
21 *****************************************************************************/
22
23 #ifndef TCLAP_COMMANDLINE_INTERFACE_H
24 #define TCLAP_COMMANDLINE_INTERFACE_H
25
26 #include <string>
27 #include <vector>
28 #include <list>
29 #include <iostream>
30 #include <algorithm>
31
32
33 namespace TCLAP {
34
35 class Arg;
36 class CmdLineOutput;
37 class XorHandler;
38
43 class CmdLineInterface
44 {
45 public:
46
50 virtual ~CmdLineInterface() {}
51
56 virtual void add( Arg& a )=0;
57
62 virtual void add( Arg* a )=0;
63
71 virtual void xorAdd( Arg& a, Arg& b )=0;
72
78 virtual void xorAdd( std::vector<Arg*>& xors )=0;
79
85 virtual void parse(int argc, const char * const * argv)=0;
86
92 void parse(std::vector<std::string>& args);
93
97 virtual CmdLineOutput* getOutput()=0;
98
102 virtual void setOutput(CmdLineOutput* co)=0;
103
107 virtual std::string& getVersion()=0;
108
112 virtual std::string& getProgramName()=0;
113
117 virtual std::list<Arg*>& getArgList()=0;
118
122 virtual XorHandler& getXorHandler()=0;
123
127 virtual char getDelimiter()=0;
128
132 virtual std::string& getMessage()=0;
133
138 virtual bool hasHelpAndVersion()=0;
139
144 virtual void reset()=0;
145 };
146
147 } //namespace
148
149
150 #endif
TCLAP::CmdLineInterface::hasHelpAndVersion
virtual bool hasHelpAndVersion()=0
Indicates whether or not the help and version switches were created automatically.
TCLAP::CmdLineInterface::xorAdd
virtual void xorAdd(Arg &a, Arg &b)=0
Add two Args that will be xor'd.
TCLAP::Arg
A virtual base class that defines the essential data for all arguments.
Definition: Arg.h:64
TCLAP::CmdLineInterface::getProgramName
virtual std::string & getProgramName()=0
Returns the program name string.
TCLAP::CmdLineInterface::getArgList
virtual std::list< Arg * > & getArgList()=0
Returns the argList.
TCLAP::CmdLineInterface::~CmdLineInterface
virtual ~CmdLineInterface()
Destructor.
Definition: CmdLineInterface.h:50
TCLAP::CmdLineInterface::getDelimiter
virtual char getDelimiter()=0
Returns the delimiter string.
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::getOutput
virtual CmdLineOutput * getOutput()=0
Returns the CmdLineOutput object.
TCLAP::CmdLineInterface::getVersion
virtual std::string & getVersion()=0
Returns the version string.
TCLAP::CmdLineInterface::getXorHandler
virtual XorHandler & getXorHandler()=0
Returns the XorHandler.
TCLAP::CmdLineInterface::setOutput
virtual void setOutput(CmdLineOutput *co)=0
TCLAP::CmdLineInterface::parse
virtual void parse(int argc, const char *const *argv)=0
Parses the command line.
TCLAP::CmdLineInterface
The base class that manages the command line definition and passes along the parsing to the appropria...
Definition: CmdLineInterface.h:43
TCLAP::CmdLineInterface::add
virtual void add(Arg &a)=0
Adds an argument to the list of arguments to be parsed.
TCLAP::CmdLineInterface::getMessage
virtual std::string & getMessage()=0
Returns the message string.
TCLAP
Definition: Arg.h:57
TCLAP::XorHandler
This class handles lists of Arg's that are to be XOR'd on the command line.
Definition: XorHandler.h:38
TCLAP::CmdLineOutput
The interface that any output object must implement.
Definition: CmdLineOutput.h:41