KArchive

kxzfilter.h
1/* This file is part of the KDE libraries
2 SPDX-FileCopyrightText: 2007-2008 Per Øyvind Karlsen <peroyvind@mandriva.org>
3
4 Based on kbzip2filter:
5 SPDX-FileCopyrightText: 2000 David Faure <faure@kde.org>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8*/
9
10#ifndef KXZFILTER_H
11#define KXZFILTER_H
12
13#include <config-compression.h>
14
15#if HAVE_XZ_SUPPORT
16
17#include "kfilterbase.h"
18
19/**
20 * Internal class used by KCompressionDevice
21 * @internal
22 */
23class KXzFilter : public KFilterBase
24{
25public:
26 KXzFilter();
27 ~KXzFilter() override;
28
29 bool init(int) override;
30
31 enum Flag {
32 AUTO = 0,
33 LZMA = 1,
34 LZMA2 = 2,
35 BCJ = 3, // X86
36 POWERPC = 4,
37 IA64 = 5,
38 ARM = 6,
39 ARMTHUMB = 7,
40 SPARC = 8,
41 };
42
43 virtual bool init(int, Flag flag, const QList<unsigned char> &props);
44 int mode() const override;
45 bool terminate() override;
46 void reset() override;
47 bool readHeader() override
48 {
49 return true; // lzma handles it by itself ! Cool !
50 }
51 bool writeHeader(const QByteArray &) override
52 {
53 return true;
54 }
55 void setOutBuffer(char *data, uint maxlen) override;
56 void setInBuffer(const char *data, uint size) override;
57 int inBufferAvailable() const override;
58 int outBufferAvailable() const override;
59 Result uncompress() override;
60 Result compress(bool finish) override;
61
62private:
63 class Private;
64 Private *const d;
65};
66
67#endif
68
69#endif // KXZFILTER_H
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 Mon Nov 18 2024 12:11:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.