KFilterDev Class Reference
A class for reading and writing compressed data onto a device (e.g. More...
#include <kfilterdev.h>
Inheritance diagram for KFilterDev:

Public Member Functions | |
KFilterDev (KFilterBase *filter, bool autodeleteFilterBase=false) | |
virtual | ~KFilterDev () |
virtual bool | open (int mode) |
virtual void | close () |
virtual void | flush () |
void | setOrigFileName (const QCString &fileName) |
void | setSkipHeaders () |
virtual QIODevice::Offset | size () const |
virtual QIODevice::Offset | at () const |
virtual bool | at (QIODevice::Offset) |
virtual bool | atEnd () const |
virtual Q_LONG | readBlock (char *data, Q_ULONG maxlen) |
virtual Q_LONG | writeBlock (const char *data, Q_ULONG len) |
virtual int | getch () |
virtual int | putch (int) |
virtual int | ungetch (int) |
Static Public Member Functions | |
QIODevice * | createFilterDevice (KFilterBase *base, QFile *file) KDE_DEPRECATED |
QIODevice * | deviceForFile (const QString &fileName, const QString &mimetype=QString::null, bool forceFilter=false) |
QIODevice * | device (QIODevice *inDevice, const QString &mimetype) |
QIODevice * | device (QIODevice *inDevice, const QString &mimetype, bool autoDeleteInDevice) |
Detailed Description
A class for reading and writing compressed data onto a device (e.g.file, but other usages are possible, like a buffer or a socket).
To simply read/write compressed files, see deviceForFile.
- Author:
- David Faure <faure@kde.org>
Definition at line 36 of file kfilterdev.h.
Constructor & Destructor Documentation
|
Constructs a KFilterDev for a given filter (e.g. gzip, bzip2 etc.).
Definition at line 42 of file kfilterdev.cpp. Referenced by createFilterDevice(), device(), and deviceForFile(). |
|
Destructs the KFilterDev. Calls close() if the filter device is still open. Definition at line 50 of file kfilterdev.cpp. References close(). |
Member Function Documentation
|
Open for reading or writing. If the KFilterBase's device is not opened, it will be opened. Definition at line 115 of file kfilterdev.cpp. References KFilterBase::device(), KFilterBase::init(), kdWarning(), and KFilterBase::setOutBuffer(). |
|
Close after reading or writing. If the KFilterBase's device was opened by open(), it will be closed. Definition at line 145 of file kfilterdev.cpp. References KFilterBase::device(), KFilterBase::mode(), and KFilterBase::terminate(). Referenced by ~KFilterDev(). |
|
For writing gzip compressed files only: set the name of the original file, to be used in the gzip header.
Definition at line 423 of file kfilterdev.cpp. |
|
Call this let this device skip the gzip headers when reading/writing. This way KFilterDev (with gzip filter) can be used as a direct wrapper around zlib - this is used by KZip.
Definition at line 428 of file kfilterdev.cpp. |
|
That one can be quite slow, when going back. Use with care. Definition at line 184 of file kfilterdev.cpp. References KFilterBase::device(), KFilterBase::mode(), KFilterBase::reset(), and KFilterBase::setInBuffer(). |
|
Call this to create the appropriate filter device for The returned QIODevice has to be deleted after using.
Definition at line 62 of file kfilterdev.cpp. References KFilterDev(), and KFilterBase::setDevice(). |
|
Creates an i/o device that is able to read from Available compression filters (gzip/bzip2 etc.) will automatically be used.
The compression filter to be used is determined from the Warning: application/x-bzip2 may not be available. In that case a QFile opened on the compressed data will be returned ! Use KFilterBase::findFilterByMimeType and code similar to what deviceForFile is doing, to better control what's happening. The returned QIODevice has to be deleted after using.
Definition at line 77 of file kfilterdev.cpp. References KFilterBase::findFilterByFileName(), KFilterBase::findFilterByMimeType(), KFilterDev(), and KFilterBase::setDevice(). |
|
Creates an i/o device that is able to read from the QIODevice Available compression filters (gzip/bzip2 etc.) will automatically be used.
The compression filter to be used is determined Warning: application/x-bzip2 may not be available. In that case 0 will be returned ! The returned QIODevice has to be deleted after using.
Definition at line 97 of file kfilterdev.cpp. |
|
Creates an i/o device that is able to read from the QIODevice Available compression filters (gzip/bzip2 etc.) will automatically be used.
The compression filter to be used is determined Warning: application/x-bzip2 may not be available. In that case 0 will be returned ! The returned QIODevice has to be deleted after using.
Definition at line 102 of file kfilterdev.cpp. References KFilterBase::findFilterByMimeType(), KFilterDev(), and KFilterBase::setDevice(). |
The documentation for this class was generated from the following files: