hyperion.ng/libsrc/webserver/StaticFileServing.h
Paulchen-Panther 2a77f6f012
even more changes
Signed-off-by: Paulchen-Panther <Paulchen--Panter@gmx.net>
2018-12-28 18:28:49 +01:00

39 lines
806 B
C++

#ifndef STATICFILESERVING_H
#define STATICFILESERVING_H
// locales includes
#include "CgiHandler.h"
// qt includes
#include <QMimeDatabase>
#include "QtHttpRequest.h"
#include "QtHttpReply.h"
#include "QtHttpHeader.h"
//utils includes
#include <utils/Logger.h>
class StaticFileServing : public QObject {
Q_OBJECT
public:
explicit StaticFileServing (QObject * parent = nullptr);
virtual ~StaticFileServing (void);
void setBaseUrl(const QString& url);
public slots:
void onRequestNeedsReply (QtHttpRequest * request, QtHttpReply * reply);
private:
QString _baseUrl;
QMimeDatabase * _mimeDb;
CgiHandler _cgi;
Logger * _log;
void printErrorToReply (QtHttpReply * reply, QtHttpReply::StatusCode code, QString errorMessage);
};
#endif // STATICFILESERVING_H