17 #include <QtCore/QString> 18 #include <QtCore/QCoreApplication> 19 #include <QtCore/QHash> 20 #include <QtCore/QSet> 21 #include <QtCore/QStringList> 44 void addOption(
const QString &shortName,
const QString &longName,
const QString &description);
48 void addFlag(
const QString &shortName,
const QString &longName,
const QString &description);
52 bool process(
const QCoreApplication &app);
61 bool isSet(
const QString &optionShortName)
const;
64 QString
value(
const QString &optionShortName)
const;
67 QString mApplicationName;
68 QString mApplicationVersion;
69 QString mApplicationDescription;
70 QStringList mPositionalArgNames;
71 QStringList mPositionalArgDescriptions;
72 QStringList mPositionalArgValues;
73 QHash<QString, QString> mOptionDescriptions;
74 QHash<QString, QString> mOptionLongNames;
75 QHash<QString, QString> mOptionValues;
76 QHash<QString, QString> mFlagDescriptions;
77 QHash<QString, QString> mFlagLongNames;
78 QSet<QString> mSetFlags;
Definition: analogSensor.h:23
bool isSet(const QString &optionShortName) const
Returns true, if option or flag appeared in command line.
Definition: commandLineParser.cpp:146
void showHelp() const
Shows application info and descriptions of all command line arguments.
Definition: commandLineParser.cpp:101
void addPositionalArgument(const QString &name, const QString &description)
Adds new positional argument with its description.
Definition: commandLineParser.cpp:26
QString value(const QString &optionShortName) const
Returns value of an option or an empty string if it is not set.
Definition: commandLineParser.cpp:151
bool process(const QCoreApplication &app)
Parse command line arguments of given application.
Definition: commandLineParser.cpp:44
void addOption(const QString &shortName, const QString &longName, const QString &description)
Add new option with short and long forms and descriptions.
Definition: commandLineParser.cpp:32
QStringList positionalArgs() const
Returns a list of positional arguments in order in which they appeared in command line...
Definition: commandLineParser.cpp:141
Parser of command-line parameters.
Definition: commandLineParser.h:33
void addFlag(const QString &shortName, const QString &longName, const QString &description)
Add new flag with short and long forms and descriptions.
Definition: commandLineParser.cpp:38
void addApplicationDescription(const QString &description)
Adds application description string.
Definition: commandLineParser.cpp:21