| 416 | } |
| 417 | |
| 418 | std::vector<fs::path> parse_input_paths(fs::path const &inputFilePath) |
| 419 | { |
| 420 | std::ifstream input_paths_stream(inputFilePath); |
| 421 | if (!input_paths_stream.is_open()) { |
| 422 | displayMessage("Could not open file: {}", inputFilePath.generic_string()); |
| 423 | return {}; |
| 424 | } |
| 425 | std::vector<fs::path> input_paths; |
| 426 | std::string line; |
| 427 | while (std::getline(input_paths_stream, line)) { |
| 428 | if (line.empty()) { |
| 429 | continue; |
| 430 | } |
| 431 | fs::path input_file{line}; |
| 432 | if (!fs::is_regular_file(input_file)) { |
| 433 | // Fall back on searching in the same directory as the lstfile |
| 434 | input_file = inputFilePath.parent_path() / input_file; |
| 435 | if (!fs::is_regular_file(input_file)) { |
| 436 | displayMessage("Input file does not exist: {}", line); |
| 437 | continue; |
| 438 | } |
| 439 | } |
| 440 | input_paths.emplace_back(std::move(input_file)); |
| 441 | } |
| 442 | return input_paths; |
| 443 | } |
| 444 | |
| 445 | int main(int argc, char **argv) |
| 446 | { |
no test coverage detected