4 #ifndef BPSCMDLINEPARSER_H
5 #define BPSCMDLINEPARSER_H
11 #include <QStringList>
Public include file for BPS CORE library macros.
#define BPSCORE_EXPORT
Declare class to be an import from the shared library.
Definition: bpscore_global.h:22
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
A parser for command line arguments.
Definition: bpscmdlineparser.h:98
QString program() const
Query the invoked program after parsing the arguments.
QString mandatory(const QString &aParam) const
Query a mandatory parameter after parsing the arguments.
QString optional(const QString &aParam) const
Query an optional single parameter after parsing the arguments.
BpsCmdlineParser & parse()
Parses the command line.
BpsCmdlineParser & addOptional(const QString &aParam)
Add a single optional parameter.
BpsCmdlineParser(QObject *aParent=nullptr)
Default constructor for the BpsCmdlineParser class.
BpsCmdlineParser & addOptions(QChar aKey, const QString &aName, const QString &aParam, const QString &aInfo)
Adds a option that can occure multiple times with either a single character key and / or a key name.
BpsCmdlineParser & addHelpSwitch(QChar aKey, const QString &aName, const QString &aInfo)
Adds a help-type switch with either a single character key and / or a key name.
BpsCmdlineParser & addOptionals(const QString &aParam)
Add a multiple optional parameter.
BpsCmdlineParser & setProgram(const QString &aName)
Set the program name used by the help() funcion.
bool switchState(QChar aKey, const QString &aName=QString()) const
Query a switch after parsing the arguments.
BpsCmdlineParser & addSwitch(QChar aKey, const QString &aName, const QString &aInfo)
Adds a switch with either a single character key and / or a key name.
BpsCmdlineParser & addMandatory(const QString &aParam)
Add a mandatory parameter.
QStringList optionals() const
Query the multiple optional parameter after parsing the arguments.
QString option(QChar aKey, const QString &aName=QString()) const
Query an option value after parsing the arguments.
BpsCmdlineParser & setDescription(const QString &aDescription)
Set the description what the program is supposed to do.
QStringList options(QChar aKey, const QString &aName=QString()) const
Query options values after parsing the arguments.
QString help(int aWidth=79) const
Formats a help message for the command line parser.
BpsCmdlineParser & addOption(QChar aKey, const QString &aName, const QString &aParam, const QString &aInfo)
Adds a option with either a single character key and / or a key name.