X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffs%2Futils.h;h=a52e37d8ed6f3321c748d5df793ce58c77b700e3;hb=c750a22da0df0b54af78374fd66ad1a055327e34;hp=df7bc76b8d5add12bae4cb3daae6cf4027d3a3a1;hpb=eeb6ed7b20d56578ff8c68f3c94e887d5ac768ee;p=libs%2Fcore.git 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);