Refactored handling of relative paths (#213)

This commit is contained in:
Bartek Kryza
2023-12-08 08:17:00 +01:00
parent f1d3695ccc
commit d7195d5a5d
130 changed files with 317 additions and 255 deletions

View File

@@ -404,6 +404,15 @@ std::filesystem::path ensure_path_is_absolute(
return result;
}
bool is_relative_to(
const std::filesystem::path &child, const std::filesystem::path &parent)
{
if (child.has_root_directory() != parent.has_root_directory())
return false;
return starts_with(child, parent);
}
std::string format_message_comment(const std::string &comment, unsigned width)
{
if (width == 0)