-
Notifications
You must be signed in to change notification settings - Fork 0
/
hashpool.h
34 lines (28 loc) · 917 Bytes
/
hashpool.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
#ifndef HASHPOOL_H
#define HASHPOOL_H
#include <QObject>
#include <QHash>
#include <QDebug>
#include <QFileInfo>
#include "hashthread.h"
#include "sqlitedb.h"
class HashPool : public QObject
{
Q_OBJECT
public:
explicit HashPool(SQLiteDB *db,
QObject *parent = 0);
QString getFileHash(QCryptographicHash::Algorithm algo, QString fpath);
QString algoName(QCryptographicHash::Algorithm a) const;
signals:
void sigHash(int algo, QString hashString, QString fpath);
void sigHashingPercent(int algo, int percent, QString fpath);
private slots:
void saveHash2DB(int algo, QString hash, QString fpath);
void cacheFileHash(int algo, QString hash, QString fpath);
QString queryFileHash(QCryptographicHash::Algorithm algo, QString fname, QString size, QString mtime);
private:
QHash< QString, QString > file_hashes_;
SQLiteDB *db_;
};
#endif // HASHPOOL_H