QuaZIP quazip-0-6-2
quaziodevice.h
00001 #ifndef QUAZIP_QUAZIODEVICE_H
00002 #define QUAZIP_QUAZIODEVICE_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 3 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 QuaZIODevicePrivate;
00034 
00036 
00041 class QUAZIP_EXPORT QuaZIODevice: public QIODevice {
00042   Q_OBJECT
00043 public:
00045 
00049   QuaZIODevice(QIODevice *io, QObject *parent = NULL);
00051   ~QuaZIODevice();
00053 
00073   virtual bool flush();
00075 
00079   virtual bool open(QIODevice::OpenMode mode);
00081 
00085   virtual void close();
00087   QIODevice *getIoDevice() const;
00089   virtual bool isSequential() const;
00090 protected:
00092   virtual qint64 readData(char *data, qint64 maxSize);
00094   virtual qint64 writeData(const char *data, qint64 maxSize);
00095 private:
00096   QuaZIODevicePrivate *d;
00097 };
00098 #endif // QUAZIP_QUAZIODEVICE_H