OSSIA
Open Scenario System for Interactive Application
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
websocket_reply.hpp
1#pragma once
2#include <ossia/detail/json.hpp>
3
4namespace ossia::net
5{
6
7struct server_reply
8{
9 server_reply() = default;
10 server_reply(const rapidjson::StringBuffer& str)
11 : type{data_type::json}
12 , data{str.GetString(), str.GetSize()}
13 {
14 }
15 server_reply(std::string&& str)
16 : type{data_type::html}
17 , data{std::move(str)}
18 {
19 }
20 enum class data_type
21 {
22 json,
23 html,
24 binary
25 } type;
26 std::string data;
27};
28}