MCPcopy Create free account
hub / github.com/NatLabRockies/EnergyPlus / parse_input_paths

Function parse_input_paths

src/ConvertInputFormat/main.cpp:418–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416}
417
418std::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
445int main(int argc, char **argv)
446{

Callers 1

mainFunction · 0.85

Calls 2

displayMessageFunction · 0.85
is_openMethod · 0.80

Tested by

no test coverage detected