Files
cantata/web/http/staticfilecontroller.h
Craig Drummond 605af484f7 Initial import of *VERY* incomplete, and not fully functional Cantata
webapp. Mainly used to test SQLite backend for storing MPD db.
2015-06-01 22:57:49 +01:00

40 lines
889 B
C++

/**
* @file
*
* @author Stefan Frings
* @author Petr Bravenec petr.bravenec@hobrasoft.cz
* @author Craig Drummond
*/
#ifndef STATIC_FILE_CONTROLLER_H
#define STATIC_FILE_CONTROLLER_H
//#include <QCache>
#include "httprequesthandler.h"
class HttpRequest;
class HttpResponse;
class HttpServer;
class QSettings;
class StaticFileController : public HttpRequestHandler
{
public:
StaticFileController(const QSettings *settings);
HandleStatus handle(HttpRequest *request, HttpResponse *response);
static void addMimeType(const QByteArray &extension, const QByteArray &mimetype);
static QByteArray mimeType(const QByteArray &extension);
static void setContentType(const QString &ext, HttpResponse *response);
//private:
// struct CacheEntry {
// QByteArray document;
// qint64 created;
// };
// QCache<QString, CacheEntry> cache;
};
#endif