fs/Path: add operator/(Path,Path)

Modeled after std::filesystem::operator/() from C++17.
This commit is contained in:
Max Kellermann
2018-07-17 17:01:02 +02:00
parent 79e89eb23b
commit 99d5b61698
14 changed files with 40 additions and 32 deletions

View File

@@ -114,8 +114,7 @@ LocalStorage::MapFSOrThrow(const char *uri_utf8) const
if (StringIsEmpty(uri_utf8))
return base_fs;
return AllocatedPath::Build(base_fs,
AllocatedPath::FromUTF8Throw(uri_utf8));
return base_fs / AllocatedPath::FromUTF8Throw(uri_utf8);
}
AllocatedPath
@@ -176,7 +175,7 @@ LocalDirectoryReader::Read() noexcept
StorageFileInfo
LocalDirectoryReader::GetInfo(bool follow)
{
return Stat(AllocatedPath::Build(base_fs, reader.GetEntry()), follow);
return Stat(base_fs / reader.GetEntry(), follow);
}
std::unique_ptr<Storage>