hyperion.ng/include/commandline/Option.h
redPanther bfb9a08c80 migrate std::string to qstring + add sysinfo via json (#412)
* std::string -> qstring part 1

* more string migration

* more string migration ...

* ...

* more qstring mogrations
add sysinfo via json

* remove unneccessary includes

* integrate sysinfo into webui
2017-03-04 22:17:42 +01:00

42 lines
931 B
C++

#pragma once
#include <QCommandLineOption>
#include <QCommandLineParser>
namespace commandline
{
class Parser;
/* Note, this class and all it's derivatives store the validated results for caching. This means that unlike the
* regular QCommandLineOption it is _not_ idempotent! */
class Option: public QCommandLineOption
{
public:
Option(const QString &name,
const QString &description = QString(),
const QString &valueName = QString::null,
const QString &defaultValue = QString()
);
Option(const QStringList &names,
const QString &description = QString(),
const QString &valueName = QString::null,
const QString &defaultValue = QString()
);
Option(const QCommandLineOption &other);
virtual bool validate(Parser &parser, QString &value);
QString name();
QString getError();
QString value(Parser &parser);
const char* getCString(Parser &parser);
protected:
QString _error;
};
}