QuaZip quazip-1-4
quagzipfile.h
1#ifndef QUAZIP_QUAGZIPFILE_H
2#define QUAZIP_QUAGZIPFILE_H
3
4/*
5Copyright (C) 2005-2014 Sergey A. Tachenov
6
7This file is part of QuaZip.
8
9QuaZip is free software: you can redistribute it and/or modify
10it under the terms of the GNU Lesser General Public License as published by
11the Free Software Foundation, either version 2.1 of the License, or
12(at your option) any later version.
13
14QuaZip is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License
20along with QuaZip. If not, see <http://www.gnu.org/licenses/>.
21
22See COPYING file for the full LGPL text.
23
24Original ZIP package is copyrighted by Gilles Vollant and contributors,
25see quazip/(un)zip.h files for details. Basically it's the zlib license.
26*/
27
28#include <QtCore/QIODevice>
29#include "quazip_global.h"
30
31#include <zlib.h>
32
33class QuaGzipFilePrivate;
34
36
39class QUAZIP_EXPORT QuaGzipFile: public QIODevice {
40 Q_OBJECT
41public:
43
48
52 QuaGzipFile(QObject *parent);
54
58 QuaGzipFile(const QString &fileName, QObject *parent = nullptr);
60 ~QuaGzipFile() override;
62 void setFileName(const QString& fileName);
64 QString getFileName() const;
66
73 bool isSequential() const override;
75
79 bool open(QIODevice::OpenMode mode) override;
81
87 virtual bool open(int fd, QIODevice::OpenMode mode);
89
93 virtual bool flush();
95 void close() override;
96protected:
98 qint64 readData(char *data, qint64 maxSize) override;
100 qint64 writeData(const char *data, qint64 maxSize) override;
101private:
102 // not implemented by design to disable copy
103 QuaGzipFile(const QuaGzipFile &that);
104 QuaGzipFile& operator=(const QuaGzipFile &that);
105 QuaGzipFilePrivate *d;
106};
107
108#endif // QUAZIP_QUAGZIPFILE_H
GZIP file.
Definition: quagzipfile.h:39
typedef OpenMode
virtual void close()
virtual bool isSequential() const const
virtual bool open(QIODevice::OpenMode mode)
virtual qint64 readData(char *data, qint64 maxSize)=0
virtual qint64 writeData(const char *data, qint64 maxSize)=0