2 #include <Device/Node/DeviceNode.hpp>
4 #include <score/model/tree/TreeNodeSerialization.hpp>
5 #include <score/serialization/JSONVisitor.hpp>
6 #include <score/serialization/MimeVisitor.hpp>
10 inline constexpr
const char* nodelist() noexcept
12 return "application/x-score-nodelist";
18 using MimeDataReader::MimeDataReader;
19 void serialize(
const Device::NodeList& lst)
const
23 r.stream.StartArray();
24 for(
const auto& elt : lst)
26 r.stream.StartObject();
28 r.obj[
"Address"] = Device::address(*elt).address;
33 m_mime.setData(score::mime::nodelist(), r.toByteArray());
40 using MimeDataWriter::MimeDataWriter;
43 Device::FreeNodeList ml;
44 auto json = readJson(m_mime.data(score::mime::nodelist()));
45 const auto& arr = json.GetArray();
47 auto& strings = score::StringConstant();
48 for(
const rapidjson::Value& elt : arr)
52 n.first <<= des.obj[strings.Address];
53 n.second <<= des.obj[
"Node"];
Definition: JSONVisitor.hpp:52
Definition: JSONVisitor.hpp:423
Manipulation of Devices from Qt.
Definition: AddressSettings.cpp:14
Definition: MimeVisitor.hpp:22
Definition: MimeVisitor.hpp:32
Definition: MimeVisitor.hpp:7
Definition: MimeVisitor.hpp:9