diff options
author | FearlessTobi <thm.frey@gmail.com> | 2024-01-16 06:23:01 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-01-25 22:40:42 +0100 |
commit | 0f9288e38d80c6c63a545934557501fae40d3d83 (patch) | |
tree | 0643100d2471a1545dbfb447319b6ea26fdd6b63 /src/core/file_sys/vfs/vfs_cached.h | |
parent | fs: Move fsp_srv subclasses to separate files (diff) | |
download | yuzu-0f9288e38d80c6c63a545934557501fae40d3d83.tar yuzu-0f9288e38d80c6c63a545934557501fae40d3d83.tar.gz yuzu-0f9288e38d80c6c63a545934557501fae40d3d83.tar.bz2 yuzu-0f9288e38d80c6c63a545934557501fae40d3d83.tar.lz yuzu-0f9288e38d80c6c63a545934557501fae40d3d83.tar.xz yuzu-0f9288e38d80c6c63a545934557501fae40d3d83.tar.zst yuzu-0f9288e38d80c6c63a545934557501fae40d3d83.zip |
Diffstat (limited to 'src/core/file_sys/vfs/vfs_cached.h')
-rw-r--r-- | src/core/file_sys/vfs/vfs_cached.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/core/file_sys/vfs/vfs_cached.h b/src/core/file_sys/vfs/vfs_cached.h new file mode 100644 index 000000000..47dff7224 --- /dev/null +++ b/src/core/file_sys/vfs/vfs_cached.h @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include <string_view> +#include <vector> +#include "core/file_sys/vfs/vfs.h" + +namespace FileSys { + +class CachedVfsDirectory : public ReadOnlyVfsDirectory { +public: + CachedVfsDirectory(VirtualDir&& source_directory); + + ~CachedVfsDirectory() override; + VirtualFile GetFile(std::string_view file_name) const override; + VirtualDir GetSubdirectory(std::string_view dir_name) const override; + std::vector<VirtualFile> GetFiles() const override; + std::vector<VirtualDir> GetSubdirectories() const override; + std::string GetName() const override; + VirtualDir GetParentDirectory() const override; + +private: + std::string name; + VirtualDir parent; + std::map<std::string, VirtualDir, std::less<>> dirs; + std::map<std::string, VirtualFile, std::less<>> files; +}; + +} // namespace FileSys |