KArchive

kbzip2filter.h
1/* This file is part of the KDE libraries
2 SPDX-FileCopyrightText: 2000 David Faure <faure@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef __kbzip2filter__h
8#define __kbzip2filter__h
9
10#include <config-compression.h>
11
12#if HAVE_BZIP2_SUPPORT
13
14#include "kfilterbase.h"
15
16/**
17 * Internal class used by KCompressionDevice
18 * @internal
19 */
20class KBzip2Filter : public KFilterBase
21{
22public:
23 KBzip2Filter();
24 ~KBzip2Filter() override;
25
26 bool init(int) override;
27 int mode() const override;
28 bool terminate() override;
29 void reset() override;
30 bool readHeader() override
31 {
32 return true; // bzip2 handles it by itself ! Cool !
33 }
34 bool writeHeader(const QByteArray &) override
35 {
36 return true;
37 }
38 void setOutBuffer(char *data, uint maxlen) override;
39 void setInBuffer(const char *data, uint size) override;
40 int inBufferAvailable() const override;
41 int outBufferAvailable() const override;
42 Result uncompress() override;
43 Result compress(bool finish) override;
44
45private:
46 class Private;
47 Private *const d;
48};
49
50#endif
51
52#endif
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()
virtual void setInBuffer(const char *data, uint size)=0
virtual bool init(int mode)=0
virtual void setOutBuffer(char *data, uint maxlen)=0
virtual Result uncompress()=0
virtual bool writeHeader(const QByteArray &filename)=0
virtual Result compress(bool finish)=0
virtual void reset()
virtual int inBufferAvailable() const =0
virtual bool readHeader()=0
virtual int mode() const =0
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:42:19 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.