| 62 | } |
| 63 | |
| 64 | ResolvedPaths resolveSearchPaths( |
| 65 | const std::vector<std::filesystem::path>& current, |
| 66 | const std::vector<std::string>& update, |
| 67 | const std::vector<std::filesystem::path>& standard, |
| 68 | EnvVarResolver envResolver |
| 69 | ) |
| 70 | { |
| 71 | ResolvedPaths result; |
| 72 | |
| 73 | for (std::string it : update) |
| 74 | { |
| 75 | if (!resolveEnvVariables(it, envResolver)) |
| 76 | { |
| 77 | result.invalid.push_back(std::move(it)); |
| 78 | continue; |
| 79 | } |
| 80 | |
| 81 | std::vector<std::string> temp = splitString(it, ";"); |
| 82 | for (std::string& it2 : temp) |
| 83 | { |
| 84 | if (it2.empty()) |
| 85 | continue; |
| 86 | if (it2 == "&") |
| 87 | { |
| 88 | result.resolved.insert(result.resolved.end(), current.begin(), current.end()); |
| 89 | continue; |
| 90 | } |
| 91 | if (it2 == "@") |
| 92 | { |
| 93 | result.resolved.insert(result.resolved.end(), standard.begin(), standard.end()); |
| 94 | continue; |
| 95 | } |
| 96 | std::filesystem::path path = std::filesystem::weakly_canonical(it2); |
| 97 | if (path.is_absolute()) |
| 98 | result.resolved.push_back(std::move(path)); |
| 99 | else |
| 100 | result.invalid.push_back(std::move(it2)); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | return result; |
| 105 | } |
| 106 | |
| 107 | std::filesystem::path resolvePath( |
| 108 | const std::vector<std::filesystem::path>& searchPaths, |