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
28#include <tclap/CmdLineOutput.h>
29#include <tclap/Visitor.h>
30
31namespace TCLAP {
32
37class HelpVisitor: public Visitor
38{
39 private:
43 HelpVisitor(const HelpVisitor& rhs);
44 HelpVisitor& operator=(const HelpVisitor& rhs);
45
46 protected:
47
52
57
58 public:
59
66 : Visitor(), _cmd( cmd ), _out( out ) { }
67
72 void visit() { (*_out)->usage(*_cmd); throw ExitException(0); }
73
74};
75
76}
77
78#endif
The base class that manages the command line definition and passes along the parsing to the appropria...
The interface that any output object must implement.
Thrown when TCLAP thinks the program should exit.
A Visitor object that calls the usage method of the given CmdLineOutput object for the specified CmdL...
Definition HelpVisitor.h:38
void visit()
Calls the usage method of the CmdLineOutput for the specified CmdLine.
Definition HelpVisitor.h:72
HelpVisitor(CmdLineInterface *cmd, CmdLineOutput **out)
Constructor.
Definition HelpVisitor.h:65
CmdLineOutput ** _out
The output object.
Definition HelpVisitor.h:56
CmdLineInterface * _cmd
The CmdLine the output will be generated for.
Definition HelpVisitor.h:51
A base class that defines the interface for visitors.
Definition Visitor.h:35
Definition Arg.h:48