简体   繁体   English

如何使用Crypto ++解析ZIP文件?

[英]How can one parse a ZIP file using Crypto++?

Crypto++ includes Crypto ++包括

DEFLATE (RFC 1951) compression/decompression with gzip (RFC 1952) and zlib (RFC 1950) format support 使用gzip(RFC 1952)和zlib(RFC 1950)格式支持DEFLATE(RFC 1951)压缩/解压缩

, but I'm not sure how I could translate that into reading a ZIP file. ,但我不确定如何将其翻译成读取ZIP文件。 (I'm not averse to implementing my own ZIP traversing logic; but of course if the library already has that built in I don't want to duplicate things). (我不反对实现我自己的ZIP遍历逻辑;但当然如果库已经内置了我不想复制的东西)。

If the library doesn't provide this functionality out of the box, how does one access the zlib and gzip bits (in order to implement the compression/decompression steps)? 如果库没有提供开箱即用的功能,那么如何访问zlib和gzip位(为了实现压缩/解压缩步骤)?

I am not sure about the latest versions of Crypto++ but it was something like this before 我不确定最新版本的Crypto ++,但它之前就是这样的

// write to file
Gzip zip(new FileSink (output_filename, true ), Gzip::DEFAULT_DEFLATE_LEVEL);
zip.Put(buf, dwBufSize);
zip.MessageEnd();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM