Hobrasoft httpd server
Embedded HTTP server for Qt and C++
Public Member Functions | Protected Member Functions | Private Slots | List of all members
Example::Httpd::ControllerExample Class Reference

Processes requests with path /example. More...

#include <controllerexample.h>

Inheritance diagram for Example::Httpd::ControllerExample:
Example::Httpd::AbstractController HobrasoftHttpd::HttpRequestHandler

Public Member Functions

 ControllerExample (HobrasoftHttpd::HttpConnection *parent)
- Public Member Functions inherited from Example::Httpd::AbstractController
 AbstractController (HobrasoftHttpd::HttpConnection *parent)
virtual void service (HobrasoftHttpd::HttpRequest *request, HobrasoftHttpd::HttpResponse *response)
 Request processing.
void setCheckId (bool x)
 If the checkId is set then the exixtence of the item is checked in requests PUT and POST.
bool checkId () const
 Returns the state of checkId. More...
- Public Member Functions inherited from HobrasoftHttpd::HttpRequestHandler
 HttpRequestHandler (HttpConnection *parent)
HttpResponseresponse ()
 Returns new instance of HttpResponse class. More...

Protected Member Functions

virtual bool exists (const QString &id) const
 Check existence of th ID. More...
virtual void serviceList (HobrasoftHttpd::HttpRequest *request, HobrasoftHttpd::HttpResponse *response)
virtual void serviceEvents (HobrasoftHttpd::HttpRequest *request, HobrasoftHttpd::HttpResponse *response)
virtual void serviceIdEvents (HobrasoftHttpd::HttpRequest *request, HobrasoftHttpd::HttpResponse *response, const QString &id)
virtual void serviceIdGet (HobrasoftHttpd::HttpRequest *request, HobrasoftHttpd::HttpResponse *response, const QString &id)
- Protected Member Functions inherited from Example::Httpd::AbstractController
virtual void serviceOK (HobrasoftHttpd::HttpRequest *request, HobrasoftHttpd::HttpResponse *response, const QVariant &data=QVariant())
 Sends 200 OK response. More...
- 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.

Private Slots

void sendUpdate (const Item *)
 Sends data of the item to the event stream.

Detailed Description

Processes requests with path /example.

Definition at line 22 of file controllerexample.h.

Member Function Documentation

◆ exists()

bool ControllerExample::exists ( const QString &  id) const

Check existence of th ID.

true if the ID exists

The method should be reimplemented in derived classes. Depending of the result the decission is made if the 404 error is sent to the request, of if the reimplemented method will be called (one of serviceId(), serviceIdEvents(), serviceIdDelete()).

Reimplemented from Example::Httpd::AbstractController.

Definition at line 24 of file controllerexample.cpp.

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