Hobrasoft httpd server
Embedded HTTP server for Qt and C++
|
Processes request for static files. More...
#include <staticfilecontroller.h>
Public Member Functions | |
StaticFileController (HttpConnection *parent) | |
Constructor set default parameters from configuration. More... | |
void | service (HttpRequest *request, HttpResponse *response) |
Processes the request. | |
void | addMimeType (const QString &fileSuffix, const QString &mimetype) |
Adds mime type to static table of mime types (common for all class instances) More... | |
Public Member Functions inherited from HobrasoftHttpd::HttpRequestHandler | |
HttpRequestHandler (HttpConnection *parent) | |
Konstruktor. | |
HttpResponse * | response () |
Returns new instance of HttpResponse class. More... | |
Static Public Member Functions | |
static QString | toGMTString (const QDateTime &) |
Private Member Functions | |
const HttpSettings * | settings () const |
Returs pointer to HttpSettings used in the HttpServer. | |
Private Attributes | |
FRIEND_CLASS_TEST | |
Additional Inherited Members | |
Protected Member Functions inherited from HobrasoftHttpd::HttpRequestHandler | |
HttpConnection * | connection () const |
Returns pointer to parent HttpConnection class. | |
const HttpSettings * | settings () const |
Returns pointer to HttpSettings used in the HttpServer. | |
Processes request for static files.
The files can be stored in cache.
Definition at line 33 of file staticfilecontroller.h.
StaticFileController::StaticFileController | ( | HttpConnection * | parent | ) |
Constructor set default parameters from configuration.
The configuration is taken from parent HttpConnection::settings()
Definition at line 26 of file staticfilecontroller.cpp.
void StaticFileController::addMimeType | ( | const QString & | fileSuffix, |
const QString & | mimetype | ||
) |
Adds mime type to static table of mime types (common for all class instances)
These suffixes are recognized by default: png, jpg, jpeg, gif, txt, html, xhtml, htm, css, json, js
Definition at line 52 of file staticfilecontroller.cpp.