42 explicit Message(
const Types& type = Types::Info,
const std::string& content =
"",
const std::string& to =
"ALL",
const std::string& from =
"");
43 explicit Message(
const Types& type,
const Json::Value& content,
const std::string& to =
"ALL",
const std::string& from =
"");
44 void parse(
const std::string&);
45 void setFrom(
const std::string&);
46 void setTo(
const std::string&);
47 void addKey(
const std::string& key,
const std::string& value);
48 void setContent(
const std::string&);
49 void setContent(
const Json::Value&);
50 std::string getFrom();
52 std::string getContent();
53 std::string getContent()
const;
55 std::string
get()
const;
56 std::string getType();
57 std::string getStyled(
const std::string& indent =
"\t");
58 void setType(
const Types&);
60 std::size_t getContentSize();
61 Json::Value getContentAsJson()
const;
62 Json::Value getContentAsJson();
65 Json::Value m_Value{};
68 static Json::StreamWriterBuilder m_StreamWriterBuilder;
69 std::unique_ptr<Json::StreamWriter> m_Writer{
nullptr};
70 std::unique_ptr<Json::CharReader> m_Reader{
nullptr};
71 static Json::CharReaderBuilder m_CharReaderBuilder;
77 Command(
const std::string& content =
"",
const std::string& to =
"ALL",
const std::string& from =
"");
78 std::string getCommand()
const;
79 std::string getCommand();
80 template<
typename T>
void addParameter(
const std::string& name,
const T& value) { m_Value[
"Content"][
"Parameters"][name] = value; }
81 Json::Value getParameter(
const std::string& parameter)
const 83 if(m_Value[
"Content"][
"Parameters"].isMember(parameter))
return m_Value[
"Content"][
"Parameters"][parameter];
85 return Json::Value{
"ERROR"};
92 Critical(
const std::string& content =
"",
const std::string& to =
"ALL",
const std::string& from =
"");
98 Warning(
const std::string& content =
"",
const std::string& to =
"ALL",
const std::string& from =
"");
104 Debug(
const std::string& content =
"",
const std::string& to =
"ALL",
const std::string& from =
"");
110 Trace(
const std::string& content =
"",
const std::string& to =
"ALL",
const std::string& from =
"");
116 Error(
const std::string& content =
"",
const std::string& to =
"ALL",
const std::string& from =
"");
122 Info(
const std::string& content =
"",
const std::string& to =
"ALL",
const std::string& from =
"");
128 State(States state,
const std::string& to =
"ALL",
const std::string& from =
"");
134 Action(
const Actions& action,
const std::string& to =
"ALL",
const std::string& from =
"");
140 Data(
const std::string& content,
const std::string& to =
"ALL",
const std::string& from =
"");
141 Data(
const Json::Value& content = {},
const std::string& to =
"ALL",
const std::string& from =
"");
147 Response(
const std::string& content =
"",
const std::string& to =
"ALL",
const std::string& from =
"");
Definition: Message.hpp:144
Definition: Message.hpp:113
Definition: Message.hpp:39
Definition: Message.hpp:131
Definition: Message.hpp:95
Definition: Message.hpp:89
Definition: Message.hpp:107
Definition: Message.hpp:125
Definition: Message.hpp:74
Definition: Message.hpp:101
Definition: Message.hpp:119