-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
103 lines (74 loc) · 2.38 KB
/
Copy pathmain.cpp
File metadata and controls
103 lines (74 loc) · 2.38 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#define NOMINMAX
#include "wholeinclude.h"
#include "conversions.h"
#include "functions.h"
int main(int argc, char* argv[])
{
CoInitializeEx(NULL, COINIT_MULTITHREADED);
bool searchFolders = false; //option for user to search for folders too
bool searchContent = false; //option for user to search through file content too
std::vector<std::string> VecSearchValue;
std::string to_be_searched = "";
for (uint64_t i = 2; i < argc; i++)
{
if (std::string(argv[i]) == std::string("-f"))
{
searchFolders = true;
debug_log << "Searching for Foldernames - Activated\n";
}
else if (std::string(argv[i]) == std::string("-F"))
{
searchFolders = true;
debug_log << "Searching for Foldernames - Activated\n";
}
else if (std::string(argv[i]) == std::string("-c"))
{
searchContent = true;
debug_log << "Searching in Filecontent - Activated\n";
}
else if (std::string(argv[i]) == std::string("-C"))
{
searchContent = true;
debug_log << "Searching in Filecontent - Activated\n";
}
}
std::cout << "Please provide your search Strings. Press Enter after every String. Empty Input == Continue with Search." << std::endl;
do
{
std::getline(std::cin, to_be_searched);
} while (!validateInputStringForInitialInput(to_be_searched, VecSearchValue));
for (auto& it : VecSearchValue)
{
std::cout << "Searching for: \"" << it << "\"\n";
}
#ifdef NDEBUG
{
//std::cout << std::string(argv[0]) << "\n";
//std::cout << std::string(argv[1]) << "\n";
//std::cout << std::string(argv[2]) << "\n";
//std::cout << std::string(argv[3]) << "\n";
//std::cout << searchFolders << "\n";
//std::cout << searchContent << "\n";
std::cout << "Mode:\n\t";
if (searchFolders)
std::cout << "Search for Foldernames.\n\t";
else
std::cout << "Searching for Foldernames - Deactivated\n\t";
if (searchContent)
std::cout << "Search in Filecontent.\n\t";
else
std::cout << "Searching in Filecontent - Deactivated\n\t";
startWinXSearch(std::filesystem::path(argv[1]), searchFolders, searchContent, VecSearchValue);
}
#endif
#ifndef NDEBUG
{
//std::cout << wide_string_to_string(std::wstring(argv[0]));
std::string s = "C:\\Users\\Kai\\Sciebo";
//s = "C:\\Program Files";
debug_log << "Start search in: \"" << std::filesystem::path(s).string() << "\"\n";
startWinXSearch(std::filesystem::path(s), 1, 0, VecSearchValue);
}
#endif
CoUninitialize();
}