VR-Link API Documentation for HLA Evolved
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
cmdLine
cmdHelpVisitor.h
Go to the documentation of this file.
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 DtCmdLine_HELP_VISITOR_H
23
#define DtCmdLine_HELP_VISITOR_H
24
28
29
#include "
cmdLineInterface.h
"
30
#include "
cmdLineOutput.h
"
31
#include "
cmdVisitor.h
"
32
33
#include <
vlutil/vlPrint.h
>
34
#include <
vlutil/vlProcessControl.h
>
35
#include <
vlutil/vlKeyboard.h
>
36
37
#ifdef DtUSE_UTILITIES_NAMESPACE
38
namespace
DtUSE_UTILITIES_NAMESPACE
39
{
40
#endif
41
42
namespace
DtCmdLine {
43
48
49
class
HelpVisitor
:
public
Visitor
50
{
51
protected
:
52
56
CmdLineInterface
*
_cmd
;
57
61
CmdLineOutput
**
_out
;
62
63
bool
myPressAnyKey
;
64
65
public
:
66
72
HelpVisitor
(
CmdLineInterface
* cmd,
CmdLineOutput
** out,
73
#ifdef _WIN32
74
bool
pressAnyKey =
true
)
75
#else
76
bool
pressAnyKey =
false
)
77
#endif
78
:
Visitor
(), _cmd( cmd ), _out( out ), myPressAnyKey(pressAnyKey) { }
79
80
virtual
~HelpVisitor
() { }
85
void
visit();
86
87
88
89
};
90
91
inline
void
HelpVisitor::visit()
92
{
93
(*_out)->usage(*_cmd);
94
95
int
oldNotifyLevel =
DtNotifyLevel
;
96
DtNotifyLevel
= 3;
97
98
99
if
(myPressAnyKey)
100
{
101
DtInfo
<<
"Press any key to continue"
<< std::endl;
102
103
while
(
DtPollBlockingInputChar
() ==
'\0'
)
104
{
105
DtSleep
(0.1);
106
}
107
}
108
109
DtNotifyLevel
= oldNotifyLevel;
110
111
exit(0);
112
}
113
114
}
115
116
#ifdef DtUSE_UTILITIES_NAMESPACE
117
}
118
#endif
119
120
#endif
Document ID: Generated on Tue Mar 1 02:56:17 EST 2016 from SVN revision 162687
Copyright © 2005-2014 VT MÄK. All Rights Reserved (
www.mak.com
)