Added getAllPaths() method to get combined results from stacked adapters.

This commit is contained in:
2025-03-02 20:02:03 +01:00
parent 3d0f5b9a3f
commit b6657189d3
5 changed files with 75 additions and 2 deletions

View File

@@ -84,8 +84,15 @@ public:
[[nodiscard]] virtual FileInfo getFileInfo(const fs::path& file) = 0;
[[nodiscard]] virtual Optional<fs::path> getNativePath(const fs::path& /* file */) { return NULL_OPTIONAL; }
[[nodiscard]] virtual StreamError open(const fs::path& path, FileOpenMode mode, std::unique_ptr<Stream>& outStream) = 0;
virtual void getAllPaths(const fs::path& path, std::vector<PathReference>& outPaths) { outPaths.push_back(getPath(path)); }
[[nodiscard]] PathReference getPath(fs::path path) MIJIN_NOEXCEPT { return PathReference(this, std::move(path)); }
[[nodiscard]] std::vector<PathReference> getAllPaths(const fs::path& path)
{
std::vector<PathReference> paths;
getAllPaths(path, paths);
return paths;
}
};
class OSFileSystemAdapter : public FileSystemAdapter