| 460 | } |
| 461 | |
| 462 | void Options::initIndexFiltering(string blacklistFile1, string blacklistFile2, int threshold) { |
| 463 | if(blacklistFile1.empty() && blacklistFile2.empty()) |
| 464 | return; |
| 465 | |
| 466 | if(!blacklistFile1.empty()){ |
| 467 | check_file_valid(blacklistFile1); |
| 468 | indexFilter.blacklist1 = makeListFromFileByLine(blacklistFile1); |
| 469 | } |
| 470 | |
| 471 | if(!blacklistFile2.empty()){ |
| 472 | check_file_valid(blacklistFile2); |
| 473 | indexFilter.blacklist2 = makeListFromFileByLine(blacklistFile2); |
| 474 | } |
| 475 | |
| 476 | if(indexFilter.blacklist1.empty() && indexFilter.blacklist2.empty()) |
| 477 | return; |
| 478 | |
| 479 | indexFilter.enabled = true; |
| 480 | indexFilter.threshold = threshold; |
| 481 | } |
| 482 | |
| 483 | vector<string> Options::makeListFromFileByLine(string filename) { |
| 484 | vector<string> ret; |
no test coverage detected