mirror of
https://github.com/NoelFB/blah.git
synced 2025-04-11 01:26:05 +08:00
added Path::join utility method
This commit is contained in:
parent
261e2fd5e7
commit
69e5e7447b
@ -37,5 +37,12 @@ namespace Blah
|
|||||||
FilePath get_path_after(const FilePath& path, const FilePath& after);
|
FilePath get_path_after(const FilePath& path, const FilePath& after);
|
||||||
FilePath get_directory_name(const FilePath& path);
|
FilePath get_directory_name(const FilePath& path);
|
||||||
FilePath normalize(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...));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -133,4 +133,9 @@ FilePath Path::normalize(const FilePath& path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return normalized;
|
return normalized;
|
||||||
|
}
|
||||||
|
|
||||||
|
FilePath Path::join(const FilePath& a, const FilePath& b)
|
||||||
|
{
|
||||||
|
return normalize(FilePath(a).append("/").append(b));
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user