MCPcopy Create free account
hub / github.com/boostorg/asio / file_handler

Class file_handler

example/cpp11/http/server4/file_handler.hpp:23–39  ·  view source on GitHub ↗

The common handler for all incoming requests.

Source from the content-addressed store, hash-verified

21
22/// The common handler for all incoming requests.
23class file_handler
24{
25public:
26 /// Construct with a directory containing files to be served.
27 explicit file_handler(const std::string& doc_root);
28
29 /// Handle a request and produce a reply.
30 void operator()(const request& req, reply& rep);
31
32private:
33 /// The directory containing the files to be served.
34 std::string doc_root_;
35
36 /// Perform URL-decoding on a string. Returns false if the encoding was
37 /// invalid.
38 static bool url_decode(const std::string& in, std::string& out);
39};
40
41} // namespace server4
42} // namespace http

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected