KDECore
#include <kfilterdev.h>
Public Member Functions | |
virtual | ~KFilterDev () |
virtual bool | atEnd () const |
virtual void | close () |
virtual bool | open (QIODevice::OpenMode mode) |
virtual bool | seek (qint64) |
void | setOrigFileName (const QByteArray &fileName) |
void | setSkipHeaders () |
Public Member Functions inherited from QIODevice | |
QIODevice () | |
QIODevice (QObject *parent) | |
virtual | ~QIODevice () |
void | aboutToClose () |
Offset | at () const |
bool | at (Offset offset) |
virtual qint64 | bytesAvailable () const |
virtual qint64 | bytesToWrite () const |
void | bytesWritten (qint64 bytes) |
virtual bool | canReadLine () const |
QString | errorString () const |
int | flags () const |
int | getch () |
bool | getChar (char *c) |
bool | isAsynchronous () const |
bool | isBuffered () const |
bool | isCombinedAccess () const |
bool | isDirectAccess () const |
bool | isInactive () const |
bool | isOpen () const |
bool | isRaw () const |
bool | isReadable () const |
virtual bool | isSequential () const |
bool | isSequentialAccess () const |
bool | isSynchronous () const |
bool | isTextModeEnabled () const |
bool | isTranslated () const |
bool | isWritable () const |
int | mode () const |
virtual bool | open (QFlags< QIODevice::OpenModeFlag > mode) |
OpenMode | openMode () const |
qint64 | peek (char *data, qint64 maxSize) |
QByteArray | peek (qint64 maxSize) |
virtual qint64 | pos () const |
int | putch (int ch) |
bool | putChar (char c) |
qint64 | read (char *data, qint64 maxSize) |
QByteArray | read (qint64 maxSize) |
QByteArray | readAll () |
qint64 | readBlock (char *data, quint64 size) |
void | readChannelFinished () |
QByteArray | readLine (qint64 maxSize) |
qint64 | readLine (char *data, qint64 maxSize) |
void | readyRead () |
virtual bool | reset () |
void | resetStatus () |
void | setTextModeEnabled (bool enabled) |
virtual qint64 | size () const |
int | state () const |
Status | status () const |
int | ungetch (int ch) |
void | ungetChar (char c) |
virtual bool | waitForBytesWritten (int msecs) |
virtual bool | waitForReadyRead (int msecs) |
qint64 | write (const char *data) |
qint64 | write (const char *data, qint64 maxSize) |
qint64 | write (const QByteArray &byteArray) |
qint64 | writeBlock (const QByteArray &data) |
qint64 | writeBlock (const char *data, quint64 size) |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Static Public Member Functions | |
static QIODevice * | device (QIODevice *inDevice, const QString &mimetype, bool autoDeleteInDevice=true) |
static QIODevice * | deviceForFile (const QString &fileName, const QString &mimetype=QString(), bool forceFilter=false) |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions | |
virtual qint64 | readData (char *data, qint64 maxlen) |
virtual qint64 | writeData (const char *data, qint64 len) |
Protected Member Functions inherited from QIODevice | |
virtual qint64 | readData (char *data, qint64 maxSize)=0 |
virtual qint64 | readLineData (char *data, qint64 maxSize) |
void | setErrorString (const QString &str) |
void | setOpenMode (QFlags< QIODevice::OpenModeFlag > openMode) |
virtual qint64 | writeData (const char *data, qint64 maxSize)=0 |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Additional Inherited Members | |
Public Attributes inherited from QIODevice | |
typedef | Offset |
typedef | OpenMode |
typedef | Status |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
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.
Definition at line 36 of file kfilterdev.h.
Constructor & Destructor Documentation
|
virtual |
Destructs the KFilterDev.
Calls close() if the filter device is still open.
Definition at line 54 of file kfilterdev.cpp.
Member Function Documentation
|
virtual |
Reimplemented from QIODevice.
Definition at line 182 of file kfilterdev.cpp.
|
virtual |
Close after reading or writing.
If the KFilterBase's device was opened by open(), it will be closed.
Reimplemented from QIODevice.
Definition at line 128 of file kfilterdev.cpp.
|
static |
Creates an i/o device that is able to read from the QIODevice inDevice
, whether the data is compressed or not.
Available compression filters (gzip/bzip2 etc.) will automatically be used.
The compression filter to be used is determined mimetype
. Pass "application/x-gzip" or "application/x-bzip" to use the corresponding decompression filter.
Warning: application/x-bzip may not be available. In that case 0 will be returned !
The returned QIODevice has to be deleted after using.
- Parameters
-
inDevice input device. Won't be deleted if autoDeleteInDevice
= falsemimetype the mime type for the filter autoDeleteInDevice if true, inDevice
will be deleted automatically
- Returns
- a KFilterDev that filters the original stream. Must be deleted after using
Definition at line 84 of file kfilterdev.cpp.
|
static |
Reimplemented to return true.
KFilterDev is a sequential QIODevice. Well, not really, since it supports seeking and KZip uses that. Creates an i/o device that is able to read from fileName
, whether it's compressed or not. Available compression filters (gzip/bzip2 etc.) will automatically be used.
The compression filter to be used is determined from the fileName
if mimetype
is empty. Pass "application/x-gzip" or "application/x-bzip" to force the corresponding decompression filter, if available.
Warning: application/x-bzip 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.
- Parameters
-
fileName the name of the file to filter mimetype the mime type of the file to filter, or QString() if unknown forceFilter if true, the function will either find a compression filter, or return 0. If false, it will always return a QIODevice. If no filter is available it will return a simple QFile. This can be useful if the file is usable without a filter.
- Returns
- if a filter has been found, the QIODevice for the filter. If the filter does not exist, the return value depends on
forceFilter
. The returned QIODevice has to be deleted after using.
Definition at line 64 of file kfilterdev.cpp.
|
virtual |
Open for reading or writing.
If the KFilterBase's device is not opened, it will be opened.
Definition at line 97 of file kfilterdev.cpp.
Definition at line 189 of file kfilterdev.cpp.
That one can be quite slow, when going back.
Use with care.
Reimplemented from QIODevice.
Definition at line 142 of file kfilterdev.cpp.
void KFilterDev::setOrigFileName | ( | const QByteArray & | fileName | ) |
For writing gzip compressed files only: set the name of the original file, to be used in the gzip header.
- Parameters
-
fileName the name of the original file
Definition at line 358 of file kfilterdev.cpp.
void KFilterDev::setSkipHeaders | ( | ) |
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 363 of file kfilterdev.cpp.
Definition at line 278 of file kfilterdev.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.