File: decompressor.h

package info (click to toggle)
kdegraphics-mobipocket 4:20.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 196 kB
  • sloc: cpp: 586; xml: 149; makefile: 3
file content (33 lines) | stat: -rw-r--r-- 1,135 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/***************************************************************************
 *   Copyright (C) 2008 by Jakub Stachowski <qbast@go2.pl>                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/

#ifndef MOBI_DECOMPRESSOR_H
#define MOBI_DECOMPRESSOR_H

#include <QByteArray>
namespace Mobipocket {

class PDB;

class Decompressor {
public:
    Decompressor(const PDB& p) : pdb(p), valid(true) {}
    virtual QByteArray decompress(const QByteArray& data) = 0; 
    virtual ~Decompressor() {}
    bool isValid() const { return valid; }

    static Decompressor* create(quint8 type, const PDB& pdb);
protected:
    const PDB& pdb;
    bool valid;
};

quint32 readBELong(const QByteArray& data, int offset);
}
#endif