Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 927 Bytes

README.md

File metadata and controls

37 lines (27 loc) · 927 Bytes

QtRAR Build status

A Qt wrapper of UnRAR library.

Disclaimer: I use this in several projects but it hasn't been tested in any serious production environment.

Usage

// Open a RAR archive
QtRAR archive("/path/to/archive");
if (!archive.open(QtRAR::OpenModeExtract)) {
    return;
}

// List file names
QStringList fileNames = archive.fileNameList();

// List file infos
QList<QtRARFileInfo> fileInfos = archive.fileInfoList();

// Extract one file
// QtRARFile derives from QIODevice
QtRARFile file(archive);
file.setFileName("foo/bar.txt");
if (file.open(QIODevice::ReadOnly)) {
    QByteArray content = file.readAll();
}

// QtRARFile can also be created directly
// An implicit QtRAR object will be created
QtRARFile file2("/path/to/archive", "foo/bar.txt");

License

MIT