quagzipfile.h
#ifndef QUAZIP_QUAGZIPFILE_H
#define QUAZIP_QUAGZIPFILE_H
/*
Copyright (C) 2005-2014 Sergey A. Tachenov
This file is part of QuaZip.
QuaZip is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.
QuaZip 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with QuaZip. If not, see <http://www.gnu.org/licenses/>.
See COPYING file for the full LGPL text.
Original ZIP package is copyrighted by Gilles Vollant and contributors,
see quazip/(un)zip.h files for details. Basically it's the zlib license.
*/
#include <QtCore/QIODevice>
#include "quazip_global.h"
class QuaGzipFilePrivate;
class QUAZIP_EXPORT QuaGzipFile: public QIODevice {
Q_OBJECT
public:
QuaGzipFile();
QuaGzipFile(QObject *parent);
QuaGzipFile(const QString &fileName, QObject *parent = nullptr);
~QuaGzipFile() override;
void setFileName(const QString& fileName);
QString getFileName() const;
bool isSequential() const override;
bool open(QIODevice::OpenMode mode) override;
virtual bool open(int fd, QIODevice::OpenMode mode);
virtual bool flush();
void close() override;
protected:
qint64 readData(char *data, qint64 maxSize) override;
qint64 writeData(const char *data, qint64 maxSize) override;
private:
// not implemented by design to disable copy
QuaGzipFile(const QuaGzipFile &that);
QuaGzipFile& operator=(const QuaGzipFile &that);
QuaGzipFilePrivate *d{};
};
#endif // QUAZIP_QUAGZIPFILE_H
QuaGzipFile::readData
qint64 readData(char *data, qint64 maxSize) override
Implementation of QIODevice::readData().
Definition quagzipfile.cpp:160
QuaGzipFile::getFileName
QString getFileName() const
Returns the name of the GZIP file.
Definition quagzipfile.cpp:119
QuaGzipFile::setFileName
void setFileName(const QString &fileName)
Sets the name of the GZIP file to be opened.
Definition quagzipfile.cpp:114
QuaGzipFile::close
void close() override
Closes the file.
Definition quagzipfile.cpp:154
QuaGzipFile::QuaGzipFile
QuaGzipFile()
Empty constructor.
Definition quagzipfile.cpp:89
QuaGzipFile::open
bool open(QIODevice::OpenMode mode) override
Opens the file.
Definition quagzipfile.cpp:129
QuaGzipFile::flush
virtual bool flush()
Flushes data to file.
Definition quagzipfile.cpp:149
QuaGzipFile::isSequential
bool isSequential() const override
Returns true.
Definition quagzipfile.cpp:124
QuaGzipFile::writeData
qint64 writeData(const char *data, qint64 maxSize) override
Implementation of QIODevice::writeData().
Definition quagzipfile.cpp:165