-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdirectorywrapper.h
51 lines (39 loc) · 1.26 KB
/
directorywrapper.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
#ifndef DIRECTORYWRAPPER_H
#define DIRECTORYWRAPPER_H
#include "indexedfile.h"
#include "patternutil.h"
#include <QObject>
#include <atomic>
namespace qqipa {
struct DirectoryWrapper : public QObject
{
Q_OBJECT
public:
DirectoryWrapper(const size_t &id, const QString &directoryName);
signals:
void preprocessStarted();
void dirSearchingStarted();
void preprocessFinished(fsize_t upcomingFiles);
void newIndexedFiles(fsize_t filesDirCompleted, std::vector<std::pair<fsize_t, QString> > indexedFiles);
void newFoundFile(fsize_t filesCompleted, std::pair<fsize_t, QString> foundFile);
void indexingFinished(fsize_t indexedFiles);
void searchingFinished(fsize_t foundFiles);
public slots:
void startIndexing();
void startSearching(PatternUtil patternUtil);
void interruptIndexing();
void interruptSearching();
private:
inline void indexFoundFiles(const std::vector<QString> &filesToIdndex);
inline std::vector<QString> impoverishDirectory();
inline void clearData();
public:
std::atomic<bool> wasIndCancelled;
std::atomic<bool> wasSearchCancelled;
std::atomic<bool> wasSuccessfullyIndexed;
size_t id;
QString name;
std::vector<IndexedFile> indexedFileVector;
};
}
#endif // DIRECTORYWRAPPER_H