BinaryData improvements


#1

It would be great if the output produced by BinaryData would be presented in the form of a standard container. Here’s a class I rolled, “IntrusiveArray” which could be used to present the binary data as a standard container with almost no effort:

IntrusiveArray

This sure beats the “char const* return value, int reference parameter” interface of getNamedResource.


#2

For various reasons I've always been careful to make those files compile without including any headers. I guess they could define some simple objects that have begin()/end() methods for each blob.


#3

Would asking for compressed sources be too much? hehe

I have some test vectors that are 1 megabyte, 5 megabytes, 50 megabytes.... larger.

BinaryData could compress them and store them using some encoding like Base90


#4

Yes, having an option to gzip them is something I've thought about too - might add that in the future.


#5

It would be useful if there were at least a flag option in BinaryBuilder to add the same getNamedResource() method that the IntroJucer creates when you add resources to it:

const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();

The reason being that some of us prefer loading images out of the Resources directory on OS X and iOS and keeping the binary size small but bundling the images into the binary on Windows.  Having the getNamedResource() method makes it possible to retrieve images by their file name regardless of where they are stored.