~ubuntu-branches/ubuntu/trusty/hugin/trusty-proposed

« back to all changes in this revision

Viewing changes to src/foreign/tclap/HelpVisitor.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2011-01-06 14:28:24 UTC
  • mfrom: (1.1.9 upstream) (0.1.21 experimental)
  • Revision ID: james.westby@ubuntu.com-20110106142824-zn9lxylg5z44dynn
* Drop Cyril Brulebois from Uploaders. Thank you very much for your work.
* Bump package version. (rc3 was re-released as 2010.4.0).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/****************************************************************************** 
 
3
 * 
 
4
 *  file:  HelpVisitor.h
 
5
 * 
 
6
 *  Copyright (c) 2003, Michael E. Smoot .
 
7
 *  All rights reverved.
 
8
 * 
 
9
 *  See the file COPYING in the top directory of this distribution for
 
10
 *  more information.
 
11
 *  
 
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.  
 
19
 *  
 
20
 *****************************************************************************/ 
 
21
 
 
22
#ifndef TCLAP_HELP_VISITOR_H
 
23
#define TCLAP_HELP_VISITOR_H
 
24
 
 
25
#include <tclap/CmdLineInterface.h>
 
26
#include <tclap/CmdLineOutput.h>
 
27
#include <tclap/Visitor.h>
 
28
 
 
29
namespace TCLAP {
 
30
 
 
31
/**
 
32
 * A Visitor object that calls the usage method of the given CmdLineOutput
 
33
 * object for the specified CmdLine object.
 
34
 */
 
35
class HelpVisitor: public Visitor
 
36
{
 
37
        protected:
 
38
 
 
39
                /**
 
40
                 * The CmdLine the output will be generated for. 
 
41
                 */
 
42
                CmdLineInterface* _cmd;
 
43
 
 
44
                /**
 
45
                 * The output object. 
 
46
                 */
 
47
                CmdLineOutput** _out;
 
48
 
 
49
        public:
 
50
 
 
51
                /**
 
52
                 * Constructor.
 
53
                 * \param cmd - The CmdLine the output will be generated for.
 
54
                 * \param out - The type of output. 
 
55
                 */
 
56
                HelpVisitor(CmdLineInterface* cmd, CmdLineOutput** out) 
 
57
                                : Visitor(), _cmd( cmd ), _out( out ) { }
 
58
 
 
59
                /**
 
60
                 * Calls the usage method of the CmdLineOutput for the 
 
61
                 * specified CmdLine.
 
62
                 */
 
63
                void visit() { (*_out)->usage(*_cmd); exit(0); }
 
64
                
 
65
};
 
66
 
 
67
}
 
68
 
 
69
#endif