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 }
20 KFilterBase::FilterFlags m_flags;
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
44QIODevice *KFilterBase::device()
45{
46 return d->m_dev;
47}
48
49bool KFilterBase::inBufferEmpty() const
50{
51 return inBufferAvailable() == 0;
52}
53
54bool KFilterBase::outBufferFull() const
55{
56 return outBufferAvailable() == 0;
57}
58
59bool KFilterBase::terminate()
60{
61 return true;
62}
63
64void KFilterBase::reset()
65{
66}
67
68void KFilterBase::setFilterFlags(FilterFlags flags)
69{
70 d->m_flags = flags;
71}
72
73KFilterBase::FilterFlags KFilterBase::filterFlags() const
74{
75 return d->m_flags;
76}
77
78void KFilterBase::virtual_hook(int, void *)
79{
80 /*BASE::virtual_hook( id, data );*/
81}
82

source code of karchive/src/kfilterbase.cpp