PIValueTree::readChildValue method
some child-oriented methods allow to create JSON from single PIValueTree
This commit is contained in:
@@ -252,6 +252,7 @@ PIJSON toJSONTree(const PIValueTree & root, PIValueTreeConversions::Options opti
|
||||
|
||||
|
||||
PIJSON PIValueTreeConversions::toJSON(const PIValueTree & root, Options options) {
|
||||
if (options[IncludeRoot]) return toJSONTree(root, options);
|
||||
PIJSON ret = PIJSON::newArray();
|
||||
for (const auto & c: root.children())
|
||||
ret << toJSONTree(c, options);
|
||||
|
||||
@@ -38,7 +38,8 @@ enum Option {
|
||||
WithAttributes = 0x1,
|
||||
WithComment = 0x2,
|
||||
WithType = 0x4,
|
||||
WithAll = 0xFFFFFF,
|
||||
WithAll = 0xFFF,
|
||||
IncludeRoot = 0x1000,
|
||||
Default = WithAll
|
||||
};
|
||||
typedef PIFlags<Option> Options;
|
||||
|
||||
Reference in New Issue
Block a user