23 #ifndef TUFAO_HTTPSERVERREQUESTROUTER_H
24 #define TUFAO_HTTPSERVERREQUESTROUTER_H
27 #include <initializer_list>
29 #include <QtCore/QRegularExpression>
30 #include <QtCore/QObject>
32 #include "abstracthttpserverrequesthandler.h"
75 typedef std::function<bool(HttpServerRequest&, HttpServerResponse&)>
99 path(path), handler(handler)
106 path(path), method(method), handler(handler)
143 QObject *parent = 0);
170 int map(std::initializer_list<Mapping> map);
178 void unmap(
int index);
229 #endif // TUFAO_HTTPSERVERREQUESTROUTER_H
This class provides an interface for HttpServerRequest handlers.
Definition: abstracthttpserverrequesthandler.h:50
The Tufao::HttpServerResponse is used to respond to a Tufao::HttpServerRequest.
Definition: httpserverresponse.h:142
QRegularExpression path
This attribute is used to filter requests based on the url's path component.
Definition: httpserverrequestrouter.h:118
This class provides a robust and high performance HTTP request router.
Definition: httpserverrequestrouter.h:63
The Tufao::HttpServer represents a HTTP request received by Tufao::HttpServer.
Definition: httpserverrequest.h:54
QByteArray method
This attribute is used to filter requests based on the HTTP method.
Definition: httpserverrequestrouter.h:127
Mapping(QRegularExpression path, QByteArray method, Handler handler)
Constructs a Mapping object using path and method as filters and handler as handler.
Definition: httpserverrequestrouter.h:105
This is the namespace where all Tufão facilities are grouped.
Definition: abstracthttpserverrequesthandler.h:30
This class describes a request handler and a filter.
Definition: httpserverrequestrouter.h:92
std::function< bool(HttpServerRequest &, HttpServerResponse &)> Handler
It's a simple typedef for the type of handler accepted by the HttpServerRequestRouter.
Definition: httpserverrequestrouter.h:76
Mapping(QRegularExpression path, Handler handler)
Constructs a Mapping object using path as filter and handler as handler.
Definition: httpserverrequestrouter.h:98