Hobrasoft httpd server
Embedded HTTP server for Qt and C++
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
HobrasoftHttpd::StaticFileController Class Reference

Processes request for static files. More...

#include <staticfilecontroller.h>

Inheritance diagram for HobrasoftHttpd::StaticFileController:
HobrasoftHttpd::HttpRequestHandler

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.
 
HttpResponseresponse ()
 Returns new instance of HttpResponse class. More...
 

Static Public Member Functions

static QString toGMTString (const QDateTime &)
 

Private Member Functions

const HttpSettingssettings () const
 Returs pointer to HttpSettings used in the HttpServer.
 

Private Attributes

 FRIEND_CLASS_TEST
 

Additional Inherited Members

- Protected Member Functions inherited from HobrasoftHttpd::HttpRequestHandler
HttpConnectionconnection () const
 Returns pointer to parent HttpConnection class.
 
const HttpSettingssettings () const
 Returns pointer to HttpSettings used in the HttpServer.
 

Detailed Description

Processes request for static files.

The files can be stored in cache.

See also
HttpSettings

Definition at line 33 of file staticfilecontroller.h.

Constructor & Destructor Documentation

◆ StaticFileController()

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.

Member Function Documentation

◆ addMimeType()

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.


The documentation for this class was generated from the following files: