33 #include "dcmtk/config/osconfig.h"
35 #include "dcmtk/ofstd/oftypes.h"
36 #include "dcmtk/ofstd/ofcmdln.h"
37 #include "dcmtk/ofstd/ofstring.h"
61 const char *desc = NULL,
62 const char *rcsid = NULL);
85 const int startPos = 1);
93 const OFBool stdError = OFFalse);
125 const char *prefix =
"warning");
180 const char *secondOpt,
void printMessage(const char *str)
print message (w/o header) to standard error stream.
void setQuietMode(const OFBool mode=OFTrue)
switch on/off quiet mode
OFCommandLine * CmdLine
Pointer to associated CommandLine class.
void checkValue(const OFCommandLine::E_ValueStatus status, OFCommandLine *cmd=NULL)
check value status and print error message if necessary
support class for console applications.
OFString Identification
Identification string (rcsid)
void checkConflict(const char *firstOpt, const char *secondOpt, OFBool condition)
check conflict between two options and report an error if required.
OFBool QuietMode
Switch on/off error and warning messages.
void checkDependence(const char *subOpt, const char *baseOpt, OFBool condition)
check dependence between sub and base option and report an error if required.
void printHeader(const OFBool hostInfo=OFFalse, const OFBool stdError=OFFalse)
print header of console application (consisting of identifier, name and description) ...
OFConsoleApplication(const char *app, const char *desc=NULL, const char *rcsid=NULL)
constructor
OFString Description
Short description of the application.
OFString Name
Name of the application (short form)
void printArguments(OFCommandLine *cmd=NULL)
print expanded command line arguments to standard error stream
void printWarning(const char *str, const char *prefix="warning")
print warning message (w/o header) to standard error stream
OFBool parseCommandLine(OFCommandLine &cmd, int argCount, char *argValue[], const int flags=0, const int startPos=1)
parse command line.
OFBool quietMode() const
check quiet mode
void checkParam(const OFCommandLine::E_ParamValueStatus status, OFCommandLine *cmd=NULL)
check parameter status and print error message if necessary
E_ValueStatus
status of converting string option value to value field
~OFConsoleApplication()
destructor
void printUsage(const OFCommandLine *cmd=NULL)
print usage (syntax of command line options) to standard output stream
void printIdentifier()
print resource identifier to standard error stream
a simple string class that implements a subset of std::string.
E_ParamValueStatus
status of converting string parameter to value field
void printError(const char *str, const int code=1)
print error message (incl.
handles command line arguments.