From a40537314405d62baa012836da9bba24ad4b02e5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 2 Sep 2018 10:53:06 -0400 Subject: vfs_real: Forward declare IOFile Eliminates the need to rebuild some source files if the file_util header ever changes. This also uncovered some indirect inclusions, which have also been fixed. --- src/core/file_sys/vfs_real.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/core/file_sys/vfs_real.h') diff --git a/src/core/file_sys/vfs_real.h b/src/core/file_sys/vfs_real.h index 989803d43..7db86691f 100644 --- a/src/core/file_sys/vfs_real.h +++ b/src/core/file_sys/vfs_real.h @@ -6,15 +6,19 @@ #include #include -#include "common/file_util.h" #include "core/file_sys/mode.h" #include "core/file_sys/vfs.h" +namespace FileUtil { +class IOFile; +} + namespace FileSys { class RealVfsFilesystem : public VfsFilesystem { public: RealVfsFilesystem(); + ~RealVfsFilesystem() override; std::string GetName() const override; bool IsReadable() const override; @@ -40,10 +44,9 @@ class RealVfsFile : public VfsFile { friend class RealVfsDirectory; friend class RealVfsFilesystem; - RealVfsFile(RealVfsFilesystem& base, std::shared_ptr backing, - const std::string& path, Mode perms = Mode::Read); - public: + ~RealVfsFile() override; + std::string GetName() const override; size_t GetSize() const override; bool Resize(size_t new_size) override; @@ -55,6 +58,9 @@ public: bool Rename(std::string_view name) override; private: + RealVfsFile(RealVfsFilesystem& base, std::shared_ptr backing, + const std::string& path, Mode perms = Mode::Read); + bool Close(); RealVfsFilesystem& base; @@ -70,9 +76,9 @@ private: class RealVfsDirectory : public VfsDirectory { friend class RealVfsFilesystem; - RealVfsDirectory(RealVfsFilesystem& base, const std::string& path, Mode perms = Mode::Read); - public: + ~RealVfsDirectory() override; + std::shared_ptr GetFileRelative(std::string_view path) const override; std::shared_ptr GetDirectoryRelative(std::string_view path) const override; std::shared_ptr GetFile(std::string_view name) const override; @@ -97,6 +103,8 @@ protected: bool ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) override; private: + RealVfsDirectory(RealVfsFilesystem& base, const std::string& path, Mode perms = Mode::Read); + template std::vector> IterateEntries() const; -- cgit v1.2.3