X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Futils.h;h=a52e37d8ed6f3321c748d5df793ce58c77b700e3;hp=df7bc76b8d5add12bae4cb3daae6cf4027d3a3a1;hb=e4584bf621f6ef457a944c7604888b4132ad1706;hpb=d16185720fa344263367dbd50c61bfc8183d99a4 diff --git a/source/fs/utils.h b/source/fs/utils.h index df7bc76..a52e37d 100644 --- a/source/fs/utils.h +++ b/source/fs/utils.h @@ -38,6 +38,9 @@ void rename(const Path &from, const Path &to); /// Makes a path relative to some base path. That is, base/result==path. Path relative(const Path &path, const Path &base); +/// Returns the longest prefix shared by both paths. +Path common_ancestor(const Path &, const Path &); + /** Determines how many levels a path is below another. Returns -1 if path is not a descendant of parent. */ int descendant_depth(const Path &path, const Path &parent);