-
Notifications
You must be signed in to change notification settings - Fork 6
/
TestApp.cpp
55 lines (43 loc) · 1.39 KB
/
TestApp.cpp
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
53
54
55
#include "NTFSDirectorySystem.h"
#include <memory>
#include <assert.h>
// null terminated
static const char *imageExtension[] = {
//
// Qt formats not supplied by plug in
"jp2", "jpeg", "jpg", "bmp", "tiff", "tif", "gif",
//
"3fr", "arw", "bay", "bmq", "cap", "cine", "cr2", "crw", "cs1", "dc2", "drf", "dsc", "dng", "erf", "fff", "iiq",
"k25", "kc2", "kdc", "mdc", "mef", "mos", "mrw", "nef", "nrw", "orf", "pcx", "pef", "png", "psd", "ptx", "pxn",
"qtk", "raf", "ras", "rdc", "rw2", "rwl", "rwz", "sgi", "sr2", "srf", "srw", "sti", "tga", "x3f", 0};
USet<String> imageExtensions()
{
USet<String> extensions;
for (int i = 0; imageExtension[i]; i++)
{
String qs = String(imageExtension[i]);
extensions.insert(qs);
}
return extensions;
}
void signalFileName(String const &filePath)
{
int t = 1;
}
void signalDirectoryProgress(size_t n, size_t total, String const &text)
{
float percent = (float)n / (float)total;
printf("\r%s %2d%% ", text.c_str(), (int)(percent * 100.0));
fflush(stdout);
}
int main()
{
USet<String> extensions = imageExtensions();
NTFSDirectorySystem ntfs;
uint32_t driveMask = DISK_C;
bool success = ntfs.readDisks(driveMask);
if (success)
{
ntfs.searchForFilesViaExtensions(driveMask, extensions);
}
}