KTar
KTar Class Reference
#include <KTar>
Inheritance diagram for KTar:

Public Member Functions | |
KTar (const QString &filename, const QString &mimetype=QString()) | |
KTar (QIODevice *dev) | |
~KTar () override | |
void | setOrigFileName (const QByteArray &fileName) |
![]() | |
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()) |
virtual bool | writeData (const char *data, qint64 size) |
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, const QByteArray &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 | writeFile (const QString &name, const QString &user, const QString &group, const char *data, qint64 size, mode_t perm=0100644, 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()) |
Protected Member Functions | |
bool | closeArchive () override |
bool | createDevice (QIODevice::OpenMode mode) 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 &ctime) 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) | |
KArchiveDirectory * | findOrCreate (const QString &path) |
virtual KArchiveDirectory * | rootDir () |
void | setDevice (QIODevice *dev) |
void | setErrorString (const QString &errorStr) |
void | setRootDir (KArchiveDirectory *rootDir) |
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.
Constructor & Destructor Documentation
◆ KTar() [1/2]
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/gzip" (before 5.85: "application/x-gzip"), "application/x-bzip", "application/x-xz", "application/zstd" (since 5.82) 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() [2/2]
|
explicit |
Creates an instance that operates on the given device.
The device can be compressed (KCompressionDevice) 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()
|
override |
Member Function Documentation
◆ closeArchive()
|
overrideprotectedvirtual |
◆ createDevice()
|
overrideprotectedvirtual |
◆ doFinishWriting()
|
overrideprotectedvirtual |
◆ doPrepareWriting()
◆ doWriteDir()
◆ doWriteSymLink()
◆ openArchive()
|
overrideprotectedvirtual |
◆ setOrigFileName()
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 KCompressionDevice!
- Parameters
-
fileName the original file name
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 03:51:39 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 03:51:39 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.