X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Futils.h;h=6a4c55add16f7ec305d40341d7f65fe48d65710b;hp=c582c2217ba7b489bbd43fb0801904ffb134c013;hb=fa77438b62207466c48620604c8cc34931080936;hpb=aa31c2bbb399ded6493f7edc419b1a500ed25895 diff --git a/source/utils.h b/source/utils.h index c582c22..6a4c55a 100644 --- a/source/utils.h +++ b/source/utils.h @@ -52,6 +52,10 @@ 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); +/** 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); + } // namespace FS } // namespace Msp