7#ifndef __kcompressiondevice_h
8#define __kcompressiondevice_h
10#include <karchive_export.h>
17class KCompressionDevicePrivate;
80 bool open(QIODevice::OpenMode mode)
override;
106 bool atEnd()
const override;
129 QFileDevice::FileError
error()
const;
134 qint64 readData(
char *data, qint64 maxlen)
override;
135 qint64 writeData(
const char *data, qint64 len)
override;
140 friend KCompressionDevicePrivate;
141 KCompressionDevicePrivate *
const d;
A class for reading / writing p7zip archives.
Definition k7zip.h:19
A class for reading and writing compressed data onto a device (e.g.
Definition kcompressiondevice.h:31
KCompressionDevice(const QString &fileName, CompressionType type)
Constructs a KCompressionDevice for a given CompressionType (e.g.
void setOrigFileName(const QByteArray &fileName)
For writing gzip compressed files only: set the name of the original file, to be used in the gzip hea...
KCompressionDevice(QIODevice *inputDevice, bool autoDeleteInputDevice, CompressionType type)
Constructs a KCompressionDevice for a given CompressionType (e.g.
CompressionType compressionType() const
The compression actually used by this device.
QFileDevice::FileError error() const
Returns the error code from the last failing operation.
bool seek(qint64) override
That one can be quite slow, when going back.
CompressionType
Definition kcompressiondevice.h:34
@ Zstd
Definition kcompressiondevice.h:39
void close() override
Close after reading or writing.
~KCompressionDevice() override
Destructs the KCompressionDevice.
void setSkipHeaders()
Call this let this device skip the gzip headers when reading/writing.
static CompressionType compressionTypeForMimeType(const QString &mimetype)
Returns the compression type for the given MIME type, if possible.
static KFilterBase * filterForCompressionType(CompressionType type)
Call this to create the appropriate filter for the CompressionType named type.
KCompressionDevice(const QString &fileName)
Constructs a KCompressionDevice for a given fileName.
bool open(QIODevice::OpenMode mode) override
Open for reading or writing.
This is the base class for compression filters such as gzip and bzip2.
Definition kfilterbase.h:27