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:
parent
0f8282489d
commit
d7075d73e5
2 changed files with 11 additions and 0 deletions
|
@ -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);
|
||||
|
|
10
ircd/fs.cc
10
ircd/fs.cc
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue