Commandline arguments utility functions header. More...
#include <qmap.h>#include <qstring.h>Typedefs | |
| typedef void | optHandlerFn () |
| typedef void | optHandlerFnParam (const QString &) |
| typedef optHandlerFn * | optHandler |
| typedef optHandlerFnParam * | optHandlerParam |
Functions | |
| void | handleHelpOptions () |
| void | handleStopOpt () |
| void | optionHandler (const QString ¶m, optHandler h, const QString &help="") |
| void | optionHandlerParam (const QString ¶m, const QString ¶mName, optHandlerParam h, const QString &help="") |
| QStringList | handleParams (int _argc, char **_argv) |
| void | printHeader () |
| void | printHeaderErr () |
Variables | |
| QString | binName |
Commandline arguments utility functions header.
| typedef optHandlerFn* optHandler |
Option handler function pointer
| typedef void optHandlerFn() |
Option handler function
| typedef void optHandlerFnParam(const QString &) |
Option handler function (with parameter)
| typedef optHandlerFnParam* optHandlerParam |
Option handler function pointer (with parameter)
| void handleHelpOptions | ( | ) |
Standard handler to handle --help parameter Prints all registered commandline options along with their helptext to STDOUT and exits
References util::CON, util::convertFromUnicode(), maxParamNameLen, gui::opt, optHelp, and optParamName.
Referenced by handleHelp().
| QStringList handleParams | ( | int | _argc, | |
| char ** | _argv | |||
| ) |
Function to handle commandline parameters using installed callbacks Will terminate program with error message if unknown or invalid commandline options are found
| _argc | count of parameters (standard argc) | |
| _argv | parameters (standard argv) |
References argc, argIndex, argv, binName, util::fatalError(), handleOption(), printHeaderErr(), setArgv0(), and stopOpt.
Referenced by main().
| void handleStopOpt | ( | ) |
| void optionHandler | ( | const QString & | param, | |
| optHandler | h, | |||
| const QString & | help | |||
| ) |
Register function to handle option without parameter
| param | Name of option (case sensitive) | |
| h | Function to handle this option | |
| help | Brief one-line help about this option |
References maxParamNameLen, optHelp, and optMap.
Referenced by main().
| void optionHandlerParam | ( | const QString & | param, | |
| const QString & | paramName, | |||
| optHandlerParam | h, | |||
| const QString & | help | |||
| ) |
Register function to handle option with parameter Parameters can be accepted as: -opt[n], -opt [n]
| param | Name of option (case sensitive) | |
| paramName | Name of parameter (only shown in help) | |
| h | Function to handle this option | |
| help | Brief one-line help about this option |
References maxParamNameLen, optHelp, optMapParam, and optParamName.
Referenced by main().
| void printHeader | ( | ) |
Print out application header (name and version) to stdout
References APP_NAME, and PDFEDIT_VERSION.
Referenced by handleHelp().
| void printHeaderErr | ( | ) |
Print out application header (name and version) to stderr
References APP_NAME, and PDFEDIT_VERSION.
Referenced by handleParams(), main(), and nextParam().
| QString binName |
Name of the program (argv[0]). This variable will be set after running handleParams
Name of the program (argv[0])
Referenced by handleHelp(), handleParams(), nextParam(), and setArgv0().