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
|
|
|
|
|
|
|
class CgiHandler : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-12-28 18:12:45 +01:00
|
|
|
CgiHandler (QObject * parent = NULL);
|
2016-06-14 20:14:06 +02:00
|
|
|
|
2018-12-27 23:11:32 +01:00
|
|
|
void setBaseUrl(const QString& url);
|
2016-06-19 00:56:47 +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();
|
|
|
|
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
|