Debian Codegraph @

mtxclient/lib/structs/events/topic.cpp

raw symbols SCIP
1 #include "mtx/events/topic.hpp"
2
3 #include <nlohmann/json.hpp>
4
5 using json = nlohmann::json;
6
7 namespace mtx {
8 namespace events {
9 namespace state {
10
11 void
12 from_json(const json &obj, Topic &event)
13 {
14 if (obj.find("topic") != obj.end() && !obj.at("topic").is_null())
15 event.topic = obj.at("topic").get<std::string>();
16 }
17
18 void
19 to_json(json &obj, const Topic &event)
20 {
21 obj["topic"] = event.topic;
22 }
23
24 } // namespace state
25 } // namespace events
26 } // namespace mtx