KAr Class Reference
A class for reading ar archives. More...
#include <kar.h>
Inheritance diagram for KAr:

Public Methods | |
KAr (const QString &filename) | |
Creates an instance that operates on the given filename. | |
KAr (QIODevice *dev) | |
Creates an instance that operates on the given device. | |
virtual | ~KAr () |
If the ar file is still opened, then it will be closed automatically by the destructor. | |
QString | fileName () |
The name of the ar file, as passed to the constructor Null if you used the QIODevice constructor. | |
virtual bool | prepareWriting (const QString &, const QString &, const QString &, uint) |
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. | |
virtual bool | doneWriting (uint) |
Call doneWriting after writing the data. | |
virtual bool | writeDir (const QString &, const QString &, const QString &) |
If an archive is opened for writing then you can add new directories using this function. | |
Protected Methods | |
virtual bool | openArchive (int mode) |
Opens the archive for reading. | |
virtual bool | closeArchive () |
Closes the archive. | |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
A class for reading ar archives.
- Author:
- Laurence Anderson <l.d.anderson@warwick.ac.uk>
- Since:
- 3.1
Definition at line 36 of file kar.h.
Constructor & Destructor Documentation
|
Creates an instance that operates on the given filename.
|
|
Creates an instance that operates on the given device. The device can be compressed (KFilterDev) or not (QFile, etc.). |
|
If the ar file is still opened, then it will be closed automatically by the destructor.
Definition at line 58 of file kar.cpp. References KArchive::close(), KArchive::device(), QString::isEmpty(), and KArchive::isOpened(). |
Member Function Documentation
|
The name of the ar file, as passed to the constructor Null if you used the QIODevice constructor.
|
|
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.
Implements KArchive. |
|
Call doneWriting after writing the data.
Implements KArchive. |
|
If an archive is opened for writing then you can add new directories using this function. KArchive won't write one directory twice. Implements KArchive. |
|
Opens the archive for reading. Parses the directory listing of the archive and creates the KArchiveDirectory/KArchiveFile entries. Implements KArchive. Definition at line 69 of file kar.cpp. References KArchiveDirectory::addEntry(), QIODevice::at(), QIODevice::atEnd(), KArchive::device(), QCString::find(), QCString::left(), QCString::mid(), KArchive::mode(), QIODevice::readBlock(), QCString::replace(), QCString::resize(), QCString::right(), KArchive::rootDir(), and QCString::stripWhiteSpace(). |
|
Closes the archive. Called by close. Implements KArchive. |
The documentation for this class was generated from the following files: