added Path::join utility method

This commit is contained in:
Noel Berry 2021-01-14 18:42:12 -08:00
parent 261e2fd5e7
commit 69e5e7447b
2 changed files with 12 additions and 0 deletions

View File

@ -37,5 +37,12 @@ namespace Blah
FilePath get_path_after(const FilePath& path, const FilePath& after);
FilePath get_directory_name(const FilePath& path);
FilePath normalize(const FilePath& path);
FilePath join(const FilePath& a, const FilePath& b);
template<typename ... Args>
FilePath join(const FilePath& a, const FilePath& b, const Args&... args)
{
return join(a, join(b, args...));
}
}
}

View File

@ -133,4 +133,9 @@ FilePath Path::normalize(const FilePath& path)
}
return normalized;
}
FilePath Path::join(const FilePath& a, const FilePath& b)
{
return normalize(FilePath(a).append("/").append(b));
}