Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KFilterDev Class Reference

#include <kfilterdev.h>

List of all members.

Public Methods

 KFilterDev (KFilterBase *filter, bool autodeleteFilterBase=false)
virtual ~KFilterDev ()
virtual bool open (int mode)
virtual void close ()
void setOrigFileName (const QCString &fileName)
void setSkipHeaders ()
virtual bool at (QIODevice::Offset)

Static Public Methods

QIODevice * createFilterDevice (KFilterBase *base, QFile *file)
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 35 of file kfilterdev.h.


Constructor & Destructor Documentation

KFilterDev::KFilterDev KFilterBase   filter,
bool    autodeleteFilterBase = false
 

Constructs a KFilterDev for a given filter (e.g. gzip, bzip2 etc.)

Parameters:
autoDeleteFilterbase  when true this object will become the owner of filter.

virtual KFilterDev::~KFilterDev   [virtual]
 

Destructs the KFilterDev. Calls close() if the filter device is still open.


Member Function Documentation

virtual bool KFilterDev::at QIODevice::Offset    [virtual]
 

That one can be quite slow, when going back. Use with care.

virtual void KFilterDev::close   [virtual]
 

Close after reading or writing. If the KFilterBase's device was opened by open(), it will be closed.

QIODevice* KFilterDev::createFilterDevice KFilterBase   base,
QFile *    file
[static]
 

Call this to create the appropriate filter device for base working on file . The returned QIODevice has to be deleted after using.

Deprecated:
. Use deviceForFile instead. To be removed in KDE 3.0

QIODevice* KFilterDev::device QIODevice *    inDevice,
const QString &    mimetype,
bool    autoDeleteInDevice
[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-bzip2" to use the corresponding decompression filter.

Warning: application/x-bzip2 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 = false
Since:
3.1

QIODevice* KFilterDev::device QIODevice *    inDevice,
const QString &    mimetype
[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-bzip2" to use the corresponding decompression filter.

Warning: application/x-bzip2 may not be available. In that case 0 will be returned !

The returned QIODevice has to be deleted after using.

Parameters:
inDevice  input device, becomes owned by this device! Automatically deleted!

QIODevice* KFilterDev::deviceForFile const QString &    fileName,
const QString &    mimetype = QString::null,
bool    forceFilter = false
[static]
 

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-bzip2" to force the corresponding decompression filter, if available.

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.

virtual bool KFilterDev::open int    mode [virtual]
 

Open for reading or writing. If the KFilterBase's device is not opened, it will be opened.

void KFilterDev::setOrigFileName const QCString &    fileName
 

For writing gzip compressed files only: set the name of the original file, to be used in the gzip header.

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.

Since:
3.1


The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:14 2003 for kdelibs by doxygen1.2.18