asio 0.3.8rc3 Home | Reference | Tutorial | Examples | Design
Examples

http/server/request_handler.hpp

Go to the documentation of this file.
00001 //
00002 // request_handler.hpp
00003 // ~~~~~~~~~~~~~~~~~~~
00004 //
00005 // Copyright (c) 2003-2007 Christopher M. Kohlhoff (chris at kohlhoff dot com)
00006 //
00007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
00008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
00009 //
00010 
00011 #ifndef HTTP_REQUEST_HANDLER_HPP
00012 #define HTTP_REQUEST_HANDLER_HPP
00013 
00014 #include <string>
00015 #include <boost/noncopyable.hpp>
00016 
00017 namespace http {
00018 namespace server {
00019 
00020 struct reply;
00021 struct request;
00022 
00024 class request_handler
00025   : private boost::noncopyable
00026 {
00027 public:
00029   explicit request_handler(const std::string& doc_root);
00030 
00032   void handle_request(const request& req, reply& rep);
00033 
00034 private:
00036   std::string doc_root_;
00037 
00040   static bool url_decode(const std::string& in, std::string& out);
00041 };
00042 
00043 } // namespace server
00044 } // namespace http
00045 
00046 #endif // HTTP_REQUEST_HANDLER_HPP
asio 0.3.8rc3 Home | Reference | Tutorial | Examples | Design