KIO
KTar Class Reference
A class for reading / writing (optionally compressed) tar archives. More...
#include <ktar.h>

Public Member Functions | |
KTar (QIODevice *dev) | |
KTar (const QString &filename, const QString &mimetype=QString()) | |
void | setOrigFileName (const QByteArray &fileName) |
virtual | ~KTar () |
Protected Member Functions | |
virtual bool | closeArchive () |
virtual bool | createDevice (QIODevice::OpenMode mode) |
virtual bool | doFinishWriting (qint64 size) |
virtual bool | doPrepareWriting (const QString &name, const QString &user, const QString &group, qint64 size, mode_t perm, time_t atime, time_t mtime, time_t ctime) |
virtual bool | doWriteDir (const QString &name, const QString &user, const QString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime) |
virtual bool | doWriteSymLink (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 | openArchive (QIODevice::OpenMode mode) |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
A class for reading / writing (optionally compressed) tar archives.
KTar allows you to read and write tar archives, including those that are compressed using gzip, bzip2 or xz.
Definition at line 32 of file ktar.h.
Constructor & Destructor Documentation
Creates an instance that operates on the given filename using the compression filter associated to given mimetype.
- Parameters:
-
filename is a local path (e.g. "/home/weis/myfile.tgz") mimetype "application/x-gzip", "application/x-bzip" or "application/x-xz" Do not use application/x-compressed-tar or similar - you only need to specify the compression layer ! If the mimetype is omitted, it will be determined from the filename.
KTar::KTar | ( | QIODevice * | dev | ) | [explicit] |
Creates an instance that operates on the given device.
The device can be compressed (KFilterDev) or not (QFile, etc.).
- Warning:
- Do not assume that giving a QFile here will decompress the file, in case it's compressed!
- Parameters:
-
dev the device to read from. If the source is compressed, the QIODevice must take care of decompression
KTar::~KTar | ( | ) | [virtual] |
Member Function Documentation
bool KTar::closeArchive | ( | ) | [protected, virtual] |
bool KTar::createDevice | ( | QIODevice::OpenMode | mode | ) | [protected, virtual] |
bool KTar::openArchive | ( | QIODevice::OpenMode | mode | ) | [protected, virtual] |
void KTar::setOrigFileName | ( | const QByteArray & | fileName | ) |
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!
- Parameters:
-
fileName the original file name
void KTar::virtual_hook | ( | int | id, | |
void * | data | |||
) | [protected, virtual] |
The documentation for this class was generated from the following files: