SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
httpserver
staticfilecontroller.h
Go to the documentation of this file.
1
6
#ifndef STATICFILECONTROLLER_H
7
#define STATICFILECONTROLLER_H
8
9
#include <QCache>
10
#include <QMutex>
11
#include "
httpglobal.h
"
12
#include "
httprequest.h
"
13
#include "
httpresponse.h
"
14
#include "
httprequesthandler.h
"
15
16
#include "
export.h
"
17
18
namespace
qtwebapp
{
19
47
class
HttpDocrootSettings;
48
49
class
HTTPSERVER_API
StaticFileController
:
public
HttpRequestHandler
{
50
Q_OBJECT
51
Q_DISABLE_COPY(
StaticFileController
)
52
public
:
53
55
StaticFileController
(QSettings* settings, QObject* parent = NULL);
56
58
StaticFileController
(
const
HttpDocrootSettings
& settings, QObject* parent = NULL);
59
61
void
service(
HttpRequest
& request,
HttpResponse
& response);
62
64
void
service(QByteArray& path,
HttpResponse
& response);
65
66
private
:
67
69
QString
encoding
;
70
72
QString
docroot
;
73
75
int
maxAge
;
76
77
struct
CacheEntry
{
78
QByteArray
document
;
79
qint64
created
;
80
QByteArray
filename
;
81
};
82
84
int
cacheTimeout
;
85
87
int
maxCachedFileSize
;
88
90
QCache<QString,CacheEntry>
cache
;
91
93
QMutex
mutex
;
94
96
bool
useQtSettings
;
97
99
void
setContentType(QString file,
HttpResponse
& response)
const
;
100
};
101
102
}
// end of namespace
103
104
#endif // STATICFILECONTROLLER_H
qtwebapp::HttpRequest
Definition:
httprequest.h:41
httprequest.h
qtwebapp::StaticFileController::encoding
QString encoding
Definition:
staticfilecontroller.h:69
qtwebapp::StaticFileController::cache
QCache< QString, CacheEntry > cache
Definition:
staticfilecontroller.h:90
qtwebapp::StaticFileController::CacheEntry::created
qint64 created
Definition:
staticfilecontroller.h:79
qtwebapp::StaticFileController::CacheEntry::filename
QByteArray filename
Definition:
staticfilecontroller.h:80
export.h
qtwebapp::StaticFileController::maxAge
int maxAge
Definition:
staticfilecontroller.h:75
HTTPSERVER_API
#define HTTPSERVER_API
Definition:
export.h:88
qtwebapp::StaticFileController::docroot
QString docroot
Definition:
staticfilecontroller.h:72
qtwebapp::StaticFileController::mutex
QMutex mutex
Definition:
staticfilecontroller.h:93
qtwebapp::HttpRequestHandler
Definition:
httprequesthandler.h:29
httpresponse.h
qtwebapp::StaticFileController::useQtSettings
bool useQtSettings
Definition:
staticfilecontroller.h:96
qtwebapp::StaticFileController
Definition:
staticfilecontroller.h:49
qtwebapp::HttpDocrootSettings
Definition:
httpdocrootsettings.h:15
qtwebapp
Definition:
httpconnectionhandler.h:23
httpglobal.h
qtwebapp::StaticFileController::cacheTimeout
int cacheTimeout
Definition:
staticfilecontroller.h:84
qtwebapp::StaticFileController::CacheEntry
Definition:
staticfilecontroller.h:77
qtwebapp::StaticFileController::maxCachedFileSize
int maxCachedFileSize
Definition:
staticfilecontroller.h:87
qtwebapp::StaticFileController::CacheEntry::document
QByteArray document
Definition:
staticfilecontroller.h:78
httprequesthandler.h
qtwebapp::HttpResponse
Definition:
httpresponse.h:38
Generated on Fri Aug 2 2019 17:56:29 for SDRAngel by
1.8.13