-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFastSearch.h
More file actions
51 lines (41 loc) · 1.2 KB
/
FastSearch.h
File metadata and controls
51 lines (41 loc) · 1.2 KB
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 _TYR_FASTSEARCH_H_
#define _TYR_FASTSEARCH_H_
#undef _UNICODE
#undef UNICODE
#include <stdio.h>
#include <Windows.h>
#include <map>
#include "IndexDatabase.h"
namespace tyrlib
{
typedef struct _st_TYR_USN_RECORD {
DWORDLONG frn;
DWORDLONG pFrn;
DWORD dwAttribute;
WCHAR cDrive;
WCHAR szFileName[128];
} TYR_USN_RECORD;
typedef std::map<DWORDLONG, TYR_USN_RECORD>::iterator RecMI;
typedef std::map<DWORDLONG, TYR_USN_RECORD> RecMap, *PRecMap;
class FastSearch
{
public:
FastSearch();
virtual ~FastSearch();
bool Traverse(const WCHAR *szVol, USN *nextUSN);
void SaveToDataBase(IndexDatabase* database);
private:
std::map<DWORDLONG,TYR_USN_RECORD> _pResults;
private:
HANDLE CreateVolHandle(const WCHAR szVol);
void AddToMap(const USN_RECORD *pRec, const WCHAR *szVol);
bool GetFullPath(IN DWORDLONG frn, IN WCHAR vol, OUT WCHAR *szFullPath, IN OUT size_t *nFullPathLen);
bool GetFullPathByFrn(IN DWORDLONG frn,IN WCHAR vol,OUT WCHAR *szFullPath, IN OUT size_t *nFullPathLen);
bool IsValuableFile(const USN_RECORD* record);
private:
FastSearch(const FastSearch&);
FastSearch &operator=(const FastSearch&);
};
};
#endif