MACE
1.0.0
|
00001 // 00002 // file_handler.hpp 00003 // ~~~~~~~~~~~~~~~~ 00004 // 00005 // Copyright (c) 2003-2012 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 MACE_RPC_HTTP_FILE_HANDLER_HPP 00012 #define MACE_RPC_HTTP_FILE_HANDLER_HPP 00013 00014 #include <mace/rpc/http/request.hpp> 00015 #include <mace/rpc/http/reply.hpp> 00016 #include <string> 00017 00018 namespace mace { namespace rpc { namespace http { 00019 00020 struct reply; 00021 struct request; 00022 00024 class file_handler 00025 { 00026 public: 00028 explicit file_handler(const std::string& doc_root); 00029 00031 bool operator()(const request& req, const std::string& path, reply& rep); 00032 00033 private: 00035 std::string doc_root_; 00036 00037 }; 00040 bool url_decode(const std::string& in, std::string& out); 00041 00042 } } } // boost::rpc::http 00043 00044 #endif // MACE_RPC_HTTP_FILE_HANDLER_HPP