|
| KZip (const QString &filename) |
|
| KZip (QIODevice *dev) |
|
| ~KZip () override |
|
Compression | compression () const |
|
ExtraField | extraField () const |
|
void | setCompression (Compression c) |
|
void | setExtraField (ExtraField ef) |
|
bool | addLocalDirectory (const QString &path, const QString &destName) |
|
bool | addLocalFile (const QString &fileName, const QString &destName) |
|
virtual bool | close () |
|
QIODevice * | device () const |
|
const KArchiveDirectory * | directory () const |
|
QString | errorString () const |
|
QString | fileName () const |
|
bool | finishWriting (qint64 size) |
|
bool | isOpen () const |
|
QIODevice::OpenMode | mode () const |
|
virtual bool | open (QIODevice::OpenMode mode) |
|
bool | prepareWriting (const QString &name, const QString &user, const QString &group, qint64 size, mode_t perm=0100644, const QDateTime &atime=QDateTime(), const QDateTime &mtime=QDateTime(), const QDateTime &ctime=QDateTime()) |
|
bool | writeData (const char *data, qint64 size) |
|
bool | writeData (QByteArrayView data) |
|
bool | writeDir (const QString &name, const QString &user=QString(), const QString &group=QString(), mode_t perm=040755, const QDateTime &atime=QDateTime(), const QDateTime &mtime=QDateTime(), const QDateTime &ctime=QDateTime()) |
|
bool | writeFile (const QString &name, QByteArrayView data, mode_t perm=0100644, const QString &user=QString(), const QString &group=QString(), const QDateTime &atime=QDateTime(), const QDateTime &mtime=QDateTime(), const QDateTime &ctime=QDateTime()) |
|
bool | writeSymLink (const QString &name, const QString &target, const QString &user=QString(), const QString &group=QString(), mode_t perm=0120755, const QDateTime &atime=QDateTime(), const QDateTime &mtime=QDateTime(), const QDateTime &ctime=QDateTime()) |
|
|
bool | closeArchive () override |
|
bool | doFinishWriting (qint64 size) override |
|
bool | doPrepareWriting (const QString &name, const QString &user, const QString &group, qint64 size, mode_t perm, const QDateTime &atime, const QDateTime &mtime, const QDateTime &creationTime) override |
|
bool | doWriteData (const char *data, qint64 size) override |
|
bool | doWriteDir (const QString &name, const QString &user, const QString &group, mode_t perm, const QDateTime &atime, const QDateTime &mtime, const QDateTime &ctime) override |
|
bool | doWriteSymLink (const QString &name, const QString &target, const QString &user, const QString &group, mode_t perm, const QDateTime &atime, const QDateTime &mtime, const QDateTime &ctime) override |
|
bool | openArchive (QIODevice::OpenMode mode) override |
|
void | virtual_hook (int id, void *data) override |
|
| KArchive (const QString &fileName) |
|
| KArchive (QIODevice *dev) |
|
virtual bool | createDevice (QIODevice::OpenMode mode) |
|
KArchiveDirectory * | findOrCreate (const QString &path) |
|
virtual KArchiveDirectory * | rootDir () |
|
void | setDevice (QIODevice *dev) |
|
void | setErrorString (const QString &errorStr) |
|
void | setRootDir (KArchiveDirectory *rootDir) |
|
A class for reading / writing zip archives.
You can use it in QIODevice::ReadOnly or in QIODevice::WriteOnly mode, and it behaves just as expected. It can also be used in QIODevice::ReadWrite mode, in this case one can append files to an existing zip archive. When you append new files, which are not yet in the zip, it works as expected, i.e. the files are appended at the end. When you append a file, which is already in the file, the reference to the old file is dropped and the new one is added to the zip - but the old data from the file itself is not deleted, it is still in the zipfile. So when you want to have a small and garbage-free zipfile, just read the contents of the appended zip file and write it to a new one in QIODevice::WriteOnly mode. This is especially important when you don't want to leak information of how intermediate versions of files in the zip were looking.
For more information on the zip fileformat go to http://www.pkware.com/products/enterprise/white_papers/appnote.html
- Author
- Holger Schroeder holge.nosp@m.r-kd.nosp@m.e@hol.nosp@m.gis..nosp@m.net
Definition at line 37 of file kzip.h.