2016-06-14 20:14:06 +02:00
|
|
|
#ifndef CGIHANDLER_H
|
|
|
|
#define CGIHANDLER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
|
2017-01-29 21:20:12 +01:00
|
|
|
#include <utils/Logger.h>
|
2016-06-14 20:14:06 +02:00
|
|
|
|
|
|
|
#include "QtHttpReply.h"
|
2016-06-19 00:56:47 +02:00
|
|
|
#include "QtHttpRequest.h"
|
2016-06-14 20:14:06 +02:00
|
|
|
|
2020-08-08 23:12:43 +02:00
|
|
|
class CgiHandler : public QObject
|
|
|
|
{
|
2016-06-14 20:14:06 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-08-08 23:12:43 +02:00
|
|
|
CgiHandler(QObject * parent = nullptr);
|
2016-06-14 20:14:06 +02:00
|
|
|
|
2018-12-27 23:11:32 +01:00
|
|
|
void setBaseUrl(const QString& url);
|
2020-08-08 23:12:43 +02:00
|
|
|
void exec(const QStringList & args, QtHttpRequest * request, QtHttpReply * reply);
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2020-07-19 14:44:59 +02:00
|
|
|
private:
|
|
|
|
// CGI commands
|
2017-01-14 19:04:58 +01:00
|
|
|
void cmd_cfg_jsonserver();
|
2020-08-08 23:12:43 +02:00
|
|
|
void cmd_runscript();
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2017-01-29 21:20:12 +01:00
|
|
|
QtHttpReply * _reply;
|
|
|
|
QtHttpRequest * _request;
|
|
|
|
QStringList _args;
|
2018-12-27 23:11:32 +01:00
|
|
|
QString _baseUrl;
|
2017-01-29 21:20:12 +01:00
|
|
|
Logger * _log;
|
2016-06-14 20:14:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CGIHANDLER_H
|