OFFIS DCMTK
Version 3.6.0
Main Page
Related Pages
Classes
Files
File List
File Members
ofstd
include
dcmtk
ofstd
ofconapp.h
1
/*
2
*
3
* Copyright (C) 1999-2010, OFFIS e.V.
4
* All rights reserved. See COPYRIGHT file for details.
5
*
6
* This software and supporting documentation were developed by
7
*
8
* OFFIS e.V.
9
* R&D Division Health
10
* Escherweg 2
11
* D-26121 Oldenburg, Germany
12
*
13
*
14
* Module: ofstd
15
*
16
* Author: Joerg Riesmeier
17
*
18
* Purpose: Handle console applications (Header)
19
*
20
* Last Update: $Author: joergr $
21
* Update Date: $Date: 2010-10-14 13:15:50 $
22
* CVS/RCS Revision: $Revision: 1.25 $
23
* Status: $State: Exp $
24
*
25
* CVS/RCS Log at end of file
26
*
27
*/
28
29
30
#ifndef OFCONAPP_H
31
#define OFCONAPP_H
32
33
#include "dcmtk/config/osconfig.h"
34
35
#include "dcmtk/ofstd/oftypes.h"
36
#include "dcmtk/ofstd/ofcmdln.h"
37
#include "dcmtk/ofstd/ofstring.h"
/* for class OFString */
38
39
40
/*---------------------*
41
* class declaration *
42
*---------------------*/
43
49
class
OFConsoleApplication
50
{
51
52
public
:
53
60
OFConsoleApplication
(
const
char
*app,
61
const
char
*desc = NULL,
62
const
char
*rcsid = NULL);
63
66
~OFConsoleApplication
();
67
81
OFBool
parseCommandLine
(
OFCommandLine
&cmd,
82
int
argCount,
83
char
*argValue[],
84
const
int
flags = 0,
85
const
int
startPos = 1);
86
92
void
printHeader
(
const
OFBool hostInfo = OFFalse,
93
const
OFBool stdError = OFFalse);
94
99
void
printUsage
(
const
OFCommandLine
*cmd = NULL);
100
105
void
printArguments
(
OFCommandLine
*cmd = NULL);
106
109
void
printIdentifier
();
110
116
void
printError
(
const
char
*str,
117
const
int
code = 1);
118
124
void
printWarning
(
const
char
*str,
125
const
char
*prefix =
"warning"
);
126
131
void
printMessage
(
const
char
*str);
132
137
OFBool
quietMode
()
const
;
138
143
void
setQuietMode
(
const
OFBool mode = OFTrue);
144
150
void
checkValue
(
const
OFCommandLine::E_ValueStatus
status,
151
OFCommandLine
*cmd = NULL);
152
158
void
checkParam
(
const
OFCommandLine::E_ParamValueStatus
status,
159
OFCommandLine
*cmd = NULL);
160
168
void
checkDependence
(
const
char
*subOpt,
169
const
char
*baseOpt,
170
OFBool condition);
171
179
void
checkConflict
(
const
char
*firstOpt,
180
const
char
*secondOpt,
181
OFBool condition);
182
183
184
private
:
185
187
OFString
Name
;
189
OFString
Description
;
191
OFString
Identification
;
192
194
OFBool
QuietMode
;
195
197
OFCommandLine
*
CmdLine
;
198
199
200
// --- declarations to avoid compiler warnings
201
202
OFConsoleApplication
(
const
OFConsoleApplication
&);
203
OFConsoleApplication
&operator=(
const
OFConsoleApplication
&);
204
};
205
206
207
#endif
208
209
210
/*
211
*
212
* CVS/RCS Log:
213
* $Log: ofconapp.h,v $
214
* Revision 1.25 2010-10-14 13:15:50 joergr
215
* Updated copyright header. Added reference to COPYRIGHT file.
216
*
217
* Revision 1.24 2008-09-25 11:14:54 joergr
218
* Added method for printing the resource identifier of an application.
219
*
220
* Revision 1.23 2008-09-25 10:10:16 joergr
221
* Print expanded command line arguments to stderr and not to stdout.
222
*
223
* Revision 1.22 2008-09-24 13:24:00 joergr
224
* Added support for printing the expanded command line arguments to standard
225
* output stream.
226
*
227
* Revision 1.21 2006/07/27 13:17:23 joergr
228
* Prepended prefix "PF_" to parseLine() flags.
229
*
230
* Revision 1.20 2005/12/08 16:05:49 meichel
231
* Changed include path schema for all DCMTK header files
232
*
233
* Revision 1.19 2004/01/16 10:30:12 joergr
234
* Removed acknowledgements with e-mail addresses from CVS log.
235
*
236
* Revision 1.18 2003/12/05 10:37:41 joergr
237
* Removed leading underscore characters from preprocessor symbols (reserved
238
* symbols). Updated copyright date where appropriate.
239
*
240
* Revision 1.17 2003/07/04 13:29:51 meichel
241
* Replaced forward declarations for OFString with explicit includes,
242
* needed when compiling with HAVE_STD_STRING
243
*
244
* Revision 1.16 2003/06/12 13:17:51 joergr
245
* Enhanced method printWarning(). Added method quietMode().
246
*
247
* Revision 1.15 2002/11/26 12:55:02 joergr
248
* Changed syntax usage output for command line applications from stderr to
249
* stdout.
250
*
251
* Revision 1.14 2002/09/23 14:56:55 joergr
252
* Prepared code for future support of 'config.guess' host identifiers.
253
*
254
* Revision 1.13 2002/04/16 13:36:02 joergr
255
* Added configurable support for C++ ANSI standard includes (e.g. streams).
256
*
257
* Revision 1.12 2001/06/01 15:51:33 meichel
258
* Updated copyright header
259
*
260
* Revision 1.11 2000/10/10 12:01:20 meichel
261
* Created/updated doc++ comments
262
*
263
* Revision 1.10 2000/04/14 15:17:12 meichel
264
* Adapted all ofstd library classes to consistently use ofConsole for output.
265
*
266
* Revision 1.9 2000/03/08 16:36:01 meichel
267
* Updated copyright header.
268
*
269
* Revision 1.8 2000/03/07 15:38:50 joergr
270
* Changed behaviour of class OFConsoleApplication to support automatic
271
* evaluation of "--help" option for command line application with no
272
* mandatory parameter.
273
*
274
* Revision 1.7 1999/09/13 16:37:15 joergr
275
* Added methods for output of warning and other messages.
276
* Added method to switch on/off all output messages (quiet mode).
277
*
278
* Revision 1.6 1999/08/17 10:23:10 joergr
279
* Corrected Doc++ comment.
280
*
281
* Revision 1.5 1999/04/27 16:24:53 joergr
282
* Introduced list of valid parameters used for syntax output and error
283
* checking.
284
* Added method to check conflicts between two options (incl. error output).
285
*
286
* Revision 1.4 1999/04/26 16:34:34 joergr
287
* Added support to check dependences between different options and report
288
* error messages if necessary.
289
*
290
* Revision 1.3 1999/04/21 12:41:03 meichel
291
* Added method OFConsoleApplication::checkParam()
292
*
293
* Revision 1.2 1999/03/22 09:00:49 joergr
294
* Added/Changed comments.
295
*
296
* Revision 1.1 1999/02/08 12:00:41 joergr
297
* Added class to handle console applications (with or w/o command line
298
* arguments).
299
*
300
*
301
*/
Generated on Thu Dec 20 2012 for
OFFIS DCMTK
Version 3.6.0 by
Doxygen
1.8.2