annotate data/fileio/BZipFileDevice.h @ 282:d9319859a4cf tip

(none)
author benoitrigolleau
date Fri, 31 Oct 2008 11:00:24 +0000
parents fc9323a41f5a
children
rev   line source
lbajardsilogic@0 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
lbajardsilogic@0 2
lbajardsilogic@0 3 /*
lbajardsilogic@0 4 Sonic Visualiser
lbajardsilogic@0 5 An audio file viewer and annotation editor.
lbajardsilogic@0 6 Centre for Digital Music, Queen Mary, University of London.
lbajardsilogic@0 7 This file copyright 2006 Chris Cannam.
lbajardsilogic@0 8
lbajardsilogic@0 9 This program is free software; you can redistribute it and/or
lbajardsilogic@0 10 modify it under the terms of the GNU General Public License as
lbajardsilogic@0 11 published by the Free Software Foundation; either version 2 of the
lbajardsilogic@0 12 License, or (at your option) any later version. See the file
lbajardsilogic@0 13 COPYING included with this distribution for more information.
lbajardsilogic@0 14 */
lbajardsilogic@0 15
lbajardsilogic@0 16 #ifndef _BZIP_FILE_DEVICE_H_
lbajardsilogic@0 17 #define _BZIP_FILE_DEVICE_H_
lbajardsilogic@0 18
lbajardsilogic@0 19 #include <QIODevice>
lbajardsilogic@0 20
lbajardsilogic@0 21 #include <bzlib.h>
lbajardsilogic@0 22
lbajardsilogic@0 23 class BZipFileDevice : public QIODevice
lbajardsilogic@0 24 {
lbajardsilogic@0 25 Q_OBJECT
lbajardsilogic@0 26
lbajardsilogic@0 27 public:
lbajardsilogic@0 28 BZipFileDevice(QString fileName);
lbajardsilogic@0 29 virtual ~BZipFileDevice();
lbajardsilogic@0 30
lbajardsilogic@0 31 virtual bool open(OpenMode mode);
lbajardsilogic@0 32 virtual void close();
lbajardsilogic@0 33
lbajardsilogic@0 34 virtual bool isOK() const;
lbajardsilogic@0 35
lbajardsilogic@0 36 virtual bool isSequential() const { return true; }
lbajardsilogic@0 37
lbajardsilogic@0 38 protected:
lbajardsilogic@0 39 virtual qint64 readData(char *data, qint64 maxSize);
lbajardsilogic@0 40 virtual qint64 writeData(const char *data, qint64 maxSize);
lbajardsilogic@0 41
lbajardsilogic@0 42 QString m_fileName;
lbajardsilogic@0 43
lbajardsilogic@0 44 FILE *m_file;
lbajardsilogic@0 45 BZFILE *m_bzFile;
lbajardsilogic@0 46 bool m_atEnd;
lbajardsilogic@0 47 bool m_ok;
lbajardsilogic@0 48 };
lbajardsilogic@0 49
lbajardsilogic@0 50 #endif