ValueTree is so useful, i use it as base for my interprocess-messaging system, but it would be cool if you could extend the var type:
“var” should also be able to store any kind of binary data (MemoryBlock)
ValueTree is so useful, i use it as base for my interprocess-messaging system, but it would be cool if you could extend the var type:
“var” should also be able to store any kind of binary data (MemoryBlock)
also it would nice to have Constructors for
Array
Array
Array
Array etc…
At the moment i have to convert a Array into a Array before i can store it in a ValueTree, or is there a faster method…
okay two handy converter:
template <class ObjectClass>
static Array<var> convertIntoVarArray(Array< ObjectClass > &arrayToConvert)
{
Array<var> newArray;
for (int i=0; i<arrayToConvert.size(); i++)
{
newArray.add(var(arrayToConvert[i]));
};
return newArray;
}
template <class ObjectClass>
static Array<ObjectClass> convertFromVarArray(Array< var > &arrayWhereToConvertFrom)
{
Array< ObjectClass > newArray;
for (int i=0; i<arrayWhereToConvertFrom.size(); i++)
{
newArray.add(ObjectClass(arrayWhereToConvertFrom[i]));
};
return newArray;
}
Just create yourself a subclass of DynamicObject which stores whatever block of memory you need (or better still, stores your data in a structured form).
but can i use writeToStream() or/and create a XML/JSON from it?
Its all about serializing and send it over the network.
[quote=“chkn”]but can i use writeToStream() or/and create a XML/JSON from it?
Its all about serializing and send it over the network.[/quote]
Well no, but this was never intended as a way of serialising large blocks of unstructured data. Your best bet is probably to uuencode it and store it as a string.
what you call “large blocks of unstructured data” is in my case a “atomic portion of binary data”, which is exactly the kind of information i need to store. Its very close to a string.
If i uuencode it a string its just wasting memory/performance .