MCPcopy Create free account
hub / github.com/bananabr/TimeException / main

Function main

TimeException.cpp:145–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145int main(int argc, char** argv)
146{
147 auto args = argvToMap(argc, argv);
148 if (args.count("-h") || args.count("--help")) {
149 printUsage();
150 return 0;
151 }
152
153 vector<vector<char>> sampleSet = {};
154 vector<long long int> localResultSet = {};
155 vector<double> globalResultSet = {};
156 vector<string> paths = {};
157 //std::filesystem::path basepath = argv[1];
158 size_t sample_size = MIN_SAMPLE_SIZE;
159 double sensitivity = DEFAULT_SENSITIVITY;
160 int opMode = BENCH_MODE;
161 ifstream targetsFile;
162 double ref = 0;
163 bool verbose = false;
164 string benchmarker = argv[0];
165
166 if (args.count("--verbose")) {
167 verbose = true;
168 }
169
170 if (args.count("--mode")) {
171 switch (stoi(args["--mode"])) {
172 case DIR_MODE:
173 opMode = DIR_MODE;
174 break;
175 case EXT_MODE:
176 opMode = EXT_MODE;
177 break;
178 case PROC_MODE:
179 opMode = PROC_MODE;
180 break;
181 case FILE_MODE:
182 cerr << "[-] File mode is not implemented yet!" << endl;
183 return 1;
184 break;
185 case BENCH_MODE:
186 opMode = BENCH_MODE;
187 break;
188 default:
189 printUsage();
190 return 1;
191 }
192 }
193
194 if (args.count("--ref")) {
195 ref = stod(args["--ref"]);
196 }
197
198 if (opMode != BENCH_MODE) {
199 if (args.count("--targets")) {
200 targetsFile.open(args["--targets"], ios_base::in);
201 if (!targetsFile.is_open())
202 {

Callers

nothing calls this directly

Calls 8

argvToMapFunction · 0.85
printUsageFunction · 0.85
getRandomBytesFunction · 0.85
getUuidFunction · 0.85
timeFileWriteFunction · 0.85
TRIMMEANFunction · 0.85
getBenchmarkResultFunction · 0.85
getAverageFunction · 0.85

Tested by

no test coverage detected