• 6861阅读
  • 2回复

qt,如何解压缩.zip包 [复制链接]

上一主题 下一主题
离线nikshuang2
 
只看楼主 正序阅读 楼主  发表于: 2009-07-28
     RT,qt用哪个类来读取.zip包,刚接触qt,请指点。
离线nikshuang2
只看该作者 2楼 发表于: 2009-07-28
    恩,我看了下uncompress,感觉好像无法实现;我的需求。 我知道ms那有个类库, zipext.dll,用它可以直接定位压缩包里面的单个文件。这就是我要的效果,不知道qt有没有这些类库支持,谢谢楼上的帮助
离线dbzhang800

只看该作者 1楼 发表于: 2009-07-28
简单的zip文件可以考虑 qUncompress,不行的话用第三方库就好了
QByteArray qUncompress ( const QByteArray & data )

Uncompresses the data byte array and returns a new byte array with the uncompressed data.

Returns an empty QByteArray if the input data was corrupt.

This function will uncompress data compressed with qCompress() from this and any earlier Qt version, back to Qt 3.1 when this feature was added.

Note: If you want to use this function to uncompress external data compressed using zlib, you first need to prepend four bytes to the byte array that contain the expected length (as an unsigned integer) of the uncompressed data encoded in big-endian order (most significant byte first).

See also qCompress().
QByteArray qUncompress ( const uchar * data, int nbytes )

This is an overloaded function.

Uncompresses the first nbytes of data and returns a new byte array with the uncompressed data.
快速回复
限100 字节
 
上一个 下一个