C++ (Qt)QZipReader zip("enc.zip");qDebug()<<zip.exists(); // true qDebug()<<zip.count(); // 28 qDebug()<<zip.extractAll("dir"); // false
QStringList createdFolders; QZipReader unzip("enc.zip", QIODevice::ReadOnly); QList<QZipReader::FileInfo> allFiles = unzip.fileInfoList(); QRegExp rx("(.+)/(?!=[\\w.]+)",Qt::CaseInsensitive,QRegExp::RegExp2); QDir eDir; for(int i=0;i<allFiles.length();++i) { rx.indexIn(allFiles.at(i).filePath); QString captured = rx.cap(1); if(!createdFolders.contains(captured)) { eDir.mkpath(captured); qDebug()<<captured; createdFolders.append(captured); } QByteArray ar= unzip.fileData(allFiles.at(i).filePath); QFile file(allFiles.at(i).filePath); file.open(QIODevice::WriteOnly); file.write(ar); file.close(); } unzip.close();