/usr/include/KF5/KArchive/kfilterbase.h is in libkf5archive-dev 5.28.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | /* This file is part of the KDE libraries
Copyright (C) 2000 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __kfilterbase__h
#define __kfilterbase__h
#include <karchive_export.h>
#include <QtCore/QObject>
#include <QtCore/QString>
class KFilterBasePrivate;
class QIODevice;
/**
* This is the base class for compression filters
* such as gzip and bzip2. It's pretty much internal.
* Don't use directly, use KFilterDev instead.
* @internal
*/
class KARCHIVE_EXPORT KFilterBase
{
public:
KFilterBase();
virtual ~KFilterBase();
/**
* Sets the device on which the filter will work
* @param dev the device on which the filter will work
* @param autodelete if true, @p dev is deleted when the filter is deleted
*/
void setDevice(QIODevice *dev, bool autodelete = false);
// Note that this isn't in the constructor, because of KLibFactory::create,
// but it should be called before using the filterbase !
/**
* Returns the device on which the filter will work.
* @returns the device on which the filter will work
*/
QIODevice *device();
/** \internal */
virtual bool init(int mode) = 0;
/** \internal */
virtual int mode() const = 0;
/** \internal */
virtual bool terminate();
/** \internal */
virtual void reset();
/** \internal */
virtual bool readHeader() = 0;
/** \internal */
virtual bool writeHeader(const QByteArray &filename) = 0;
/** \internal */
virtual void setOutBuffer(char *data, uint maxlen) = 0;
/** \internal */
virtual void setInBuffer(const char *data, uint size) = 0;
/** \internal */
virtual bool inBufferEmpty() const;
/** \internal */
virtual int inBufferAvailable() const = 0;
/** \internal */
virtual bool outBufferFull() const;
/** \internal */
virtual int outBufferAvailable() const = 0;
/** \internal */
enum Result {
Ok,
End,
Error
};
/** \internal */
virtual Result uncompress() = 0;
/** \internal */
virtual Result compress(bool finish) = 0;
/**
* \internal
* \since 4.3
*/
enum FilterFlags {
NoHeaders = 0,
WithHeaders = 1,
ZlibHeaders = 2 // only use for gzip compression
};
/**
* \internal
* \since 4.3
*/
void setFilterFlags(FilterFlags flags);
FilterFlags filterFlags() const;
protected:
/** Virtual hook, used to add new "virtual" functions while maintaining
binary compatibility. Unused in this class.
*/
virtual void virtual_hook(int id, void *data);
private:
Q_DISABLE_COPY(KFilterBase)
KFilterBasePrivate *const d;
};
#endif
|