C++ (Qt)QZipReader zip_reader(QLatin1String("doc.docx"));if (zip_reader.exists()) { zip_reader.extractAll("extr"); zip_reader.close();}
C++ (Qt)foreach (QZipReader::FileInfo info, zip_reader.fileInfoList()) { qDebug() << info.filePath;}
#include <qvzip.h>int main(int argc, char *argv[]){ if (argc<2) return 1; QVZipReader zip(argv[1]); // имя файла архива zip.extractAll(argv[2]); // куда извлекать zip.close(); return 0;}
C++ (Qt)foreach (FileInfo fi, allFiles) { const QString absPath = destinationDir + QDir::separator() + fi.filePath; //if (fi.isFile) { QFile f(absPath); if (!f.open(QIODevice::WriteOnly)) return false; f.write(fileData(fi.filePath)); f.setPermissions(fi.permissions); f.close(); //}}
#if defined(Q_OS_WIN)....# define S_ISDIR(x) ((x) & 0040000) > 0# define S_ISREG(x) ((x) & 0170000) == S_IFREG# define S_IFLNK 020000# define S_ISLNK(x) ((x) & S_IFLNK) > 0...
C++ (Qt)void QZipPrivate::fillFileInfo(int index, QVZipReader::FileInfo &fileInfo) const{ FileHeader header = fileHeaders.at(index); fileInfo.filePath = QString::fromLocal8Bit(header.file_name); const quint32 mode = (qFromLittleEndian<quint32>(&header.h.external_file_attributes[0]) >> 16) & 0xFFFF; fileInfo.isDir = S_ISDIR(mode); fileInfo.isFile = S_ISREG(mode); fileInfo.isSymLink = S_ISLNK(mode); fileInfo.permissions = modeToPermissions(mode); fileInfo.crc32 = readUInt(header.h.crc_32); fileInfo.size = readUInt(header.h.uncompressed_size); fileInfo.lastModified = readMSDosDate(header.h.last_mod_file);}
$ dpkg -s zip | grep -i versionVersion: 3.0-3ppa2