mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
bfb9a08c80
* 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
44 lines
960 B
C++
44 lines
960 B
C++
#include "commandline/Option.h"
|
|
#include "commandline/Parser.h"
|
|
|
|
using namespace commandline;
|
|
|
|
Option::Option(const QString &name, const QString &description, const QString &valueName, const QString &defaultValue)
|
|
: QCommandLineOption(name, description, valueName, defaultValue)
|
|
{}
|
|
|
|
Option::Option(const QStringList &names, const QString &description, const QString &valueName, const QString &defaultValue)
|
|
: QCommandLineOption(names, description, valueName, defaultValue)
|
|
{}
|
|
|
|
|
|
bool Option::validate(Parser & parser, QString &value)
|
|
{
|
|
/* By default everything is accepted */
|
|
return true;
|
|
}
|
|
|
|
Option::Option(const QCommandLineOption &other)
|
|
: QCommandLineOption(other)
|
|
{}
|
|
|
|
QString Option::value(Parser &parser)
|
|
{
|
|
return parser.value(*this);
|
|
}
|
|
|
|
QString Option::name()
|
|
{
|
|
return this->names().last();
|
|
}
|
|
|
|
QString Option::getError()
|
|
{
|
|
return this->_error;
|
|
}
|
|
|
|
const char* Option::getCString(Parser &parser)
|
|
{
|
|
return value(parser).toLocal8Bit().constData();
|
|
}
|