0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::fs: Additional make_path() overload.

This commit is contained in:
Jason Volk 2018-08-17 10:20:40 -07:00
parent 0f8282489d
commit d7075d73e5
2 changed files with 11 additions and 0 deletions

View file

@ -48,6 +48,7 @@ namespace ircd::fs
string_view get(index) noexcept;
string_view name(index) noexcept;
std::string make_path(const vector_view<const string_view> &);
std::string make_path(const vector_view<const std::string> &);
bool exists(const string_view &path);
bool is_dir(const string_view &path);

View file

@ -703,6 +703,16 @@ catch(const filesystem::filesystem_error &e)
};
}
std::string
ircd::fs::make_path(const vector_view<const std::string> &list)
{
filesystem::path ret;
for(const auto &s : list)
ret /= path(s);
return ret.string();
}
std::string
ircd::fs::make_path(const vector_view<const string_view> &list)
{