diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2016-12-15 05:35:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-15 05:35:33 +0100 |
commit | 905fc92ce1f7d99d8819a17b180a559b3a9f15de (patch) | |
tree | cc992764c2ea065d8d30dce2055cc1efe167bc59 /src/core/hle/service/fs/archive.h | |
parent | Merge pull request #2166 from endrift/clang-detect (diff) | |
parent | Fixed the codestyle to match our clang-format rules. (diff) | |
download | yuzu-905fc92ce1f7d99d8819a17b180a559b3a9f15de.tar yuzu-905fc92ce1f7d99d8819a17b180a559b3a9f15de.tar.gz yuzu-905fc92ce1f7d99d8819a17b180a559b3a9f15de.tar.bz2 yuzu-905fc92ce1f7d99d8819a17b180a559b3a9f15de.tar.lz yuzu-905fc92ce1f7d99d8819a17b180a559b3a9f15de.tar.xz yuzu-905fc92ce1f7d99d8819a17b180a559b3a9f15de.tar.zst yuzu-905fc92ce1f7d99d8819a17b180a559b3a9f15de.zip |
Diffstat (limited to 'src/core/hle/service/fs/archive.h')
-rw-r--r-- | src/core/hle/service/fs/archive.h | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index 87089bd92..7ba62ede0 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h @@ -8,7 +8,7 @@ #include <string> #include "common/common_types.h" #include "core/file_sys/archive_backend.h" -#include "core/hle/kernel/session.h" +#include "core/hle/kernel/server_session.h" #include "core/hle/result.h" namespace FileSys { @@ -43,33 +43,37 @@ enum class MediaType : u32 { NAND = 0, SDMC = 1, GameCard = 2 }; typedef u64 ArchiveHandle; -class File : public Kernel::Session { +class File final : public SessionRequestHandler, public std::enable_shared_from_this<File> { public: File(std::unique_ptr<FileSys::FileBackend>&& backend, const FileSys::Path& path); ~File(); - std::string GetName() const override { + std::string GetName() const { return "Path: " + path.DebugStr(); } - ResultVal<bool> SyncRequest() override; FileSys::Path path; ///< Path of the file u32 priority; ///< Priority of the file. TODO(Subv): Find out what this means std::unique_ptr<FileSys::FileBackend> backend; ///< File backend interface + +protected: + void HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_session) override; }; -class Directory : public Kernel::Session { +class Directory final : public SessionRequestHandler { public: Directory(std::unique_ptr<FileSys::DirectoryBackend>&& backend, const FileSys::Path& path); ~Directory(); - std::string GetName() const override { + std::string GetName() const { return "Directory: " + path.DebugStr(); } - ResultVal<bool> SyncRequest() override; FileSys::Path path; ///< Path of the directory std::unique_ptr<FileSys::DirectoryBackend> backend; ///< File backend interface + +protected: + void HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_session) override; }; /** @@ -99,11 +103,11 @@ ResultCode RegisterArchiveType(std::unique_ptr<FileSys::ArchiveFactory>&& factor * @param archive_handle Handle to an open Archive object * @param path Path to the File inside of the Archive * @param mode Mode under which to open the File - * @return The opened File object as a Session + * @return The opened File object */ -ResultVal<Kernel::SharedPtr<File>> OpenFileFromArchive(ArchiveHandle archive_handle, - const FileSys::Path& path, - const FileSys::Mode mode); +ResultVal<std::shared_ptr<File>> OpenFileFromArchive(ArchiveHandle archive_handle, + const FileSys::Path& path, + const FileSys::Mode mode); /** * Delete a File from an Archive @@ -178,10 +182,10 @@ ResultCode RenameDirectoryBetweenArchives(ArchiveHandle src_archive_handle, * Open a Directory from an Archive * @param archive_handle Handle to an open Archive object * @param path Path to the Directory inside of the Archive - * @return The opened Directory object as a Session + * @return The opened Directory object */ -ResultVal<Kernel::SharedPtr<Directory>> OpenDirectoryFromArchive(ArchiveHandle archive_handle, - const FileSys::Path& path); +ResultVal<std::shared_ptr<Directory>> OpenDirectoryFromArchive(ArchiveHandle archive_handle, + const FileSys::Path& path); /** * Get the free space in an Archive |