QuaZIP quazip-0-7-2
|
00001 #ifndef QUAZIP_QUAGZIPFILE_H 00002 #define QUAZIP_QUAGZIPFILE_H 00003 00004 /* 00005 Copyright (C) 2005-2014 Sergey A. Tachenov 00006 00007 This file is part of QuaZIP. 00008 00009 QuaZIP is free software: you can redistribute it and/or modify 00010 it under the terms of the GNU Lesser General Public License as published by 00011 the Free Software Foundation, either version 2.1 of the License, or 00012 (at your option) any later version. 00013 00014 QuaZIP is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License 00020 along with QuaZIP. If not, see <http://www.gnu.org/licenses/>. 00021 00022 See COPYING file for the full LGPL text. 00023 00024 Original ZIP package is copyrighted by Gilles Vollant and contributors, 00025 see quazip/(un)zip.h files for details. Basically it's the zlib license. 00026 */ 00027 00028 #include <QIODevice> 00029 #include "quazip_global.h" 00030 00031 #include <zlib.h> 00032 00033 class QuaGzipFilePrivate; 00034 00036 00039 class QUAZIP_EXPORT QuaGzipFile: public QIODevice { 00040 Q_OBJECT 00041 public: 00043 00046 QuaGzipFile(); 00048 00052 QuaGzipFile(QObject *parent); 00054 00058 QuaGzipFile(const QString &fileName, QObject *parent = NULL); 00060 virtual ~QuaGzipFile(); 00062 void setFileName(const QString& fileName); 00064 QString getFileName() const; 00066 00073 virtual bool isSequential() const; 00075 00079 virtual bool open(QIODevice::OpenMode mode); 00081 00087 virtual bool open(int fd, QIODevice::OpenMode mode); 00089 00093 virtual bool flush(); 00095 virtual void close(); 00096 protected: 00098 virtual qint64 readData(char *data, qint64 maxSize); 00100 virtual qint64 writeData(const char *data, qint64 maxSize); 00101 private: 00102 // not implemented by design to disable copy 00103 QuaGzipFile(const QuaGzipFile &that); 00104 QuaGzipFile& operator=(const QuaGzipFile &that); 00105 QuaGzipFilePrivate *d; 00106 }; 00107 00108 #endif // QUAZIP_QUAGZIPFILE_H