diff options
author | FearlessTobi <thm.frey@gmail.com> | 2024-01-18 21:31:41 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-01-25 22:42:05 +0100 |
commit | cc09c265e15e9598844482a8b5a22b12650b3f1b (patch) | |
tree | efca7a933c1a599e04a0201e1657717d755a3248 /src/core/file_sys/vfs/vfs_real.h | |
parent | vfs: Move vfs files to their own directory (diff) | |
download | yuzu-cc09c265e15e9598844482a8b5a22b12650b3f1b.tar yuzu-cc09c265e15e9598844482a8b5a22b12650b3f1b.tar.gz yuzu-cc09c265e15e9598844482a8b5a22b12650b3f1b.tar.bz2 yuzu-cc09c265e15e9598844482a8b5a22b12650b3f1b.tar.lz yuzu-cc09c265e15e9598844482a8b5a22b12650b3f1b.tar.xz yuzu-cc09c265e15e9598844482a8b5a22b12650b3f1b.tar.zst yuzu-cc09c265e15e9598844482a8b5a22b12650b3f1b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/vfs/vfs_real.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/core/file_sys/vfs/vfs_real.h b/src/core/file_sys/vfs/vfs_real.h index 1560bc1f9..5c2172cce 100644 --- a/src/core/file_sys/vfs/vfs_real.h +++ b/src/core/file_sys/vfs/vfs_real.h @@ -8,7 +8,7 @@ #include <optional> #include <string_view> #include "common/intrusive_list.h" -#include "core/file_sys/mode.h" +#include "core/file_sys/fs_filesystem.h" #include "core/file_sys/vfs/vfs.h" namespace Common::FS { @@ -33,13 +33,14 @@ public: bool IsReadable() const override; bool IsWritable() const override; VfsEntryType GetEntryType(std::string_view path) const override; - VirtualFile OpenFile(std::string_view path, Mode perms = Mode::Read) override; - VirtualFile CreateFile(std::string_view path, Mode perms = Mode::ReadWrite) override; + VirtualFile OpenFile(std::string_view path, OpenMode perms = OpenMode::Read) override; + VirtualFile CreateFile(std::string_view path, OpenMode perms = OpenMode::ReadWrite) override; VirtualFile CopyFile(std::string_view old_path, std::string_view new_path) override; VirtualFile MoveFile(std::string_view old_path, std::string_view new_path) override; bool DeleteFile(std::string_view path) override; - VirtualDir OpenDirectory(std::string_view path, Mode perms = Mode::Read) override; - VirtualDir CreateDirectory(std::string_view path, Mode perms = Mode::ReadWrite) override; + VirtualDir OpenDirectory(std::string_view path, OpenMode perms = OpenMode::Read) override; + VirtualDir CreateDirectory(std::string_view path, + OpenMode perms = OpenMode::ReadWrite) override; VirtualDir CopyDirectory(std::string_view old_path, std::string_view new_path) override; VirtualDir MoveDirectory(std::string_view old_path, std::string_view new_path) override; bool DeleteDirectory(std::string_view path) override; @@ -54,14 +55,14 @@ private: private: friend class RealVfsFile; - std::unique_lock<std::mutex> RefreshReference(const std::string& path, Mode perms, + std::unique_lock<std::mutex> RefreshReference(const std::string& path, OpenMode perms, FileReference& reference); void DropReference(std::unique_ptr<FileReference>&& reference); private: friend class RealVfsDirectory; VirtualFile OpenFileFromEntry(std::string_view path, std::optional<u64> size, - Mode perms = Mode::Read); + OpenMode perms = OpenMode::Read); private: void EvictSingleReferenceLocked(); @@ -89,7 +90,8 @@ public: private: RealVfsFile(RealVfsFilesystem& base, std::unique_ptr<FileReference> reference, - const std::string& path, Mode perms = Mode::Read, std::optional<u64> size = {}); + const std::string& path, OpenMode perms = OpenMode::Read, + std::optional<u64> size = {}); RealVfsFilesystem& base; std::unique_ptr<FileReference> reference; @@ -97,7 +99,7 @@ private: std::string parent_path; std::vector<std::string> path_components; std::optional<u64> size; - Mode perms; + OpenMode perms; }; // An implementation of VfsDirectory that represents a directory on the user's computer. @@ -130,7 +132,8 @@ public: std::map<std::string, VfsEntryType, std::less<>> GetEntries() const override; private: - RealVfsDirectory(RealVfsFilesystem& base, const std::string& path, Mode perms = Mode::Read); + RealVfsDirectory(RealVfsFilesystem& base, const std::string& path, + OpenMode perms = OpenMode::Read); template <typename T, typename R> std::vector<std::shared_ptr<R>> IterateEntries() const; @@ -139,7 +142,7 @@ private: std::string path; std::string parent_path; std::vector<std::string> path_components; - Mode perms; + OpenMode perms; }; } // namespace FileSys |