问题
I'm thinking about using the 7-Zip format to pack my application files since it's a very compact and popular format. I can't find some tutorials on how to use the C++ SDK, though. I'd like some tutorials that teach me how to:
- Open an archive from memory (buffer) instead of directly from disk.
- Extract individual files inside the archive, to buffer, not to disk.
- Check if a certain file can be found in the archive.
回答1:
From the LMZA SDK documentation:
ANSI-C LZMA Decoder
~~~~~~~~~~~~~~~~~~~
Please note that interfaces for ANSI-C code were changed in LZMA SDK 4.58. If you want to use old interfaces you can download previous version of LZMA SDK from sourceforge.net site.
To use ANSI-C LZMA Decoder you need the following files: 1) LzmaDec.h + LzmaDec.c + Types.h
LzmaUtil/LzmaUtil.c is example application that uses these files.
The example app should have everything you need, else the actual source for 7-zip will have what you need. There is also a C++ wrapper for 7-zip here which should simplify a lot of the needed ops.
来源:https://stackoverflow.com/questions/6226443/7-zip-any-good-tutorials