Using KArchive with zip and rar
I was wondering, how can I use KArchive to handle rar and zip files (on Windows)?
I can't find any tutorial on the internet showing that, specially for rar files.
I want to list the files from the archives and also be able to extract the files.
have you already looked at the docs? https://api.kde.org/frameworks/karchive/html/classKArchive.html
you can use
KZipfor zip files. Rar is not supported (proprietary, closed source).
KArchive is super easy to use. you just use
KZip zip("myArchive.zip");to create it, then you open it as you would a QFile
if(zip.open(QIODevice::ReadOnly))then you can list the contents with
zip.directory()->entries()to uncompress you just call
Rar is not handled by KArchive but you can use the UnRAR library