KTar Class Reference
KTar allows you to read and write tar archives, including those that are compressed using gzip or bzip2. A class for reading/writing (optionnally compressed) tar archives. More...
#include <ktar.h>
Inheritance diagram for KTar:

Public Member Functions | |
KTar (const QString &filename, const QString &mimetype=QString::null) | |
KTar (QIODevice *dev) | |
virtual | ~KTar () |
QString | fileName () |
void | setOrigFileName (const QCString &fileName) |
bool | writeSymLink (const QString &name, const QString &target, const QString &user, const QString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime) |
virtual bool | writeDir (const QString &name, const QString &user, const QString &group) |
bool | writeDir (const QString &name, const QString &user, const QString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime) |
virtual bool | prepareWriting (const QString &name, const QString &user, const QString &group, uint size) |
bool | prepareWriting (const QString &name, const QString &user, const QString &group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime) |
virtual bool | doneWriting (uint size) |
Protected Member Functions | |
virtual bool | openArchive (int mode) |
virtual bool | closeArchive () |
virtual void | virtual_hook (int id, void *data) |
bool | prepareWriting_impl (const QString &name, const QString &user, const QString &group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime) |
bool | writeDir_impl (const QString &name, const QString &user, const QString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime) |
bool | writeSymLink_impl (const QString &name, const QString &target, const QString &user, const QString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime) |
Detailed Description
KTar allows you to read and write tar archives, including those that are compressed using gzip or bzip2. A class for reading/writing (optionnally compressed) tar archives.
- Author:
- Torben Weis <weis@kde.org>, David Faure <faure@kde.org>
Definition at line 38 of file ktar.h.
Constructor & Destructor Documentation
|
Creates an instance that operates on the given filename using the compression filter associated to given mimetype.
References endl(), KMimeType::findByFileContent(), KMimeType::findByPath(), and kdDebug(). |
|
Creates an instance that operates on the given device. The device can be compressed (KFilterDev) or not (QFile, etc.). WARNING: don't assume that giving a QFile here will decompress the file, in case it's compressed!
|
|
If the tar ball is still opened, then it will be closed automatically by the destructor. Definition at line 150 of file ktar.cpp. References KArchive::close(), KArchive::device(), and KArchive::isOpened(). |
Member Function Documentation
|
The name of the tar file, as passed to the constructor Null if you used the QIODevice constructor.
|
|
Special function for setting the "original file name" in the gzip header, when writing a tar.gz file. It appears when using in the "file" command, for instance. Should only be called if the underlying device is a KFilterDev!
References KArchive::isOpened(), kdWarning(), and KArchive::mode(). |
|
Writes a symbolic link to the archive if the archive must be opened for writing.
Reimplemented from KArchive. Definition at line 867 of file ktar.cpp. References KArchive::writeSymLink(). |
|
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. Definition at line 540 of file ktar.cpp. References KArchive::device(), KArchive::isOpened(), kdWarning(), and KArchive::mode(). |
|
If an archive is opened for writing then you can add new directories using this function. KArchive won't write one directory twice. This method also allows some file metadata to be set. However, depending on the archive type not all metadata might be regarded.
Reimplemented from KArchive. Definition at line 804 of file ktar.cpp. References KArchive::writeDir(). |
|
Here's another way of writing a file into an archive: Call prepareWriting, then call writeData() as many times as wanted then call doneWriting( totalSize ). For tar.gz files, you need to know the size before hand, since it is needed in the header. For zip files, size isn't used.
Implements KArchive. |
|
Here's another way of writing a file into an archive: Call prepareWriting, then call writeData() 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. This method also allows some file metadata to be set. However, depending on the archive type not all metadata might be regarded.
Reimplemented from KArchive. Definition at line 733 of file ktar.cpp. References KArchive::prepareWriting(). |
|
Call doneWriting after writing the data.
Implements KArchive. Definition at line 610 of file ktar.cpp. References KArchive::device(), and KArchive::mode(). |
|
Opens the archive for reading. Parses the directory listing of the archive and creates the KArchiveDirectory/KArchiveFile entries.
Implements KArchive. Definition at line 327 of file ktar.cpp. References KArchiveDirectory::addEntry(), KArchive::device(), endl(), KArchive::findOrCreate(), kdDebug(), kdWarning(), and KArchive::rootDir(). |
|
Closes the archive. Called by close. Implements KArchive. Definition at line 527 of file ktar.cpp. References KArchive::mode(). |
The documentation for this class was generated from the following files: