10Duke Scale C++ Client
Loading...
Searching...
No Matches
HTTPResponse.h
1#ifndef TENDUKE_HTTP_SERVER_HTTPRESPONSE_H
2#define TENDUKE_HTTP_SERVER_HTTPRESPONSE_H
3
4#include "osa/Socket.h"
5
6#include <memory>
7#include <string>
8
9namespace tenduke { namespace http { namespace server {
10
15{
16public:
21 explicit HTTPResponse(const std::shared_ptr<tenduke::osa::Socket> &socket)
22 : socket(socket)
23 {}
24
29 void write(const std::string &string)
30 {
31 socket->write(string.c_str(), string.length());
32 }
33
34private:
35 const std::shared_ptr<tenduke::osa::Socket> socket;
36};
37
38}}}
39
40#endif //TENDUKE_HTTP_SERVER_HTTPRESPONSE_H
HTTP-response to be returned by a HTTP server.
Definition HTTPResponse.h:15
HTTPResponse(const std::shared_ptr< tenduke::osa::Socket > &socket)
Constructs new instance.
Definition HTTPResponse.h:21
void write(const std::string &string)
Writes following string as response.
Definition HTTPResponse.h:29
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7