osrm-backend/include/server/http/reply.hpp

39 lines
789 B
C++
Raw Normal View History

#ifndef REPLY_HPP
#define REPLY_HPP
2016-01-02 11:13:44 -05:00
#include "server/http/header.hpp"
#include <boost/asio.hpp>
#include <vector>
2013-12-16 05:29:38 -05:00
2014-05-11 12:03:05 -04:00
namespace http
{
class reply
{
2014-05-11 12:03:05 -04:00
public:
enum status_type
{
ok = 200,
bad_request = 400,
internal_server_error = 500
} status;
2013-12-13 17:26:57 -05:00
std::vector<header> headers;
std::vector<boost::asio::const_buffer> to_buffers();
std::vector<boost::asio::const_buffer> headers_to_buffers();
std::vector<char> content;
static reply stock_reply(const status_type status);
void set_size(const std::size_t size);
void set_uncompressed_size();
2013-12-13 17:26:57 -05:00
reply();
2013-12-13 17:26:57 -05:00
2014-05-11 12:03:05 -04:00
private:
std::string status_to_string(reply::status_type status);
boost::asio::const_buffer status_to_buffer(reply::status_type status);
};
}
#endif // REPLY_HPP