Public Member Functions | |
| OFConsoleApplication (const char *app, const char *desc=NULL, const char *rcsid=NULL) | |
| constructor | |
| ~OFConsoleApplication () | |
| destructor | |
| OFBool | parseCommandLine (OFCommandLine &cmd, int argCount, char *argValue[], const int flags=0, const int startPos=1) |
| parse command line. | |
| void | printHeader (const OFBool hostInfo=OFFalse, const OFBool stdError=OFFalse) |
| print header of console application (consisting of identifier, name and description) | |
| void | printUsage (const OFCommandLine *cmd=NULL) |
| print usage (syntax of command line options) to standard output stream | |
| void | printError (const char *str, const int code=1) |
| print error message (incl. | |
| void | printWarning (const char *str, const char *prefix="warning") |
| print warning message (w/o header) to standard error stream | |
| void | printMessage (const char *str) |
| print message (w/o header) to standard error stream. | |
| OFBool | quietMode () const |
| check quiet mode | |
| void | setQuietMode (const OFBool mode=OFTrue) |
| switch on/off quiet mode | |
| void | checkValue (const OFCommandLine::E_ValueStatus status, OFCommandLine *cmd=NULL) |
| check value status and print error message if necessary | |
| void | checkParam (const OFCommandLine::E_ParamValueStatus status, OFCommandLine *cmd=NULL) |
| check parameter status and print error message if necessary | |
| void | checkDependence (const char *subOpt, const char *baseOpt, OFBool condition) |
| check dependence between sub and base option and report an error if required. | |
| void | checkConflict (const char *firstOpt, const char *secondOpt, OFBool condition) |
| check conflict between two options and report an error if required. | |
Private Member Functions | |
| OFConsoleApplication (const OFConsoleApplication &) | |
| OFConsoleApplication & | operator= (const OFConsoleApplication &) |
Private Attributes | |
| OFString | Name |
| Name of the application (short form). | |
| OFString | Description |
| Short description of the application. | |
| OFString | Identification |
| Identification string (rcsid). | |
| OFBool | QuietMode |
| Switch on/off error and warning messages. | |
| OFCommandLine * | CmdLine |
| Pointer to associated CommandLine class. | |
Builds an envelope for the OFCommandLine class to provide a consistent behaviour for all DCMTK console applications. Performs console output operations and error checking.
Definition at line 53 of file ofconapp.h.
|
||||||||||||||||
|
constructor
|
|
||||||||||||||||
|
check conflict between two options and report an error if required. Message format: "error: " + firstOpt + " not allowed with " + secondOpt
|
|
||||||||||||||||
|
check dependence between sub and base option and report an error if required. Message format: "error: " + subOpt + " only allowed with " + baseOpt
|
|
||||||||||||
|
check parameter status and print error message if necessary
|
|
||||||||||||
|
check value status and print error message if necessary
|
|
||||||||||||||||||||||||
|
parse command line. If the command line has no argument (in case at least one argument is required) and if the command line has only one argument, namely "--help" or the specified shortcut, (in all cases) the usage is printed (see printUsage).
|
|
||||||||||||
|
print error message (incl. header) to standard error stream and exit with error code
|
|
||||||||||||
|
print header of console application (consisting of identifier, name and description)
|
|
|
print message (w/o header) to standard error stream.
|
|
|
print usage (syntax of command line options) to standard output stream
|
|
||||||||||||
|
print warning message (w/o header) to standard error stream
|
|
|
check quiet mode
|
|
|
switch on/off quiet mode
|