diff options
| author | 2024-01-18 21:31:41 +0100 | |
|---|---|---|
| committer | 2024-01-25 16:42:05 -0500 | |
| commit | cc09c265e15e9598844482a8b5a22b12650b3f1b (patch) | |
| tree | efca7a933c1a599e04a0201e1657717d755a3248 /src/core/hle/service/filesystem | |
| parent | vfs: Move vfs files to their own directory (diff) | |
| download | yuzu-cc09c265e15e9598844482a8b5a22b12650b3f1b.tar.gz yuzu-cc09c265e15e9598844482a8b5a22b12650b3f1b.tar.xz yuzu-cc09c265e15e9598844482a8b5a22b12650b3f1b.zip | |
fs: Replace Mode enum by OpenMode enum
Diffstat (limited to 'src/core/hle/service/filesystem')
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 30 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 15 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fs_i_directory.cpp | 26 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fs_i_directory.h | 7 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fs_i_file.h | 1 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp | 10 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fsp_srv.cpp | 8 |
7 files changed, 47 insertions, 50 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 4ae6ef0bd..eb8c3c23e 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | #include "core/file_sys/card_image.h" | 12 | #include "core/file_sys/card_image.h" |
| 13 | #include "core/file_sys/control_metadata.h" | 13 | #include "core/file_sys/control_metadata.h" |
| 14 | #include "core/file_sys/errors.h" | 14 | #include "core/file_sys/errors.h" |
| 15 | #include "core/file_sys/mode.h" | ||
| 16 | #include "core/file_sys/patch_manager.h" | 15 | #include "core/file_sys/patch_manager.h" |
| 17 | #include "core/file_sys/registered_cache.h" | 16 | #include "core/file_sys/registered_cache.h" |
| 18 | #include "core/file_sys/romfs_factory.h" | 17 | #include "core/file_sys/romfs_factory.h" |
| @@ -56,7 +55,7 @@ Result VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64 size | |||
| 56 | return FileSys::ERROR_PATH_NOT_FOUND; | 55 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 57 | } | 56 | } |
| 58 | 57 | ||
| 59 | FileSys::EntryType entry_type{}; | 58 | FileSys::DirectoryEntryType entry_type{}; |
| 60 | if (GetEntryType(&entry_type, path) == ResultSuccess) { | 59 | if (GetEntryType(&entry_type, path) == ResultSuccess) { |
| 61 | return FileSys::ERROR_PATH_ALREADY_EXISTS; | 60 | return FileSys::ERROR_PATH_ALREADY_EXISTS; |
| 62 | } | 61 | } |
| @@ -214,7 +213,8 @@ Result VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_path_, | |||
| 214 | } | 213 | } |
| 215 | 214 | ||
| 216 | Result VfsDirectoryServiceWrapper::OpenFile(FileSys::VirtualFile* out_file, | 215 | Result VfsDirectoryServiceWrapper::OpenFile(FileSys::VirtualFile* out_file, |
| 217 | const std::string& path_, FileSys::Mode mode) const { | 216 | const std::string& path_, |
| 217 | FileSys::OpenMode mode) const { | ||
| 218 | const std::string path(Common::FS::SanitizePath(path_)); | 218 | const std::string path(Common::FS::SanitizePath(path_)); |
| 219 | std::string_view npath = path; | 219 | std::string_view npath = path; |
| 220 | while (!npath.empty() && (npath[0] == '/' || npath[0] == '\\')) { | 220 | while (!npath.empty() && (npath[0] == '/' || npath[0] == '\\')) { |
| @@ -226,7 +226,7 @@ Result VfsDirectoryServiceWrapper::OpenFile(FileSys::VirtualFile* out_file, | |||
| 226 | return FileSys::ERROR_PATH_NOT_FOUND; | 226 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | if (mode == FileSys::Mode::Append) { | 229 | if (mode == FileSys::OpenMode::AllowAppend) { |
| 230 | *out_file = std::make_shared<FileSys::OffsetVfsFile>(file, 0, file->GetSize()); | 230 | *out_file = std::make_shared<FileSys::OffsetVfsFile>(file, 0, file->GetSize()); |
| 231 | } else { | 231 | } else { |
| 232 | *out_file = file; | 232 | *out_file = file; |
| @@ -247,7 +247,7 @@ Result VfsDirectoryServiceWrapper::OpenDirectory(FileSys::VirtualDir* out_direct | |||
| 247 | return ResultSuccess; | 247 | return ResultSuccess; |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | Result VfsDirectoryServiceWrapper::GetEntryType(FileSys::EntryType* out_entry_type, | 250 | Result VfsDirectoryServiceWrapper::GetEntryType(FileSys::DirectoryEntryType* out_entry_type, |
| 251 | const std::string& path_) const { | 251 | const std::string& path_) const { |
| 252 | std::string path(Common::FS::SanitizePath(path_)); | 252 | std::string path(Common::FS::SanitizePath(path_)); |
| 253 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); | 253 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); |
| @@ -258,17 +258,17 @@ Result VfsDirectoryServiceWrapper::GetEntryType(FileSys::EntryType* out_entry_ty | |||
| 258 | auto filename = Common::FS::GetFilename(path); | 258 | auto filename = Common::FS::GetFilename(path); |
| 259 | // TODO(Subv): Some games use the '/' path, find out what this means. | 259 | // TODO(Subv): Some games use the '/' path, find out what this means. |
| 260 | if (filename.empty()) { | 260 | if (filename.empty()) { |
| 261 | *out_entry_type = FileSys::EntryType::Directory; | 261 | *out_entry_type = FileSys::DirectoryEntryType::Directory; |
| 262 | return ResultSuccess; | 262 | return ResultSuccess; |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | if (dir->GetFile(filename) != nullptr) { | 265 | if (dir->GetFile(filename) != nullptr) { |
| 266 | *out_entry_type = FileSys::EntryType::File; | 266 | *out_entry_type = FileSys::DirectoryEntryType::File; |
| 267 | return ResultSuccess; | 267 | return ResultSuccess; |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | if (dir->GetSubdirectory(filename) != nullptr) { | 270 | if (dir->GetSubdirectory(filename) != nullptr) { |
| 271 | *out_entry_type = FileSys::EntryType::Directory; | 271 | *out_entry_type = FileSys::DirectoryEntryType::Directory; |
| 272 | return ResultSuccess; | 272 | return ResultSuccess; |
| 273 | } | 273 | } |
| 274 | 274 | ||
| @@ -282,7 +282,7 @@ Result VfsDirectoryServiceWrapper::GetFileTimeStampRaw( | |||
| 282 | return FileSys::ERROR_PATH_NOT_FOUND; | 282 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 283 | } | 283 | } |
| 284 | 284 | ||
| 285 | FileSys::EntryType entry_type; | 285 | FileSys::DirectoryEntryType entry_type; |
| 286 | if (GetEntryType(&entry_type, path) != ResultSuccess) { | 286 | if (GetEntryType(&entry_type, path) != ResultSuccess) { |
| 287 | return FileSys::ERROR_PATH_NOT_FOUND; | 287 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 288 | } | 288 | } |
| @@ -347,7 +347,7 @@ std::shared_ptr<SaveDataController> FileSystemController::OpenSaveDataController | |||
| 347 | std::shared_ptr<FileSys::SaveDataFactory> FileSystemController::CreateSaveDataFactory( | 347 | std::shared_ptr<FileSys::SaveDataFactory> FileSystemController::CreateSaveDataFactory( |
| 348 | ProgramId program_id) { | 348 | ProgramId program_id) { |
| 349 | using YuzuPath = Common::FS::YuzuPath; | 349 | using YuzuPath = Common::FS::YuzuPath; |
| 350 | const auto rw_mode = FileSys::Mode::ReadWrite; | 350 | const auto rw_mode = FileSys::OpenMode::ReadWrite; |
| 351 | 351 | ||
| 352 | auto vfs = system.GetFilesystem(); | 352 | auto vfs = system.GetFilesystem(); |
| 353 | const auto nand_directory = | 353 | const auto nand_directory = |
| @@ -686,15 +686,15 @@ void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool ove | |||
| 686 | using YuzuPath = Common::FS::YuzuPath; | 686 | using YuzuPath = Common::FS::YuzuPath; |
| 687 | const auto sdmc_dir_path = Common::FS::GetYuzuPath(YuzuPath::SDMCDir); | 687 | const auto sdmc_dir_path = Common::FS::GetYuzuPath(YuzuPath::SDMCDir); |
| 688 | const auto sdmc_load_dir_path = sdmc_dir_path / "atmosphere/contents"; | 688 | const auto sdmc_load_dir_path = sdmc_dir_path / "atmosphere/contents"; |
| 689 | const auto rw_mode = FileSys::Mode::ReadWrite; | 689 | const auto rw_mode = FileSys::OpenMode::ReadWrite; |
| 690 | 690 | ||
| 691 | auto nand_directory = | 691 | auto nand_directory = |
| 692 | vfs.OpenDirectory(Common::FS::GetYuzuPathString(YuzuPath::NANDDir), rw_mode); | 692 | vfs.OpenDirectory(Common::FS::GetYuzuPathString(YuzuPath::NANDDir), rw_mode); |
| 693 | auto sd_directory = vfs.OpenDirectory(Common::FS::PathToUTF8String(sdmc_dir_path), rw_mode); | 693 | auto sd_directory = vfs.OpenDirectory(Common::FS::PathToUTF8String(sdmc_dir_path), rw_mode); |
| 694 | auto load_directory = | 694 | auto load_directory = vfs.OpenDirectory(Common::FS::GetYuzuPathString(YuzuPath::LoadDir), |
| 695 | vfs.OpenDirectory(Common::FS::GetYuzuPathString(YuzuPath::LoadDir), FileSys::Mode::Read); | 695 | FileSys::OpenMode::Read); |
| 696 | auto sd_load_directory = | 696 | auto sd_load_directory = vfs.OpenDirectory(Common::FS::PathToUTF8String(sdmc_load_dir_path), |
| 697 | vfs.OpenDirectory(Common::FS::PathToUTF8String(sdmc_load_dir_path), FileSys::Mode::Read); | 697 | FileSys::OpenMode::Read); |
| 698 | auto dump_directory = | 698 | auto dump_directory = |
| 699 | vfs.OpenDirectory(Common::FS::GetYuzuPathString(YuzuPath::DumpDir), rw_mode); | 699 | vfs.OpenDirectory(Common::FS::GetYuzuPathString(YuzuPath::DumpDir), rw_mode); |
| 700 | 700 | ||
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 65dcdb514..2413cdb5c 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -5,7 +5,8 @@ | |||
| 5 | 5 | ||
| 6 | #include <memory> | 6 | #include <memory> |
| 7 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | #include "core/file_sys/directory.h" | 8 | #include "core/file_sys/fs_directory.h" |
| 9 | #include "core/file_sys/fs_filesystem.h" | ||
| 9 | #include "core/file_sys/vfs/vfs.h" | 10 | #include "core/file_sys/vfs/vfs.h" |
| 10 | #include "core/hle/result.h" | 11 | #include "core/hle/result.h" |
| 11 | 12 | ||
| @@ -26,7 +27,6 @@ class XCI; | |||
| 26 | 27 | ||
| 27 | enum class BisPartitionId : u32; | 28 | enum class BisPartitionId : u32; |
| 28 | enum class ContentRecordType : u8; | 29 | enum class ContentRecordType : u8; |
| 29 | enum class Mode : u32; | ||
| 30 | enum class SaveDataSpaceId : u8; | 30 | enum class SaveDataSpaceId : u8; |
| 31 | enum class SaveDataType : u8; | 31 | enum class SaveDataType : u8; |
| 32 | enum class StorageId : u8; | 32 | enum class StorageId : u8; |
| @@ -57,13 +57,6 @@ enum class ImageDirectoryId : u32 { | |||
| 57 | SdCard, | 57 | SdCard, |
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | enum class OpenDirectoryMode : u64 { | ||
| 61 | Directory = (1 << 0), | ||
| 62 | File = (1 << 1), | ||
| 63 | All = Directory | File | ||
| 64 | }; | ||
| 65 | DECLARE_ENUM_FLAG_OPERATORS(OpenDirectoryMode); | ||
| 66 | |||
| 67 | using ProcessId = u64; | 60 | using ProcessId = u64; |
| 68 | using ProgramId = u64; | 61 | using ProgramId = u64; |
| 69 | 62 | ||
| @@ -237,7 +230,7 @@ public: | |||
| 237 | * @return Opened file, or error code | 230 | * @return Opened file, or error code |
| 238 | */ | 231 | */ |
| 239 | Result OpenFile(FileSys::VirtualFile* out_file, const std::string& path, | 232 | Result OpenFile(FileSys::VirtualFile* out_file, const std::string& path, |
| 240 | FileSys::Mode mode) const; | 233 | FileSys::OpenMode mode) const; |
| 241 | 234 | ||
| 242 | /** | 235 | /** |
| 243 | * Open a directory specified by its path | 236 | * Open a directory specified by its path |
| @@ -250,7 +243,7 @@ public: | |||
| 250 | * Get the type of the specified path | 243 | * Get the type of the specified path |
| 251 | * @return The type of the specified path or error code | 244 | * @return The type of the specified path or error code |
| 252 | */ | 245 | */ |
| 253 | Result GetEntryType(FileSys::EntryType* out_entry_type, const std::string& path) const; | 246 | Result GetEntryType(FileSys::DirectoryEntryType* out_entry_type, const std::string& path) const; |
| 254 | 247 | ||
| 255 | /** | 248 | /** |
| 256 | * Get the timestamp of the specified path | 249 | * Get the timestamp of the specified path |
diff --git a/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp b/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp index 62512ad0f..1e8ef366e 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_directory.cpp | |||
| @@ -8,23 +8,26 @@ | |||
| 8 | namespace Service::FileSystem { | 8 | namespace Service::FileSystem { |
| 9 | 9 | ||
| 10 | template <typename T> | 10 | template <typename T> |
| 11 | static void BuildEntryIndex(std::vector<FileSys::Entry>& entries, const std::vector<T>& new_data, | 11 | static void BuildEntryIndex(std::vector<FileSys::DirectoryEntry>& entries, |
| 12 | FileSys::EntryType type) { | 12 | const std::vector<T>& new_data, FileSys::DirectoryEntryType type) { |
| 13 | entries.reserve(entries.size() + new_data.size()); | 13 | entries.reserve(entries.size() + new_data.size()); |
| 14 | 14 | ||
| 15 | for (const auto& new_entry : new_data) { | 15 | for (const auto& new_entry : new_data) { |
| 16 | auto name = new_entry->GetName(); | 16 | auto name = new_entry->GetName(); |
| 17 | 17 | ||
| 18 | if (type == FileSys::EntryType::File && name == FileSys::GetSaveDataSizeFileName()) { | 18 | if (type == FileSys::DirectoryEntryType::File && |
| 19 | name == FileSys::GetSaveDataSizeFileName()) { | ||
| 19 | continue; | 20 | continue; |
| 20 | } | 21 | } |
| 21 | 22 | ||
| 22 | entries.emplace_back(name, type, | 23 | entries.emplace_back(name, static_cast<s8>(type), |
| 23 | type == FileSys::EntryType::Directory ? 0 : new_entry->GetSize()); | 24 | type == FileSys::DirectoryEntryType::Directory ? 0 |
| 25 | : new_entry->GetSize()); | ||
| 24 | } | 26 | } |
| 25 | } | 27 | } |
| 26 | 28 | ||
| 27 | IDirectory::IDirectory(Core::System& system_, FileSys::VirtualDir backend_, OpenDirectoryMode mode) | 29 | IDirectory::IDirectory(Core::System& system_, FileSys::VirtualDir backend_, |
| 30 | FileSys::OpenDirectoryMode mode) | ||
| 28 | : ServiceFramework{system_, "IDirectory"}, backend(std::move(backend_)) { | 31 | : ServiceFramework{system_, "IDirectory"}, backend(std::move(backend_)) { |
| 29 | static const FunctionInfo functions[] = { | 32 | static const FunctionInfo functions[] = { |
| 30 | {0, &IDirectory::Read, "Read"}, | 33 | {0, &IDirectory::Read, "Read"}, |
| @@ -34,11 +37,12 @@ IDirectory::IDirectory(Core::System& system_, FileSys::VirtualDir backend_, Open | |||
| 34 | 37 | ||
| 35 | // TODO(DarkLordZach): Verify that this is the correct behavior. | 38 | // TODO(DarkLordZach): Verify that this is the correct behavior. |
| 36 | // Build entry index now to save time later. | 39 | // Build entry index now to save time later. |
| 37 | if (True(mode & OpenDirectoryMode::Directory)) { | 40 | if (True(mode & FileSys::OpenDirectoryMode::Directory)) { |
| 38 | BuildEntryIndex(entries, backend->GetSubdirectories(), FileSys::EntryType::Directory); | 41 | BuildEntryIndex(entries, backend->GetSubdirectories(), |
| 42 | FileSys::DirectoryEntryType::Directory); | ||
| 39 | } | 43 | } |
| 40 | if (True(mode & OpenDirectoryMode::File)) { | 44 | if (True(mode & FileSys::OpenDirectoryMode::File)) { |
| 41 | BuildEntryIndex(entries, backend->GetFiles(), FileSys::EntryType::File); | 45 | BuildEntryIndex(entries, backend->GetFiles(), FileSys::DirectoryEntryType::File); |
| 42 | } | 46 | } |
| 43 | } | 47 | } |
| 44 | 48 | ||
| @@ -46,7 +50,7 @@ void IDirectory::Read(HLERequestContext& ctx) { | |||
| 46 | LOG_DEBUG(Service_FS, "called."); | 50 | LOG_DEBUG(Service_FS, "called."); |
| 47 | 51 | ||
| 48 | // Calculate how many entries we can fit in the output buffer | 52 | // Calculate how many entries we can fit in the output buffer |
| 49 | const u64 count_entries = ctx.GetWriteBufferNumElements<FileSys::Entry>(); | 53 | const u64 count_entries = ctx.GetWriteBufferNumElements<FileSys::DirectoryEntry>(); |
| 50 | 54 | ||
| 51 | // Cap at total number of entries. | 55 | // Cap at total number of entries. |
| 52 | const u64 actual_entries = std::min(count_entries, entries.size() - next_entry_index); | 56 | const u64 actual_entries = std::min(count_entries, entries.size() - next_entry_index); |
diff --git a/src/core/hle/service/filesystem/fsp/fs_i_directory.h b/src/core/hle/service/filesystem/fsp/fs_i_directory.h index ecc4ecada..9f5d7c054 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_directory.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_directory.h | |||
| @@ -3,9 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include "core/file_sys/fs_filesystem.h" | ||
| 6 | #include "core/file_sys/vfs/vfs.h" | 7 | #include "core/file_sys/vfs/vfs.h" |
| 7 | #include "core/hle/service/filesystem/filesystem.h" | 8 | #include "core/hle/service/filesystem/filesystem.h" |
| 8 | #include "core/hle/service/filesystem/fsp_util.h" | 9 | #include "core/hle/service/filesystem/fsp/fsp_util.h" |
| 9 | #include "core/hle/service/service.h" | 10 | #include "core/hle/service/service.h" |
| 10 | 11 | ||
| 11 | namespace Service::FileSystem { | 12 | namespace Service::FileSystem { |
| @@ -13,11 +14,11 @@ namespace Service::FileSystem { | |||
| 13 | class IDirectory final : public ServiceFramework<IDirectory> { | 14 | class IDirectory final : public ServiceFramework<IDirectory> { |
| 14 | public: | 15 | public: |
| 15 | explicit IDirectory(Core::System& system_, FileSys::VirtualDir backend_, | 16 | explicit IDirectory(Core::System& system_, FileSys::VirtualDir backend_, |
| 16 | OpenDirectoryMode mode); | 17 | FileSys::OpenDirectoryMode mode); |
| 17 | 18 | ||
| 18 | private: | 19 | private: |
| 19 | FileSys::VirtualDir backend; | 20 | FileSys::VirtualDir backend; |
| 20 | std::vector<FileSys::Entry> entries; | 21 | std::vector<FileSys::DirectoryEntry> entries; |
| 21 | u64 next_entry_index = 0; | 22 | u64 next_entry_index = 0; |
| 22 | 23 | ||
| 23 | void Read(HLERequestContext& ctx); | 24 | void Read(HLERequestContext& ctx); |
diff --git a/src/core/hle/service/filesystem/fsp/fs_i_file.h b/src/core/hle/service/filesystem/fsp/fs_i_file.h index a7eb1a1e9..5e5430c67 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_file.h +++ b/src/core/hle/service/filesystem/fsp/fs_i_file.h | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include "core/file_sys/vfs.h" | ||
| 7 | #include "core/hle/service/filesystem/filesystem.h" | 6 | #include "core/hle/service/filesystem/filesystem.h" |
| 8 | #include "core/hle/service/service.h" | 7 | #include "core/hle/service/service.h" |
| 9 | 8 | ||
diff --git a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp index 3e72101a4..efa394dd1 100644 --- a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp +++ b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp | |||
| @@ -10,8 +10,8 @@ | |||
| 10 | namespace Service::FileSystem { | 10 | namespace Service::FileSystem { |
| 11 | 11 | ||
| 12 | IFileSystem::IFileSystem(Core::System& system_, FileSys::VirtualDir backend_, SizeGetter size_) | 12 | IFileSystem::IFileSystem(Core::System& system_, FileSys::VirtualDir backend_, SizeGetter size_) |
| 13 | : ServiceFramework{system_, "IFileSystem"}, backend{std::move(backend_)}, | 13 | : ServiceFramework{system_, "IFileSystem"}, backend{std::move(backend_)}, size{std::move( |
| 14 | size{std::move(size_)} { | 14 | size_)} { |
| 15 | static const FunctionInfo functions[] = { | 15 | static const FunctionInfo functions[] = { |
| 16 | {0, &IFileSystem::CreateFile, "CreateFile"}, | 16 | {0, &IFileSystem::CreateFile, "CreateFile"}, |
| 17 | {1, &IFileSystem::DeleteFile, "DeleteFile"}, | 17 | {1, &IFileSystem::DeleteFile, "DeleteFile"}, |
| @@ -116,7 +116,7 @@ void IFileSystem::OpenFile(HLERequestContext& ctx) { | |||
| 116 | const auto file_buffer = ctx.ReadBuffer(); | 116 | const auto file_buffer = ctx.ReadBuffer(); |
| 117 | const std::string name = Common::StringFromBuffer(file_buffer); | 117 | const std::string name = Common::StringFromBuffer(file_buffer); |
| 118 | 118 | ||
| 119 | const auto mode = static_cast<FileSys::Mode>(rp.Pop<u32>()); | 119 | const auto mode = static_cast<FileSys::OpenMode>(rp.Pop<u32>()); |
| 120 | 120 | ||
| 121 | LOG_DEBUG(Service_FS, "called. file={}, mode={}", name, mode); | 121 | LOG_DEBUG(Service_FS, "called. file={}, mode={}", name, mode); |
| 122 | 122 | ||
| @@ -140,7 +140,7 @@ void IFileSystem::OpenDirectory(HLERequestContext& ctx) { | |||
| 140 | 140 | ||
| 141 | const auto file_buffer = ctx.ReadBuffer(); | 141 | const auto file_buffer = ctx.ReadBuffer(); |
| 142 | const std::string name = Common::StringFromBuffer(file_buffer); | 142 | const std::string name = Common::StringFromBuffer(file_buffer); |
| 143 | const auto mode = rp.PopRaw<OpenDirectoryMode>(); | 143 | const auto mode = rp.PopRaw<FileSys::OpenDirectoryMode>(); |
| 144 | 144 | ||
| 145 | LOG_DEBUG(Service_FS, "called. directory={}, mode={}", name, mode); | 145 | LOG_DEBUG(Service_FS, "called. directory={}, mode={}", name, mode); |
| 146 | 146 | ||
| @@ -165,7 +165,7 @@ void IFileSystem::GetEntryType(HLERequestContext& ctx) { | |||
| 165 | 165 | ||
| 166 | LOG_DEBUG(Service_FS, "called. file={}", name); | 166 | LOG_DEBUG(Service_FS, "called. file={}", name); |
| 167 | 167 | ||
| 168 | FileSys::EntryType vfs_entry_type{}; | 168 | FileSys::DirectoryEntryType vfs_entry_type{}; |
| 169 | auto result = backend.GetEntryType(&vfs_entry_type, name); | 169 | auto result = backend.GetEntryType(&vfs_entry_type, name); |
| 170 | if (result != ResultSuccess) { | 170 | if (result != ResultSuccess) { |
| 171 | IPC::ResponseBuilder rb{ctx, 2}; | 171 | IPC::ResponseBuilder rb{ctx, 2}; |
diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp index d04fb079f..c35df5530 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp | |||
| @@ -15,9 +15,9 @@ | |||
| 15 | #include "common/settings.h" | 15 | #include "common/settings.h" |
| 16 | #include "common/string_util.h" | 16 | #include "common/string_util.h" |
| 17 | #include "core/core.h" | 17 | #include "core/core.h" |
| 18 | #include "core/file_sys/directory.h" | ||
| 19 | #include "core/file_sys/errors.h" | 18 | #include "core/file_sys/errors.h" |
| 20 | #include "core/file_sys/mode.h" | 19 | #include "core/file_sys/fs_directory.h" |
| 20 | #include "core/file_sys/fs_filesystem.h" | ||
| 21 | #include "core/file_sys/nca_metadata.h" | 21 | #include "core/file_sys/nca_metadata.h" |
| 22 | #include "core/file_sys/patch_manager.h" | 22 | #include "core/file_sys/patch_manager.h" |
| 23 | #include "core/file_sys/romfs_factory.h" | 23 | #include "core/file_sys/romfs_factory.h" |
| @@ -52,8 +52,8 @@ public: | |||
| 52 | explicit ISaveDataInfoReader(Core::System& system_, | 52 | explicit ISaveDataInfoReader(Core::System& system_, |
| 53 | std::shared_ptr<SaveDataController> save_data_controller_, | 53 | std::shared_ptr<SaveDataController> save_data_controller_, |
| 54 | FileSys::SaveDataSpaceId space) | 54 | FileSys::SaveDataSpaceId space) |
| 55 | : ServiceFramework{system_, "ISaveDataInfoReader"}, | 55 | : ServiceFramework{system_, "ISaveDataInfoReader"}, save_data_controller{ |
| 56 | save_data_controller{save_data_controller_} { | 56 | save_data_controller_} { |
| 57 | static const FunctionInfo functions[] = { | 57 | static const FunctionInfo functions[] = { |
| 58 | {0, &ISaveDataInfoReader::ReadSaveDataInfo, "ReadSaveDataInfo"}, | 58 | {0, &ISaveDataInfoReader::ReadSaveDataInfo, "ReadSaveDataInfo"}, |
| 59 | }; | 59 | }; |