#include <karchive.h>
Inheritance diagram for KArchive:

Public Methods | |
| virtual bool | open (int mode) |
| virtual void | close () |
| bool | isOpened () const |
| int | mode () const |
| QIODevice * | device () const |
| const KArchiveDirectory * | directory () const |
| virtual bool | writeDir (const QString &name, const QString &user, const QString &group)=0 |
| virtual bool | writeFile (const QString &name, const QString &user, const QString &group, uint size, const char *data) |
| virtual bool | prepareWriting (const QString &name, const QString &user, const QString &group, uint size)=0 |
| virtual bool | doneWriting (uint size)=0 |
Protected Methods | |
| KArchive (QIODevice *dev) | |
| virtual bool | openArchive (int mode)=0 |
| virtual bool | closeArchive ()=0 |
| virtual KArchiveDirectory * | rootDir () |
| KArchiveDirectory * | findOrCreate (const QString &path) |
Definition at line 38 of file karchive.h.
|
|
Base constructor (protected since this is a pure virtual class).
|
|
|
Closes the archive. Inherited classes might want to reimplement closeArchive instead.
|
|
|
Closes the archive. Called by close. |
|
|
The underlying device. Definition at line 80 of file karchive.h. |
|
|
If an archive is opened for reading, then the contents of the archive can be accessed via this function. |
|
|
Call doneWriting after writing the data.
|
|
|
Ensures that |
|
|
Definition at line 70 of file karchive.h. |
|
|
Definition at line 75 of file karchive.h. |
|
|
Opens the archive for reading or writing.
|
|
|
Opens an archive for reading or writing. Called by open. |
|
||||||||||||||||||||
|
Here's another way of writing a file into an archive: Call prepareWriting, then call device()->writeBlock() (for tar files) or writeData (for zip files) [NEW VIRTUAL METHOD NEEDED] as many times as wanted then call doneWriting( totalSize ) For tar.gz files, you need to know the size before hand, it is needed in the header! For zip files, size isn't used. |
|
|
Retrieves or create the root directory. The default implementation assumes that openArchive() did the parsing, so it creates a dummy rootdir if none was set (write mode, or no '/' in the archive). Reimplement this to provide parsing/listing on demand. |
|
||||||||||||||||
|
If an archive is opened for writing then you can add new directories using this function. KArchive won't write one directory twice. |
|
||||||||||||||||||||||||
|
If an archive is opened for writing then you can add a new file using this function. If the file name is for example "mydir/test1" then the directory "mydir" is automatically appended first if that did not happen yet. Reimplemented in KZip. |
1.2.18