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