looqs/cli/command.h

40 rivejä
698 B
C

#ifndef COMMAND_H
#define COMMAND_H
#include <QStringList>
#include <QThreadStorage>
#include <QVariant>
2022-04-14 15:03:19 +02:00
#include <QMutex>
#include <QWaitCondition>
#include "utils.h"
#include "sqlitedbservice.h"
2022-04-14 15:03:19 +02:00
class Command : public QObject
{
2022-04-14 15:03:19 +02:00
Q_OBJECT
signals:
void finishedCmd(int retval);
protected:
SqliteDbService *dbService;
QString dbConnectionString;
2022-04-14 15:03:19 +02:00
QStringList arguments;
bool autoFinish = true;
public:
Command(SqliteDbService &dbService)
{
this->dbService = &dbService;
}
2022-04-14 15:03:19 +02:00
void setArguments(QStringList arguments)
{
this->arguments = arguments;
}
virtual int handle(QStringList arguments) = 0;
virtual ~Command(){};
2022-04-14 15:03:19 +02:00
public slots:
void execute();
};
#endif // COMMAND_H