KArchive

kfilterbase.cpp
1/* This file is part of the KDE libraries
2 SPDX-FileCopyrightText: 2000-2005 David Faure <faure@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "kfilterbase.h"
8
9#include <QIODevice>
10
11class KFilterBasePrivate
12{
13public:
14 KFilterBasePrivate()
15 : m_flags(KFilterBase::WithHeaders)
16 , m_dev(nullptr)
17 , m_bAutoDel(false)
18 {
19 }
21 QIODevice *m_dev;
22 bool m_bAutoDel;
23};
24
25KFilterBase::KFilterBase()
26 : d(new KFilterBasePrivate)
27{
28}
29
30KFilterBase::~KFilterBase()
31{
32 if (d->m_bAutoDel) {
33 delete d->m_dev;
34 }
35 delete d;
36}
37
38void KFilterBase::setDevice(QIODevice *dev, bool autodelete)
39{
40 d->m_dev = dev;
41 d->m_bAutoDel = autodelete;
42}
43
45{
46 return d->m_dev;
47}
48
50{
51 return inBufferAvailable() == 0;
52}
53
55{
56 return outBufferAvailable() == 0;
57}
58
60{
61 return true;
62}
63
65{
66}
67
69{
70 d->m_flags = flags;
71}
72
73KFilterBase::FilterFlags KFilterBase::filterFlags() const
74{
75 return d->m_flags;
76}
77
79{
80 /*BASE::virtual_hook( id, data );*/
81}
This is the base class for compression filters such as gzip and bzip2.
Definition kfilterbase.h:27
virtual int outBufferAvailable() const =0
virtual bool terminate()
void setFilterFlags(FilterFlags flags)
virtual bool inBufferEmpty() const
virtual void reset()
virtual void virtual_hook(int id, void *data)
Virtual hook, used to add new "virtual" functions while maintaining binary compatibility.
QIODevice * device()
Returns the device on which the filter will work.
virtual int inBufferAvailable() const =0
void setDevice(QIODevice *dev, bool autodelete=false)
Sets the device on which the filter will work.
virtual bool outBufferFull() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.