1 #ifndef CPP_WEB_SERVER_HTTP_REQUEST_HANDLER_HPP 2 #define CPP_WEB_SERVER_HTTP_REQUEST_HANDLER_HPP 6 #include <boost/function.hpp> 7 #include <boost/shared_ptr.hpp> 21 boost::shared_ptr<HttpConnection>,
22 const char* begin,
const char* end)>
38 HttpServerRequestHandler handler);
41 HttpServerRequestHandler handler);
44 boost::shared_ptr<HttpConnection> connection,
45 const char* begin,
const char* end);
49 std::vector<std::pair<HandlerPredicate, HttpServerRequestHandler>>
57 boost::shared_ptr<HttpConnection>,
58 const std::string& body)>
64 boost::shared_ptr<HttpConnection> connection,
65 const char* begin,
const char* end);
void addHandler(HandlerPredicate predicate, HttpServerRequestHandler handler)
boost::function< bool(const HttpRequest &)> HandlerPredicate
bool operator()(const HttpRequest &request, boost::shared_ptr< HttpConnection > connection, const char *begin, const char *end)
HttpServerRequestHandler default_handler_
boost::function< void(const HttpRequest &, boost::shared_ptr< HttpConnection >, const std::string &body)> Handler
std::vector< std::pair< HandlerPredicate, HttpServerRequestHandler > > handlers_
HttpRequestHandlerGroup(HttpServerRequestHandler default_handler)
boost::function< bool(const HttpRequest &, boost::shared_ptr< HttpConnection >, const char *begin, const char *end)> HttpServerRequestHandler
void addHandlerForPath(const std::string &path_regex, HttpServerRequestHandler handler)