diff options
| -rw-r--r-- | src/core/file_sys/archive_backend.h | 17 | ||||
| -rw-r--r-- | src/core/file_sys/disk_archive.h | 2 | ||||
| -rw-r--r-- | src/core/file_sys/ivfc_archive.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/cfg/cfg.cpp | 5 | ||||
| -rw-r--r-- | src/core/hle/service/fs/archive.cpp | 10 | ||||
| -rw-r--r-- | src/core/hle/service/fs/archive.h | 16 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm.cpp | 3 |
7 files changed, 35 insertions, 20 deletions
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 43a106549..1956d76cb 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h | |||
| @@ -5,22 +5,25 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <sstream> | ||
| 9 | #include <string> | ||
| 10 | #include <utility> | ||
| 11 | #include <vector> | ||
| 8 | 12 | ||
| 13 | #include "common/bit_field.h" | ||
| 9 | #include "common/common_types.h" | 14 | #include "common/common_types.h" |
| 15 | #include "common/logging/log.h" | ||
| 10 | #include "common/string_util.h" | 16 | #include "common/string_util.h" |
| 11 | #include "common/bit_field.h" | ||
| 12 | |||
| 13 | #include "core/file_sys/file_backend.h" | ||
| 14 | #include "core/file_sys/directory_backend.h" | ||
| 15 | 17 | ||
| 18 | #include "core/hle/result.h" | ||
| 16 | #include "core/mem_map.h" | 19 | #include "core/mem_map.h" |
| 17 | #include "core/hle/kernel/kernel.h" | ||
| 18 | 20 | ||
| 19 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 20 | // FileSys namespace | ||
| 21 | 21 | ||
| 22 | namespace FileSys { | 22 | namespace FileSys { |
| 23 | 23 | ||
| 24 | class FileBackend; | ||
| 25 | class DirectoryBackend; | ||
| 26 | |||
| 24 | // Path string type | 27 | // Path string type |
| 25 | enum LowPathType : u32 { | 28 | enum LowPathType : u32 { |
| 26 | Invalid = 0, | 29 | Invalid = 0, |
diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index 770bd715e..a22d3837a 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | #include "common/file_util.h" | 8 | #include "common/file_util.h" |
| 9 | 9 | ||
| 10 | #include "core/file_sys/archive_backend.h" | 10 | #include "core/file_sys/archive_backend.h" |
| 11 | #include "core/file_sys/directory_backend.h" | ||
| 12 | #include "core/file_sys/file_backend.h" | ||
| 11 | #include "core/loader/loader.h" | 13 | #include "core/loader/loader.h" |
| 12 | 14 | ||
| 13 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 15 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h index 1aff9e0a4..10415798d 100644 --- a/src/core/file_sys/ivfc_archive.h +++ b/src/core/file_sys/ivfc_archive.h | |||
| @@ -10,6 +10,8 @@ | |||
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | 11 | ||
| 12 | #include "core/file_sys/archive_backend.h" | 12 | #include "core/file_sys/archive_backend.h" |
| 13 | #include "core/file_sys/directory_backend.h" | ||
| 14 | #include "core/file_sys/file_backend.h" | ||
| 13 | #include "core/loader/loader.h" | 15 | #include "core/loader/loader.h" |
| 14 | 16 | ||
| 15 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 17 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index 5eccdecf7..94bac5498 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp | |||
| @@ -4,12 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | 6 | ||
| 7 | #include "core/hle/service/fs/archive.h" | 7 | #include "core/file_sys/file_backend.h" |
| 8 | #include "core/hle/service/service.h" | ||
| 9 | #include "core/hle/service/cfg/cfg.h" | 8 | #include "core/hle/service/cfg/cfg.h" |
| 10 | #include "core/hle/service/cfg/cfg_i.h" | 9 | #include "core/hle/service/cfg/cfg_i.h" |
| 11 | #include "core/hle/service/cfg/cfg_s.h" | 10 | #include "core/hle/service/cfg/cfg_s.h" |
| 12 | #include "core/hle/service/cfg/cfg_u.h" | 11 | #include "core/hle/service/cfg/cfg_u.h" |
| 12 | #include "core/hle/service/fs/archive.h" | ||
| 13 | #include "core/hle/service/service.h" | ||
| 13 | 14 | ||
| 14 | namespace Service { | 15 | namespace Service { |
| 15 | namespace CFG { | 16 | namespace CFG { |
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index b0fd834c7..a6ed08929 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp | |||
| @@ -78,6 +78,11 @@ enum class DirectoryCommand : u32 { | |||
| 78 | Close = 0x08020000, | 78 | Close = 0x08020000, |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | File::File(std::unique_ptr<FileSys::FileBackend>&& backend, const FileSys::Path & path) | ||
| 82 | : path(path), priority(0), backend(std::move(backend)) {} | ||
| 83 | |||
| 84 | File::~File() {} | ||
| 85 | |||
| 81 | ResultVal<bool> File::SyncRequest() { | 86 | ResultVal<bool> File::SyncRequest() { |
| 82 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 87 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 83 | FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]); | 88 | FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]); |
| @@ -172,6 +177,11 @@ ResultVal<bool> File::SyncRequest() { | |||
| 172 | return MakeResult<bool>(false); | 177 | return MakeResult<bool>(false); |
| 173 | } | 178 | } |
| 174 | 179 | ||
| 180 | Directory::Directory(std::unique_ptr<FileSys::DirectoryBackend>&& backend, const FileSys::Path & path) | ||
| 181 | : path(path), backend(std::move(backend)) {} | ||
| 182 | |||
| 183 | Directory::~Directory() {} | ||
| 184 | |||
| 175 | ResultVal<bool> Directory::SyncRequest() { | 185 | ResultVal<bool> Directory::SyncRequest() { |
| 176 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 186 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 177 | DirectoryCommand cmd = static_cast<DirectoryCommand>(cmd_buff[0]); | 187 | DirectoryCommand cmd = static_cast<DirectoryCommand>(cmd_buff[0]); |
diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index b00f0fd60..faab0cb79 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h | |||
| @@ -45,31 +45,27 @@ typedef u64 ArchiveHandle; | |||
| 45 | 45 | ||
| 46 | class File : public Kernel::Session { | 46 | class File : public Kernel::Session { |
| 47 | public: | 47 | public: |
| 48 | File(std::unique_ptr<FileSys::FileBackend>&& backend, const FileSys::Path& path) | 48 | File(std::unique_ptr<FileSys::FileBackend>&& backend, const FileSys::Path& path); |
| 49 | : path(path), priority(0), backend(std::move(backend)) { | 49 | ~File(); |
| 50 | } | ||
| 51 | 50 | ||
| 52 | std::string GetName() const override { return "Path: " + path.DebugStr(); } | 51 | std::string GetName() const override { return "Path: " + path.DebugStr(); } |
| 52 | ResultVal<bool> SyncRequest() override; | ||
| 53 | 53 | ||
| 54 | FileSys::Path path; ///< Path of the file | 54 | FileSys::Path path; ///< Path of the file |
| 55 | u32 priority; ///< Priority of the file. TODO(Subv): Find out what this means | 55 | u32 priority; ///< Priority of the file. TODO(Subv): Find out what this means |
| 56 | std::unique_ptr<FileSys::FileBackend> backend; ///< File backend interface | 56 | std::unique_ptr<FileSys::FileBackend> backend; ///< File backend interface |
| 57 | |||
| 58 | ResultVal<bool> SyncRequest() override; | ||
| 59 | }; | 57 | }; |
| 60 | 58 | ||
| 61 | class Directory : public Kernel::Session { | 59 | class Directory : public Kernel::Session { |
| 62 | public: | 60 | public: |
| 63 | Directory(std::unique_ptr<FileSys::DirectoryBackend>&& backend, const FileSys::Path& path) | 61 | Directory(std::unique_ptr<FileSys::DirectoryBackend>&& backend, const FileSys::Path& path); |
| 64 | : path(path), backend(std::move(backend)) { | 62 | ~Directory(); |
| 65 | } | ||
| 66 | 63 | ||
| 67 | std::string GetName() const override { return "Directory: " + path.DebugStr(); } | 64 | std::string GetName() const override { return "Directory: " + path.DebugStr(); } |
| 65 | ResultVal<bool> SyncRequest() override; | ||
| 68 | 66 | ||
| 69 | FileSys::Path path; ///< Path of the directory | 67 | FileSys::Path path; ///< Path of the directory |
| 70 | std::unique_ptr<FileSys::DirectoryBackend> backend; ///< File backend interface | 68 | std::unique_ptr<FileSys::DirectoryBackend> backend; ///< File backend interface |
| 71 | |||
| 72 | ResultVal<bool> SyncRequest() override; | ||
| 73 | }; | 69 | }; |
| 74 | 70 | ||
| 75 | /** | 71 | /** |
diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index d44510c1b..6480a323d 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp | |||
| @@ -2,12 +2,13 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/hle/service/service.h" | 5 | #include "core/file_sys/file_backend.h" |
| 6 | #include "core/hle/service/fs/archive.h" | 6 | #include "core/hle/service/fs/archive.h" |
| 7 | #include "core/hle/service/ptm/ptm.h" | 7 | #include "core/hle/service/ptm/ptm.h" |
| 8 | #include "core/hle/service/ptm/ptm_play.h" | 8 | #include "core/hle/service/ptm/ptm_play.h" |
| 9 | #include "core/hle/service/ptm/ptm_sysm.h" | 9 | #include "core/hle/service/ptm/ptm_sysm.h" |
| 10 | #include "core/hle/service/ptm/ptm_u.h" | 10 | #include "core/hle/service/ptm/ptm_u.h" |
| 11 | #include "core/hle/service/service.h" | ||
| 11 | 12 | ||
| 12 | namespace Service { | 13 | namespace Service { |
| 13 | namespace PTM { | 14 | namespace PTM { |