2 #include <score/model/tree/TreeNode.hpp>
4 #include <score/serialization/JSONVisitor.hpp>
11 s.readFrom(
static_cast<const T&
>(n));
13 s.stream() << n.childCount();
14 for(
const auto& child : n)
24 s.writeTo(
static_cast<T&
>(n));
27 s.stream() >> childCount;
28 for(
int i = 0; i < childCount; ++i)
32 n.push_back(std::move(child));
44 s.stream.StartObject();
46 s.readFrom(
static_cast<const T&
>(n));
48 if(n.childCount() > 0)
49 s.obj[s.strings.Children] = n.children();
56 s.writeTo(
static_cast<T&
>(n));
57 auto it = s.obj.constFind(s.strings.Children);
58 if(it != s.obj.constEnd())
60 const auto& children = it->toArray();
61 for(
const auto& val : children)
66 nodeWriter.writeTo(child);
67 n.push_back(std::move(child));
Definition: VisitorInterface.hpp:53
Definition: DataStreamVisitor.hpp:27
Definition: DataStreamVisitor.hpp:202
Definition: VisitorInterface.hpp:61
Definition: JSONVisitor.hpp:52
Definition: JSONVisitor.hpp:423
Definition: TreeNode.hpp:52
Definition: VisitorInterface.hpp:13