From what I can see, the ZipFile class is meant purely for decoding. Are there any plans for zip creation support in the future?
Not something I was planning on. You can use the gzip compressor stream though, if you need to just compress some data.
I’ve always thought it’d be nice if it were built into juce to be as easy compressing zips as decoding them. [that was a complex sentence i hope i didn’t make any errors! :hihi:]
One handy extra facility it would give you is the ability to create a generic composite file format. It would consist of an XML file and a compressed set of files, allowing for an easy packaging of multiple files into a single project file. All the data that would normally go into a saved project file would get written to the XML file, and any links to files used would be followed to compress the files into a zip along with it.
Not essential, but would be neat and a great time saver when the time comes that you REALLY want to bundle up files.
Here’s the situation I was going to use it for:
If you’ve got a RAR or a ZIP archive, and want to host it on the web somewhere that only allows images, you can embed the archive in certain image formats (PNG, GIF, and JPG are known to work) by simply appending the archive to the image. Image viewers will treat the file as a simple image, and renaming the file to a ZIP or RAR, an archiver can extract the data.
I made a simple app that allows you to drag and drop the archive and the image files, preview the image, and save the combined file to a JPEG. [size=59](Hmm, I should probably make it use the same extension that the image uses instead of hardcoding it to use JPEG). [/size] I was thinking it would be cool to drag and drop arbitrary files, create an archive on the fly, and embed it into the image file.
It’s no big deal though, as most people just use copy /b instead of a GUI app for this.