2
/******************************************************************************
6
* Copyright (c) 2003, Michael E. Smoot .
9
* See the file COPYING in the top directory of this distribution for
12
* THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
13
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18
* DEALINGS IN THE SOFTWARE.
20
*****************************************************************************/
22
#ifndef TCLAP_HELP_VISITOR_H
23
#define TCLAP_HELP_VISITOR_H
25
#include <tclap/CmdLineInterface.h>
26
#include <tclap/CmdLineOutput.h>
27
#include <tclap/Visitor.h>
32
* A Visitor object that calls the usage method of the given CmdLineOutput
33
* object for the specified CmdLine object.
35
class HelpVisitor: public Visitor
40
* The CmdLine the output will be generated for.
42
CmdLineInterface* _cmd;
53
* \param cmd - The CmdLine the output will be generated for.
54
* \param out - The type of output.
56
HelpVisitor(CmdLineInterface* cmd, CmdLineOutput** out)
57
: Visitor(), _cmd( cmd ), _out( out ) { }
60
* Calls the usage method of the CmdLineOutput for the
63
void visit() { (*_out)->usage(*_cmd); exit(0); }