2016-06-14 20:14:06 +02:00
|
|
|
#ifndef CGIHANDLER_H
|
|
|
|
#define CGIHANDLER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
#include <hyperion/Hyperion.h>
|
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:
|
2016-09-03 15:54:33 +02:00
|
|
|
CgiHandler (Hyperion * hyperion, QString baseUrl, QObject * parent = NULL);
|
2016-06-14 20:14:06 +02:00
|
|
|
virtual ~CgiHandler (void);
|
|
|
|
|
2016-06-19 00:56:47 +02:00
|
|
|
void exec(const QStringList & args,QtHttpRequest * request, QtHttpReply * reply);
|
2016-06-14 20:14:06 +02:00
|
|
|
|
|
|
|
// cgi commands
|
2017-01-14 19:04:58 +01:00
|
|
|
void cmd_cfg_jsonserver();
|
|
|
|
void cmd_cfg_get ();
|
|
|
|
void cmd_cfg_set ();
|
|
|
|
void cmd_runscript ();
|
2016-06-14 20:14:06 +02:00
|
|
|
|
|
|
|
private:
|
2017-01-29 21:20:12 +01:00
|
|
|
Hyperion* _hyperion;
|
|
|
|
QtHttpReply * _reply;
|
|
|
|
QtHttpRequest * _request;
|
|
|
|
QStringList _args;
|
|
|
|
const QJsonObject & _hyperionConfig;
|
|
|
|
const QString _baseUrl;
|
|
|
|
Logger * _log;
|
2016-06-14 20:14:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CGIHANDLER_H
|
|
|
|
|
|
|
|
|