Sign in to follow this  

7-Zip for My Animation Files

Recommended Posts

Up until this point I used ZIP to pack my animation files, but due to the smaller size I decided to switch to 7-Zip instead. (7-Zip gives me archives of about half the size of a ZIP file.) I don't know how to use the C++ SDk, however. Can someone please point me to a tutorial (or explain to me) how I coudl do the following in C++ using the 7-Zip SDK:
[*] Be able to extract from archives from a buffer, not from disk.
[*] Be able to extract individual files, not the whole archive. (Also, I want to extract files to a buffer, not to disk.)
[*] Be able to check if a certain file exists inside the archive.

One library that could do all of this is PhysFS. Unfortunately, this is not what PhysFS was designed for: I would have to mount each and every archive file individually -- and there's a lot of archive files. So PhysFS is not an option.

Share this post

Link to post
Share on other sites
I can't point to any tutorials, but in theory ---

1) Allocate a buffer the size of your uncompressed file, have the LZMA SDK decompress into that buffer from the compressed buffer.
2) One option is to LZMA compress each file individually, and store those individual compressed chunks end-to-end in your archive format, with a table-of-contents at the start/end of the file which points to the chunks and describes their compressed+uncompressed sizes.
3) If using #2, scan your TOC.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this