-
Notifications
You must be signed in to change notification settings - Fork 5
/
asterixFileMapper.h
52 lines (39 loc) · 1.06 KB
/
asterixFileMapper.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* This application is free software and is released under the terms of
* the BSD license. See LICENSE file for details.
*
* Copyright (c) 2010 Volker Poplawski (volker@openbios.org)
*/
#ifndef ASTERIXFILEMAPPER_H
#define ASTERIXFILEMAPPER_H
#include <QtCore>
class AsterixBlockInfo
{
public:
qint64 offset;
qint16 category;
quint16 size;
};
Q_DECLARE_METATYPE(AsterixBlockInfo);
Q_DECLARE_METATYPE(QList<AsterixBlockInfo>);
class AsterixFileMapper : public QThread
{
Q_OBJECT
public:
explicit AsterixFileMapper(QIODevice* file, QObject *parent = 0);
bool reachedEnd() const { return m_reachedEnd; }
signals:
void asterixBlock(const QList<AsterixBlockInfo> block);
void bytesScanned(qint64 pos);
void blocksScanned(qint64 pos);
public slots:
void stop() { m_stopRequested = true; }
void setOffset(qint64 ofs) { m_offset = ofs; }
protected:
virtual void run();
QIODevice* m_file;
quint64 m_offset;
bool m_reachedEnd;
bool m_stopRequested;
};
#endif // ASTERIXFILEMAPPER_H