| 251 | } |
| 252 | |
| 253 | std::optional<std::string_view> RemoveAncestor(std::string_view ancestor, |
| 254 | std::string_view descendant) { |
| 255 | if (!IsAncestorOf(ancestor, descendant)) { |
| 256 | return std::nullopt; |
| 257 | } |
| 258 | |
| 259 | auto relative_to_ancestor = descendant.substr(ancestor.size()); |
| 260 | return RemoveLeadingSlash(relative_to_ancestor); |
| 261 | } |
| 262 | |
| 263 | std::vector<std::string> AncestorsFromBasePath(std::string_view base_path, |
| 264 | std::string_view descendant) { |
no test coverage detected