PKZip 2.0 file decompression. Compatibility with later versions is not ensured as they may use unsupported compression algorithms. Versions after 2.7 may have an incompatible header format and thus be completely incompatible. More...
#include <unzip.h>
Classes | |
| struct | ZipEntry |
Public Types | |
| enum | ErrorCode { Ok, ZlibInit, ZlibError, OpenFailed, PartiallyCorrupted, Corrupted, WrongPassword, NoOpenArchive, FileNotFound, ReadFailed, WriteFailed, SeekFailed, CreateDirFailed, InvalidDevice, InvalidArchive, HeaderConsistencyError, Skip, SkipAll } |
| enum | ExtractionOption { ExtractPaths = 0x0001, SkipPaths = 0x0002 } |
| enum | FileType { File, Directory } |
Public Member Functions | |
| Q_DECLARE_FLAGS (ExtractionOptions, ExtractionOption) enum CompressionMethod | |
| UnZip () | |
| virtual | ~UnZip () |
| bool | isOpen () const |
| ErrorCode | openArchive (const QString &filename) |
| ErrorCode | openArchive (QIODevice *device) |
| void | closeArchive () |
| QString | archiveComment () const |
| QString | formatError (UnZip::ErrorCode c) const |
| bool | contains (const QString &file) const |
| QStringList | fileList () const |
| QList< ZipEntry > | entryList () const |
| ErrorCode | extractAll (const QString &dirname, ExtractionOptions options=ExtractPaths) |
| ErrorCode | extractAll (const QDir &dir, ExtractionOptions options=ExtractPaths) |
| ErrorCode | extractFile (const QString &filename, const QString &dirname, ExtractionOptions options=ExtractPaths) |
| ErrorCode | extractFile (const QString &filename, const QDir &dir, ExtractionOptions options=ExtractPaths) |
| ErrorCode | extractFile (const QString &filename, QIODevice *device, ExtractionOptions options=ExtractPaths) |
| ErrorCode | extractFiles (const QStringList &filenames, const QString &dirname, ExtractionOptions options=ExtractPaths) |
| ErrorCode | extractFiles (const QStringList &filenames, const QDir &dir, ExtractionOptions options=ExtractPaths) |
| void | setPassword (const QString &pwd) |
Private Attributes | |
| UnzipPrivate * | d |
PKZip 2.0 file decompression. Compatibility with later versions is not ensured as they may use unsupported compression algorithms. Versions after 2.7 may have an incompatible header format and thus be completely incompatible.
Definition at line 47 of file mythtv/libs/libmythbase/unzip.h.
| enum UnZip::ErrorCode |
The result of a decompression operation. UnZip::Ok No error occurred. UnZip::ZlibInit Failed to init or load the zlib library. UnZip::ZlibError The zlib library returned some error. UnZip::OpenFailed Unable to create or open a device. UnZip::PartiallyCorrupted Corrupted zip archive - some files could be extracted. UnZip::Corrupted Corrupted or invalid zip archive. UnZip::WrongPassword Unable to decrypt a password protected file. UnZip::NoOpenArchive No archive has been opened yet. UnZip::FileNotFound Unable to find the requested file in the archive. UnZip::ReadFailed Reading of a file failed. UnZip::WriteFailed Writing of a file failed. UnZip::SeekFailed Seek failed. UnZip::CreateDirFailed Could not create a directory. UnZip::InvalidDevice A null device has been passed as parameter. UnZip::InvalidArchive This is not a valid (or supported) ZIP archive. UnZip::HeaderConsistencyError Local header record info does not match with the central directory record info. The archive may be corrupted.
UnZip::Skip Internal use only. UnZip::SkipAll Internal use only.
Definition at line 50 of file mythtv/libs/libmythbase/unzip.h.
| ExtractPaths |
Extracts paths (default). |
| SkipPaths |
Ignores paths and extracts all the files to the same directory. |
Definition at line 72 of file mythtv/libs/libmythbase/unzip.h.
| enum UnZip::FileType |
Definition at line 86 of file mythtv/libs/libmythbase/unzip.h.
| UnZip::~UnZip | ( | ) | [virtual] |
| UnZip::Q_DECLARE_FLAGS | ( | ExtractionOptions | , | |
| ExtractionOption | ||||
| ) | [inline] |
Definition at line 79 of file mythtv/libs/libmythbase/unzip.h.
| bool UnZip::isOpen | ( | void | ) | const |
| UnZip::ErrorCode UnZip::openArchive | ( | const QString & | filename | ) |
Opens a zip archive and reads the files list. Closes any previously opened archive.
Definition at line 190 of file unzip.cpp.
Referenced by extractZIP().
| UnZip::ErrorCode UnZip::openArchive | ( | QIODevice * | device | ) |
| void UnZip::closeArchive | ( | ) |
Closes the archive and releases all the used resources (like cached passwords).
Definition at line 226 of file unzip.cpp.
Referenced by extractZIP(), and ~UnZip().
| QString UnZip::formatError | ( | UnZip::ErrorCode | c | ) | const |
| bool UnZip::contains | ( | const QString & | file | ) | const |
| QStringList UnZip::fileList | ( | ) | const |
| QList< UnZip::ZipEntry > UnZip::entryList | ( | ) | const |
| UnZip::ErrorCode UnZip::extractAll | ( | const QString & | dirname, | |
| ExtractionOptions | options = ExtractPaths | |||
| ) |
Extracts the whole archive to a directory.
Definition at line 325 of file unzip.cpp.
Referenced by extractZIP().
| UnZip::ErrorCode UnZip::extractAll | ( | const QDir & | dir, | |
| ExtractionOptions | options = ExtractPaths | |||
| ) |
| UnZip::ErrorCode UnZip::extractFile | ( | const QString & | filename, | |
| const QString & | dirname, | |||
| ExtractionOptions | options = ExtractPaths | |||
| ) |
Extracts a single file to a directory.
Definition at line 380 of file unzip.cpp.
Referenced by extractFiles().
| UnZip::ErrorCode UnZip::extractFile | ( | const QString & | filename, | |
| const QDir & | dir, | |||
| ExtractionOptions | options = ExtractPaths | |||
| ) |
| UnZip::ErrorCode UnZip::extractFile | ( | const QString & | filename, | |
| QIODevice * | dev, | |||
| ExtractionOptions | options = ExtractPaths | |||
| ) |
| UnZip::ErrorCode UnZip::extractFiles | ( | const QStringList & | filenames, | |
| const QString & | dirname, | |||
| ExtractionOptions | options = ExtractPaths | |||
| ) |
| UnZip::ErrorCode UnZip::extractFiles | ( | const QStringList & | filenames, | |
| const QDir & | dir, | |||
| ExtractionOptions | options = ExtractPaths | |||
| ) |
| void UnZip::setPassword | ( | const QString & | pwd | ) |
UnzipPrivate* UnZip::d [private] |
Definition at line 141 of file mythtv/libs/libmythbase/unzip.h.
Referenced by archiveComment(), closeArchive(), contains(), entryList(), extractAll(), extractFile(), fileList(), isOpen(), openArchive(), setPassword(), UnZip(), and ~UnZip().
1.6.3