Added getNativePath() method to get the OS version of a virtual path.

This commit is contained in:
2024-07-27 11:04:38 +02:00
parent 9b4425c495
commit e82c697d2e
5 changed files with 35 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ public:
fs::path getHomeFolder() override;
std::vector<FileInfo> listFiles(const fs::path& folder) override;
FileInfo getFileInfo(const fs::path& file) override;
Optional<fs::path> getNativePath(const fs::path& file) override;
StreamError open(const fs::path& path, FileOpenMode mode, std::unique_ptr<Stream>& outStream) override;
private:
fs::path appendPath(const fs::path& other) const noexcept;
@@ -80,6 +81,12 @@ FileInfo RelativeFileSystemAdapter<TWrapped>::getFileInfo(const fs::path& file)
return wrapped_.getFileInfo(appendPath(file));
}
template<typename TWrapped>
Optional<fs::path> RelativeFileSystemAdapter<TWrapped>::getNativePath(const fs::path& file)
{
return wrapped_.getNativePath(appendPath(file));
}
template<typename TWrapped>
StreamError RelativeFileSystemAdapter<TWrapped>::open(const fs::path& path, FileOpenMode mode, std::unique_ptr<Stream>& outStream)
{