tclap: HelpVisitor.h Source File

tclap 1.2.5

HelpVisitor.h
Go to the documentation of this file.
1 // -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
2
3
4 /******************************************************************************
5 *
6 * file: HelpVisitor.h
7 *
8 * Copyright (c) 2003, Michael E. Smoot .
9 * All rights reserved.
10 *
11 * See the file COPYING in the top directory of this distribution for
12 * more information.
13 *
14 * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 *
22 *****************************************************************************/
23
24 #ifndef TCLAP_HELP_VISITOR_H
25 #define TCLAP_HELP_VISITOR_H
26
27 #include <tclap/CmdLineInterface.h>
28 #include <tclap/CmdLineOutput.h>
29 #include <tclap/Visitor.h>
30
31 namespace TCLAP {
32
37 class HelpVisitor: public Visitor
38 {
39 private:
43 HelpVisitor(const HelpVisitor& rhs);
44 HelpVisitor& operator=(const HelpVisitor& rhs);
45
46 protected:
47
51 CmdLineInterface* _cmd;
52
56 CmdLineOutput** _out;
57
58 public:
59
65 HelpVisitor(CmdLineInterface* cmd, CmdLineOutput** out)
66 : Visitor(), _cmd( cmd ), _out( out ) { }
67
72 void visit() { (*_out)->usage(*_cmd); throw ExitException(0); }
73
74 };
75
76 }
77
78 #endif
CmdLineInterface.h
CmdLineOutput.h
Visitor.h
TCLAP::CmdLineInterface
The base class that manages the command line definition and passes along the parsing to the appropria...
Definition: CmdLineInterface.h:47
TCLAP::CmdLineOutput
The interface that any output object must implement.
Definition: CmdLineOutput.h:45
TCLAP::ExitException
Thrown when TCLAP thinks the program should exit.
Definition: ArgException.h:200
TCLAP::HelpVisitor
A Visitor object that calls the usage method of the given CmdLineOutput object for the specified CmdL...
Definition: HelpVisitor.h:38
TCLAP::HelpVisitor::visit
void visit()
Calls the usage method of the CmdLineOutput for the specified CmdLine.
Definition: HelpVisitor.h:72
TCLAP::HelpVisitor::HelpVisitor
HelpVisitor(CmdLineInterface *cmd, CmdLineOutput **out)
Constructor.
Definition: HelpVisitor.h:65
TCLAP::HelpVisitor::_out
CmdLineOutput ** _out
The output object.
Definition: HelpVisitor.h:56
TCLAP::HelpVisitor::_cmd
CmdLineInterface * _cmd
The CmdLine the output will be generated for.
Definition: HelpVisitor.h:51
TCLAP::Visitor
A base class that defines the interface for visitors.
Definition: Visitor.h:35
TCLAP
Definition: Arg.h:48