mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-12-15 23:35:38 +00:00
vfs: Use RealVfsFilesystem for fs-operations in RealVfsDirectory
This commit is contained in:
parent
52a2e42cb9
commit
656e97df16
|
@ -74,6 +74,13 @@ class RealVfsDirectory : public VfsDirectory {
|
||||||
RealVfsDirectory(RealVfsFilesystem& base, const std::string& path, Mode perms = Mode::Read);
|
RealVfsDirectory(RealVfsFilesystem& base, const std::string& path, Mode perms = Mode::Read);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
std::shared_ptr<VfsFile> GetFileRelative(std::string_view path) const override;
|
||||||
|
std::shared_ptr<VfsDirectory> GetDirectoryRelative(std::string_view path) const override;
|
||||||
|
std::shared_ptr<VfsFile> GetFile(std::string_view name) const override;
|
||||||
|
std::shared_ptr<VfsDirectory> GetSubdirectory(std::string_view name) const override;
|
||||||
|
std::shared_ptr<VfsFile> CreateFileRelative(std::string_view path) override;
|
||||||
|
std::shared_ptr<VfsDirectory> CreateDirectoryRelative(std::string_view path) override;
|
||||||
|
bool DeleteSubdirectoryRecursive(std::string_view name) override;
|
||||||
std::vector<std::shared_ptr<VfsFile>> GetFiles() const override;
|
std::vector<std::shared_ptr<VfsFile>> GetFiles() const override;
|
||||||
std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const override;
|
std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const override;
|
||||||
bool IsWritable() const override;
|
bool IsWritable() const override;
|
||||||
|
@ -91,14 +98,15 @@ protected:
|
||||||
bool ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) override;
|
bool ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
template <typename T, typename R>
|
||||||
|
std::vector<std::shared_ptr<R>> IterateEntries() const;
|
||||||
|
|
||||||
RealVfsFilesystem& base;
|
RealVfsFilesystem& base;
|
||||||
std::string path;
|
std::string path;
|
||||||
std::string parent_path;
|
std::string parent_path;
|
||||||
std::vector<std::string> path_components;
|
std::vector<std::string> path_components;
|
||||||
std::vector<std::string> parent_components;
|
std::vector<std::string> parent_components;
|
||||||
Mode perms;
|
Mode perms;
|
||||||
std::vector<std::shared_ptr<VfsFile>> files;
|
|
||||||
std::vector<std::shared_ptr<VfsDirectory>> subdirectories;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace FileSys
|
} // namespace FileSys
|
||||||
|
|
Loading…
Reference in a new issue