Realistic 3D camera system
3D camera system components
file_handler.hpp
Go to the documentation of this file.
1 //
2 // file_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_SERVER4_FILE_HANDLER_HPP
12 #define HTTP_SERVER4_FILE_HANDLER_HPP
13 
14 #include <string>
15 
16 namespace http {
17 namespace server4 {
18 
19 struct reply;
20 struct request;
21 
24 {
25 public:
27  explicit file_handler(const std::string& doc_root);
28 
30  void operator()(const request& req, reply& rep);
31 
32 private:
34  std::string doc_root_;
35 
38  static bool url_decode(const std::string& in, std::string& out);
39 };
40 
41 } // namespace server4
42 } // namespace http
43 
44 #endif // HTTP_SERVER4_FILE_HANDLER_HPP
void operator()(const request &req, reply &rep)
Handle a request and produce a reply.
A request received from a client.
Definition: request.hpp:22
file_handler(const std::string &doc_root)
Construct with a directory containing files to be served.
The common handler for all incoming requests.
A reply to be sent to a client.
Definition: reply.hpp:23