Hobrasoft httpd server
Embedded HTTP server for Qt and C++
staticfilecontroller.h
Go to the documentation of this file.
1 
8 #ifndef _StaticFileController_H_
9 #define _StaticFileController_H_
10 
11 #include <QObject>
12 #include <QCache>
13 #include <QHash>
14 #include <QDateTime>
15 #include "httprequesthandler.h"
16 #include "testsettings.h"
17 
18 namespace HobrasoftHttpd {
19 
20 class HttpRequest;
21 class HttpResponse;
22 class HttpConnection;
23 class HttpSettings;
24 
25 
34  FRIEND_CLASS_TEST;
35  Q_OBJECT
36  public:
37 
44 
48  void service(HttpRequest *request, HttpResponse *response);
49 
55  void addMimeType(const QString& fileSuffix, const QString& mimetype);
56 
57  static QString toGMTString(const QDateTime&);
58 
59 
60  private:
64  const HttpSettings *settings() const;
65 
66  #ifndef DOXYGEN_SHOULD_SKIP_THIS
67  static QHash<QString, QString> m_mimetypes;
68  HttpConnection *m_parent;
69  #endif
70 
71 };
72 
73 }
74 
75 #endif
HttpResponse * response()
Returns new instance of HttpResponse class.
StaticFileController(HttpConnection *parent)
Constructor set default parameters from configuration.
void addMimeType(const QString &fileSuffix, const QString &mimetype)
Adds mime type to static table of mime types (common for all class instances)
const HttpSettings * settings() const
Returs pointer to HttpSettings used in the HttpServer.
Response to HTTP request - headers, cookies and body.
Definition: httpresponse.h:30
void service(HttpRequest *request, HttpResponse *response)
Processes the request.
Configuration of the http server instance.
Definition: httpsettings.h:39
Processes incoming requests.
Processes HTTP request, parses headers, body and files sent by HTTP protocol.
Definition: httprequest.h:23
Processes request for static files.
Namespace of HTTP server.
One single connection to http server.