KArchive

kzstdfilter.h
1/* This file is part of the KDE libraries
2 SPDX-FileCopyrightText: 2021 Albert Astals Cid <aacid@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KZSTDFILTER_H
8#define KZSTDFILTER_H
9
10#include <config-compression.h>
11
12#if HAVE_ZSTD_SUPPORT
13
14#include "kfilterbase.h"
15
16#include <memory>
17
18/**
19 * Internal class used by KCompressionDevice
20 * @internal
21 */
22class KZstdFilter : public KFilterBase
23{
24public:
25 KZstdFilter();
26 ~KZstdFilter() override;
27
28 bool init(int) override;
29 int mode() const override;
30 bool terminate() override;
31 void reset() override;
32 bool readHeader() override
33 {
34 return true;
35 }
36 bool writeHeader(const QByteArray &) override
37 {
38 return true;
39 }
40 void setOutBuffer(char *data, uint maxlen) override;
41 void setInBuffer(const char *data, uint size) override;
42 int inBufferAvailable() const override;
43 int outBufferAvailable() const override;
44 Result uncompress() override;
45 Result compress(bool finish) override;
46
47private:
48 class Private;
49 const std::unique_ptr<Private> d;
50};
51
52#endif
53
54#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 Fri Jul 12 2024 11:53:46 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.