http_request_handler.hpp
Go to the documentation of this file.
1 #ifndef CPP_WEB_SERVER_HTTP_REQUEST_HANDLER_HPP
2 #define CPP_WEB_SERVER_HTTP_REQUEST_HANDLER_HPP
3 
5 
6 #include <boost/function.hpp>
7 #include <boost/shared_ptr.hpp>
8 
9 namespace async_web_server_cpp
10 {
11 
13 
20 typedef boost::function<bool(const HttpRequest&,
21  boost::shared_ptr<HttpConnection>,
22  const char* begin, const char* end)>
24 
31 {
32 public:
33  typedef boost::function<bool(const HttpRequest&)> HandlerPredicate;
34 
36 
37  void addHandlerForPath(const std::string& path_regex,
38  HttpServerRequestHandler handler);
39 
40  void addHandler(HandlerPredicate predicate,
41  HttpServerRequestHandler handler);
42 
43  bool operator()(const HttpRequest& request,
44  boost::shared_ptr<HttpConnection> connection,
45  const char* begin, const char* end);
46 
47 private:
49  std::vector<std::pair<HandlerPredicate, HttpServerRequestHandler>>
51 };
52 
54 {
55 public:
56  typedef boost::function<void(const HttpRequest&,
57  boost::shared_ptr<HttpConnection>,
58  const std::string& body)>
60 
62 
63  bool operator()(const HttpRequest& request,
64  boost::shared_ptr<HttpConnection> connection,
65  const char* begin, const char* end);
66 
67 private:
69 };
70 
71 } // namespace async_web_server_cpp
72 
73 #endif
async_web_server_cpp::HttpRequestBodyCollector::HttpRequestBodyCollector
HttpRequestBodyCollector(Handler handler)
Definition: http_request_handler.cpp:135
async_web_server_cpp::HttpRequestHandlerGroup::operator()
bool operator()(const HttpRequest &request, boost::shared_ptr< HttpConnection > connection, const char *begin, const char *end)
Definition: http_request_handler.cpp:55
async_web_server_cpp::HttpServerRequestHandler
boost::function< bool(const HttpRequest &, boost::shared_ptr< HttpConnection >, const char *begin, const char *end)> HttpServerRequestHandler
Definition: http_request_handler.hpp:12
async_web_server_cpp::HttpRequestHandlerGroup
Definition: http_request_handler.hpp:30
async_web_server_cpp::HttpRequestHandlerGroup::HandlerPredicate
boost::function< bool(const HttpRequest &)> HandlerPredicate
Definition: http_request_handler.hpp:33
async_web_server_cpp::HttpConnection
Definition: http_connection.hpp:34
async_web_server_cpp::HttpRequestHandlerGroup::addHandler
void addHandler(HandlerPredicate predicate, HttpServerRequestHandler handler)
Definition: http_request_handler.cpp:49
async_web_server_cpp
Definition: http_connection.hpp:14
async_web_server_cpp::HttpRequestHandlerGroup::HttpRequestHandlerGroup
HttpRequestHandlerGroup(HttpServerRequestHandler default_handler)
Definition: http_request_handler.cpp:20
async_web_server_cpp::HttpRequest
Definition: http_request.hpp:18
async_web_server_cpp::HttpRequestHandlerGroup::handlers_
std::vector< std::pair< HandlerPredicate, HttpServerRequestHandler > > handlers_
Definition: http_request_handler.hpp:50
async_web_server_cpp::HttpRequestHandlerGroup::default_handler_
HttpServerRequestHandler default_handler_
Definition: http_request_handler.hpp:48
async_web_server_cpp::HttpRequestBodyCollector::handler_
Handler handler_
Definition: http_request_handler.hpp:68
async_web_server_cpp::HttpRequestHandlerGroup::addHandlerForPath
void addHandlerForPath(const std::string &path_regex, HttpServerRequestHandler handler)
Definition: http_request_handler.cpp:43
async_web_server_cpp::HttpRequestBodyCollector::Handler
boost::function< void(const HttpRequest &, boost::shared_ptr< HttpConnection >, const std::string &body)> Handler
Definition: http_request_handler.hpp:59
async_web_server_cpp::HttpRequestBodyCollector
Definition: http_request_handler.hpp:53
http_request.hpp
async_web_server_cpp::HttpRequestBodyCollector::operator()
bool operator()(const HttpRequest &request, boost::shared_ptr< HttpConnection > connection, const char *begin, const char *end)
Definition: http_request_handler.cpp:140


async_web_server_cpp
Author(s): Mitchell Wills , Russel Toris
autogenerated on Tue Mar 1 2022 23:49:06