Realistic 3D camera system
3D camera system components
request_handler.hpp
Go to the documentation of this file.
1 //
2 // request_handler.hpp
3 // ~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef HTTP_REQUEST_HANDLER_HPP
12 #define HTTP_REQUEST_HANDLER_HPP
13 
14 #include <string>
15 
16 namespace http {
17 namespace server {
18 
19 struct reply;
20 struct request;
21 
23 class request_handler
24 {
25 public:
26  request_handler(const request_handler&) = delete;
27  request_handler& operator=(const request_handler&) = delete;
28 
30  explicit request_handler(const std::string& doc_root);
31 
33  void handle_request(const request& req, reply& rep);
34 
35 private:
37  std::string doc_root_;
38 
41  static bool url_decode(const std::string& in, std::string& out);
42 };
43 
44 } // namespace server
45 } // namespace http
46 
47 #endif // HTTP_REQUEST_HANDLER_HPP
void handle_request(const request &req, reply &rep)
Handle a request and produce a reply.
request_handler(const std::string &doc_root)
Construct with a directory containing files to be served.
request_handler & operator=(const request_handler &)=delete