class KFilterDev

A class for reading and writing compressed data onto a device (e. More...

Definition#include <kfilterdev.h>
InheritsQIODevice (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods


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.

 KFilterDev ( KFilterBase * filter )

KFilterDev

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

 KFilterDev ( KFilterBase * filter, bool autodeleteFilterBase )

KFilterDev

Create a KFilterDev for a given filter (e.g. gzip, bzip2 etc.) Call this with autodeleteFilterBase so that the KFilterDev owns the KFilterBase.

 ~KFilterDev ()

~KFilterDev

[virtual]

bool  open ( int mode )

open

[virtual]

Reimplemented from QIODevice.

void  close ()

close

[virtual]

Reimplemented from QIODevice.

void  flush ()

flush

[virtual]

Reimplemented from QIODevice.

void  setOrigFileName ( const QCString & fileName )

setOrigFileName

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

uint  size ()

size

[const virtual]

Reimplemented from QIODevice.

int  at ()

at

[const virtual]

Reimplemented from QIODevice.

bool  at ( int )

at

[virtual]

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

Reimplemented from QIODevice.

bool  atEnd ()

atEnd

[const virtual]

Reimplemented from QIODevice.

int  readBlock ( char *data, uint maxlen )

readBlock

[virtual]

Reimplemented from QIODevice.

int  writeBlock ( const char *data, uint len )

writeBlock

[virtual]

Reimplemented from QIODevice.

int  getch ()

getch

[virtual]

Reimplemented from QIODevice.

int  putch ( int )

putch

[virtual]

Reimplemented from QIODevice.

int  ungetch ( int )

ungetch

[virtual]

Reimplemented from QIODevice.

QIODevice*  createFilterDevice (KFilterBase* base, QFile* file)

createFilterDevice

[static]

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

QIODevice *  deviceForFile ( const QString & fileName, const QString & mimetype = QString::null, bool forceFilter = false )

deviceForFile

[static]

Return 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.