| 102 | } |
| 103 | |
| 104 | fs::path Path::MakeAbsolute(fs::path path, std::string_view token) const { |
| 105 | if (path.empty()) return path; |
| 106 | int idx = checked_find_token(token); |
| 107 | |
| 108 | path.make_preferred(); |
| 109 | const auto str = path.string(); |
| 110 | if (str.starts_with("?dummy") || str.starts_with("dummy-audio:")) |
| 111 | return path; |
| 112 | return (paths[idx].empty() || path.is_absolute()) ? path : paths[idx]/path; |
| 113 | } |
| 114 | |
| 115 | std::string Path::Encode(fs::path const& path) const { |
| 116 | // Find the shortest encoding of path made relative to each token |