• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • compression
kfilterbase.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2000 David Faure <faure@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __kfilterbase__h
21#define __kfilterbase__h
22
23#include <karchive_export.h>
24
25#include <QtCore/QObject>
26#include <QtCore/QString>
27
28class QIODevice;
29
36class KARCHIVE_EXPORT KFilterBase
37{
38public:
39 KFilterBase();
40 virtual ~KFilterBase();
41
47 void setDevice( QIODevice * dev, bool autodelete = false );
48 // Note that this isn't in the constructor, because of KLibFactory::create,
49 // but it should be called before using the filterbase !
50
55 QIODevice * device();
57 virtual void init( int mode ) = 0; // KDE5 TODO: return a bool
59 virtual int mode() const = 0;
61 virtual void terminate();
63 virtual void reset();
65 virtual bool readHeader() = 0;
67 virtual bool writeHeader( const QByteArray & filename ) = 0;
69 virtual void setOutBuffer( char * data, uint maxlen ) = 0;
71 virtual void setInBuffer( const char * data, uint size ) = 0;
73 virtual bool inBufferEmpty() const;
75 virtual int inBufferAvailable() const = 0;
77 virtual bool outBufferFull() const;
79 virtual int outBufferAvailable() const = 0;
80
82 enum Result { Ok, End, Error };
84 virtual Result uncompress() = 0;
86 virtual Result compress( bool finish ) = 0;
87
92 enum FilterFlags {
93 NoHeaders = 0,
94 WithHeaders = 1
95 };
100 void setFilterFlags(FilterFlags flags);
101 FilterFlags filterFlags() const;
102
109 static KFilterBase * findFilterByFileName( const QString & fileName );
110
117 static KFilterBase * findFilterByMimeType( const QString & mimeType );
118
119protected: // TODO KDE5: move to d pointer
120 QIODevice * m_dev;
121 bool m_bAutoDel;
122protected:
126 virtual void virtual_hook( int id, void* data );
127private:
128 Q_DISABLE_COPY( KFilterBase )
129 class Private;
130 Private * const d;
131};
132
133#endif
KFilterBase
This is the base class for compression filters such as gzip and bzip2.
Definition: kfilterbase.h:37
KFilterBase::outBufferAvailable
virtual int outBufferAvailable() const =0
KFilterBase::Result
Result
Definition: kfilterbase.h:82
KFilterBase::End
@ End
Definition: kfilterbase.h:82
KFilterBase::m_bAutoDel
bool m_bAutoDel
Definition: kfilterbase.h:121
KFilterBase::setInBuffer
virtual void setInBuffer(const char *data, uint size)=0
KFilterBase::setOutBuffer
virtual void setOutBuffer(char *data, uint maxlen)=0
KFilterBase::init
virtual void init(int mode)=0
KFilterBase::FilterFlags
FilterFlags
Definition: kfilterbase.h:92
KFilterBase::uncompress
virtual Result uncompress()=0
KFilterBase::writeHeader
virtual bool writeHeader(const QByteArray &filename)=0
KFilterBase::compress
virtual Result compress(bool finish)=0
KFilterBase::inBufferAvailable
virtual int inBufferAvailable() const =0
KFilterBase::readHeader
virtual bool readHeader()=0
KFilterBase::mode
virtual int mode() const =0
KFilterBase::m_dev
QIODevice * m_dev
Definition: kfilterbase.h:120
QIODevice
QString
karchive_export.h
KARCHIVE_EXPORT
#define KARCHIVE_EXPORT
Definition: karchive_export.h:46
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal