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
CmdLineOutput.h
TCLAP::HelpVisitor::_cmd
CmdLineInterface * _cmd
The CmdLine the output will be generated for.
Definition: HelpVisitor.h:87
TCLAP::Visitor::Visitor
Visitor()
Constructor.
Definition: Visitor.h:79
TCLAP::HelpVisitor::_out
CmdLineOutput ** _out
The output object.
Definition: HelpVisitor.h:92
Visitor.h
CmdLineInterface.h
TCLAP::HelpVisitor::visit
void visit()
Calls the usage method of the CmdLineOutput for the specified CmdLine.
Definition: HelpVisitor.h:108
TCLAP
Definition: Arg.h:48