ValueTree


#1

In our upcoming project, preset storage and platform independent data is going to be rather complex.
I find ValueTrees nearly ideal for this, almost perfect actually.

Is it only me, or have anyone else felt the need to augment ValueTrees with binary blob storage?
Naturally, you could encode data in base64 and store it as a string, but it feels somewhat convoluted.

Would it be easy for me to build upon ValueTree without messing with the Juce source? I suspect
that inheriting would be difficult.

Thanks for any insight you might have!


#2

It’s possible to store anything you like in a ValueTree property, provided you <wrap it in / implement it as> a DynamicObject.
The thing you need to keep in mind, however, is that the built-in ValueTree serialisation functions (to/from xml/binary) will not work for such properties. You would need to write your own serialiser.

You certainly wouldn’t be able to subclass ValueTree to augment it - it has a close relationship with a hidden shared-object class, so you’d need to change that - i.e. you’d have to just write your own!