KArchive

kfilterbase.cpp
1 /* This file is part of the KDE libraries
2  SPDX-FileCopyrightText: 2000-2005 David Faure <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "kfilterbase.h"
8 
9 #include <QIODevice>
10 
11 class KFilterBasePrivate
12 {
13 public:
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 
25 KFilterBase::KFilterBase()
26  : d(new KFilterBasePrivate)
27 {
28 }
29 
30 KFilterBase::~KFilterBase()
31 {
32  if (d->m_bAutoDel) {
33  delete d->m_dev;
34  }
35  delete d;
36 }
37 
38 void 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 
73 KFilterBase::FilterFlags KFilterBase::filterFlags() const
74 {
75  return d->m_flags;
76 }
77 
78 void KFilterBase::virtual_hook(int, void *)
79 {
80  /*BASE::virtual_hook( id, data );*/
81 }
virtual bool inBufferEmpty() const
Definition: kfilterbase.cpp:49
virtual int outBufferAvailable() const =0
virtual void reset()
Definition: kfilterbase.cpp:64
QIODevice * device()
Returns the device on which the filter will work.
Definition: kfilterbase.cpp:44
virtual void virtual_hook(int id, void *data)
Virtual hook, used to add new "virtual" functions while maintaining binary compatibility.
Definition: kfilterbase.cpp:78
virtual int inBufferAvailable() const =0
void setFilterFlags(FilterFlags flags)
Definition: kfilterbase.cpp:68
void setDevice(QIODevice *dev, bool autodelete=false)
Sets the device on which the filter will work.
Definition: kfilterbase.cpp:38
virtual bool outBufferFull() const
Definition: kfilterbase.cpp:54
virtual bool terminate()
Definition: kfilterbase.cpp:59
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Dec 1 2022 03:54:18 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.