mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
39 lines
895 B
C++
39 lines
895 B
C++
#ifndef FASTHASHCALCULATOR_H
|
|
#define FASTHASHCALCULATOR_H
|
|
|
|
#include <QHash>
|
|
#include <QMutex>
|
|
#include <QObject>
|
|
#include <QFile>
|
|
#include <QDirIterator>
|
|
#include <Data/FileData.h>
|
|
#include "tools.h"
|
|
|
|
|
|
class FastHashCalculator : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit FastHashCalculator(QObject *parent = nullptr);
|
|
void calculateHashes(const QString& path, const QString& ignoreName);
|
|
QList<FileData> *getHashList() const;
|
|
|
|
signals:
|
|
void sigSendHashInfo(QString fullSize,QString current);
|
|
void finished();
|
|
|
|
private:
|
|
QByteArray calculateFileHashOptimized(const QString &filePath);
|
|
void calculateSingleHash(const QString &filePath);
|
|
|
|
QList<FileData>* hashList;
|
|
QMutex _mutex;
|
|
QString fullSize;
|
|
quint64 currentSize;
|
|
|
|
quint64 getDirectorySize(const QString &path);
|
|
void hashCounterDisplay(quint64 size);
|
|
};
|
|
|
|
#endif // FASTHASHCALCULATOR_H
|