~user-none/lebookread/trunk

« back to all changes in this revision

Viewing changes to src/ztxtreader.h

  • Committer: John Schember
  • Date: 2010-05-13 01:15:59 UTC
  • Revision ID: john@nachtimwald.com-20100513011559-8nlq8kjv9r93ele4
initial commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2010 John Schember <john@nachtimwald.com>
 
3
 *
 
4
 * This library is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License as published by
 
6
 * the Free Software Foundation, either version 3 of the License, or
 
7
 * (at your option) any later version.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU Lesser General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Lesser General Public License
 
15
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
16
 */
 
17
 
 
18
#ifndef ZTXTREADER_H
 
19
#define ZTXTREADER_H
 
20
 
 
21
#include <QString>
 
22
 
 
23
#include "pdbreader.h"
 
24
#include "zlibdecompressor.h"
 
25
#include "ztxtheader.h"
 
26
 
 
27
class ZTxtReader : public PdbReader
 
28
{
 
29
public:
 
30
    ZTxtReader();
 
31
    ~ZTxtReader();
 
32
 
 
33
    bool open(QString const &filename);
 
34
    void close();
 
35
 
 
36
    bool extractBook(const QString &location);
 
37
    bool extractBookRaw(const QString &location);
 
38
 
 
39
    static const QString IDENTITY;
 
40
    static const quint8 SUPPORTED_MAJOR_VERSION;
 
41
    static const quint8 SUPPORTED_MINOR_VERSION;
 
42
 
 
43
private:
 
44
    void readRecord0();
 
45
    bool validate();
 
46
    void readMetadata();
 
47
    QString getText();
 
48
 
 
49
    ZTxtHeader *m_record0;
 
50
    bool m_cMode1;
 
51
 
 
52
};
 
53
 
 
54
#endif // ZTXTREADER_H