diff options
author | Zach Hilman <zachhilman@gmail.com> | 2019-04-23 20:38:18 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2019-09-21 22:50:39 +0200 |
commit | a49169e81906d230fd6bfc7546acc6f763f4c321 (patch) | |
tree | eceaf472b9e52755b333f0945d14c4bddc1b741c /src/core | |
parent | yuzu: Add UI to manage filesystem paths and sizes (diff) | |
download | yuzu-a49169e81906d230fd6bfc7546acc6f763f4c321.tar yuzu-a49169e81906d230fd6bfc7546acc6f763f4c321.tar.gz yuzu-a49169e81906d230fd6bfc7546acc6f763f4c321.tar.bz2 yuzu-a49169e81906d230fd6bfc7546acc6f763f4c321.tar.lz yuzu-a49169e81906d230fd6bfc7546acc6f763f4c321.tar.xz yuzu-a49169e81906d230fd6bfc7546acc6f763f4c321.tar.zst yuzu-a49169e81906d230fd6bfc7546acc6f763f4c321.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/file_sys/romfs_factory.cpp | 5 | ||||
-rw-r--r-- | src/core/file_sys/romfs_factory.h | 4 | ||||
-rw-r--r-- | src/core/file_sys/savedata_factory.cpp | 7 | ||||
-rw-r--r-- | src/core/file_sys/savedata_factory.h | 7 | ||||
-rw-r--r-- | src/core/file_sys/sdmc_factory.cpp | 2 | ||||
-rw-r--r-- | src/core/file_sys/sdmc_factory.h | 2 | ||||
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 68 | ||||
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 68 | ||||
-rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 8 |
9 files changed, 91 insertions, 80 deletions
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index c3ee4a158..84cd4684c 100644 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp @@ -35,7 +35,7 @@ void RomFSFactory::SetPackedUpdate(VirtualFile update_raw) { this->update_raw = std::move(update_raw); } -ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess() { +ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess() const { if (!updatable) return MakeResult<VirtualFile>(file); @@ -44,7 +44,8 @@ ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess() { patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw)); } -ResultVal<VirtualFile> RomFSFactory::Open(u64 title_id, StorageId storage, ContentRecordType type) { +ResultVal<VirtualFile> RomFSFactory::Open(u64 title_id, StorageId storage, + ContentRecordType type) const { std::shared_ptr<NCA> res; switch (storage) { diff --git a/src/core/file_sys/romfs_factory.h b/src/core/file_sys/romfs_factory.h index 7724c0b23..da63a313a 100644 --- a/src/core/file_sys/romfs_factory.h +++ b/src/core/file_sys/romfs_factory.h @@ -33,8 +33,8 @@ public: ~RomFSFactory(); void SetPackedUpdate(VirtualFile update_raw); - ResultVal<VirtualFile> OpenCurrentProcess(); - ResultVal<VirtualFile> Open(u64 title_id, StorageId storage, ContentRecordType type); + ResultVal<VirtualFile> OpenCurrentProcess() const; + ResultVal<VirtualFile> Open(u64 title_id, StorageId storage, ContentRecordType type) const; private: VirtualFile file; diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index c63815332..f77cc02ac 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp @@ -71,7 +71,7 @@ SaveDataFactory::SaveDataFactory(VirtualDir save_directory) : dir(std::move(save SaveDataFactory::~SaveDataFactory() = default; ResultVal<VirtualDir> SaveDataFactory::Create(SaveDataSpaceId space, - const SaveDataDescriptor& meta) { + const SaveDataDescriptor& meta) const { PrintSaveDataDescriptorWarnings(meta); const auto save_directory = @@ -88,7 +88,8 @@ ResultVal<VirtualDir> SaveDataFactory::Create(SaveDataSpaceId space, return MakeResult<VirtualDir>(std::move(out)); } -ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space, const SaveDataDescriptor& meta) { +ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space, + const SaveDataDescriptor& meta) const { const auto save_directory = GetFullPath(space, meta.type, meta.title_id, meta.user_id, meta.save_id); @@ -165,7 +166,7 @@ SaveDataSize SaveDataFactory::ReadSaveDataSize(SaveDataType type, u64 title_id, } void SaveDataFactory::WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, - SaveDataSize new_value) { + SaveDataSize new_value) const { const auto path = GetFullPath(SaveDataSpaceId::NandUser, type, title_id, user_id, 0); const auto dir = GetOrCreateDirectoryRelative(this->dir, path); diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h index 738038ee0..991e57aa1 100644 --- a/src/core/file_sys/savedata_factory.h +++ b/src/core/file_sys/savedata_factory.h @@ -64,8 +64,8 @@ public: explicit SaveDataFactory(VirtualDir dir); ~SaveDataFactory(); - ResultVal<VirtualDir> Create(SaveDataSpaceId space, const SaveDataDescriptor& meta); - ResultVal<VirtualDir> Open(SaveDataSpaceId space, const SaveDataDescriptor& meta); + ResultVal<VirtualDir> Create(SaveDataSpaceId space, const SaveDataDescriptor& meta) const; + ResultVal<VirtualDir> Open(SaveDataSpaceId space, const SaveDataDescriptor& meta) const; VirtualDir GetSaveDataSpaceDirectory(SaveDataSpaceId space) const; @@ -74,7 +74,8 @@ public: u128 user_id, u64 save_id); SaveDataSize ReadSaveDataSize(SaveDataType type, u64 title_id, u128 user_id) const; - void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, SaveDataSize new_value); + void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, + SaveDataSize new_value) const; private: VirtualDir dir; diff --git a/src/core/file_sys/sdmc_factory.cpp b/src/core/file_sys/sdmc_factory.cpp index 743e2e63a..5113a1ca6 100644 --- a/src/core/file_sys/sdmc_factory.cpp +++ b/src/core/file_sys/sdmc_factory.cpp @@ -21,7 +21,7 @@ SDMCFactory::SDMCFactory(VirtualDir dir_) SDMCFactory::~SDMCFactory() = default; -ResultVal<VirtualDir> SDMCFactory::Open() { +ResultVal<VirtualDir> SDMCFactory::Open() const { return MakeResult<VirtualDir>(dir); } diff --git a/src/core/file_sys/sdmc_factory.h b/src/core/file_sys/sdmc_factory.h index 164fd9435..42dc4e08a 100644 --- a/src/core/file_sys/sdmc_factory.h +++ b/src/core/file_sys/sdmc_factory.h @@ -19,7 +19,7 @@ public: explicit SDMCFactory(VirtualDir dir); ~SDMCFactory(); - ResultVal<VirtualDir> Open(); + ResultVal<VirtualDir> Open() const; VirtualDir GetSDMCContentDirectory() const; diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 76a860c6d..31d5fd79b 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -241,6 +241,10 @@ ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType( return FileSys::ERROR_PATH_NOT_FOUND; } +FileSystemController::FileSystemController() = default; + +FileSystemController::~FileSystemController() = default; + ResultCode FileSystemController::RegisterRomFS(std::unique_ptr<FileSys::RomFSFactory>&& factory) { romfs_factory = std::move(factory); LOG_DEBUG(Service_FS, "Registered RomFS"); @@ -278,7 +282,7 @@ void FileSystemController::SetPackedUpdate(FileSys::VirtualFile update_raw) { romfs_factory->SetPackedUpdate(std::move(update_raw)); } -ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFSCurrentProcess() { +ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFSCurrentProcess() const { LOG_TRACE(Service_FS, "Opening RomFS for current process"); if (romfs_factory == nullptr) { @@ -289,9 +293,8 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFSCurrentProcess() return romfs_factory->OpenCurrentProcess(); } -ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFS(u64 title_id, - FileSys::StorageId storage_id, - FileSys::ContentRecordType type) { +ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFS( + u64 title_id, FileSys::StorageId storage_id, FileSys::ContentRecordType type) const { LOG_TRACE(Service_FS, "Opening RomFS for title_id={:016X}, storage_id={:02X}, type={:02X}", title_id, static_cast<u8>(storage_id), static_cast<u8>(type)); @@ -304,7 +307,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFS(u64 title_id, } ResultVal<FileSys::VirtualDir> FileSystemController::CreateSaveData( - FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& save_struct) { + FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& save_struct) const { LOG_TRACE(Service_FS, "Creating Save Data for space_id={:01X}, save_struct={}", static_cast<u8>(space), save_struct.DebugInfo()); @@ -316,7 +319,7 @@ ResultVal<FileSys::VirtualDir> FileSystemController::CreateSaveData( } ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveData( - FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& descriptor) { + FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& descriptor) const { LOG_TRACE(Service_FS, "Opening Save Data for space_id={:01X}, save_struct={}", static_cast<u8>(space), descriptor.DebugInfo()); @@ -328,7 +331,7 @@ ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveData( } ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveDataSpace( - FileSys::SaveDataSpaceId space) { + FileSys::SaveDataSpaceId space) const { LOG_TRACE(Service_FS, "Opening Save Data Space for space_id={:01X}", static_cast<u8>(space)); if (save_data_factory == nullptr) { @@ -338,7 +341,7 @@ ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveDataSpace( return MakeResult(save_data_factory->GetSaveDataSpaceDirectory(space)); } -ResultVal<FileSys::VirtualDir> FileSystemController::OpenSDMC() { +ResultVal<FileSys::VirtualDir> FileSystemController::OpenSDMC() const { LOG_TRACE(Service_FS, "Opening SDMC"); if (sdmc_factory == nullptr) { @@ -348,7 +351,8 @@ ResultVal<FileSys::VirtualDir> FileSystemController::OpenSDMC() { return sdmc_factory->Open(); } -ResultVal<FileSys::VirtualDir> FileSystemController::OpenBISPartition(FileSys::BisPartitionId id) { +ResultVal<FileSys::VirtualDir> FileSystemController::OpenBISPartition( + FileSys::BisPartitionId id) const { LOG_TRACE(Service_FS, "Opening BIS Partition with id={:08X}", static_cast<u32>(id)); if (bis_factory == nullptr) { @@ -364,7 +368,7 @@ ResultVal<FileSys::VirtualDir> FileSystemController::OpenBISPartition(FileSys::B } ResultVal<FileSys::VirtualFile> FileSystemController::OpenBISPartitionStorage( - FileSys::BisPartitionId id) { + FileSys::BisPartitionId id) const { LOG_TRACE(Service_FS, "Opening BIS Partition Storage with id={:08X}", static_cast<u32>(id)); if (bis_factory == nullptr) { @@ -432,7 +436,7 @@ u64 FileSystemController::GetTotalSpaceSize(FileSys::StorageId id) const { } FileSys::SaveDataSize FileSystemController::ReadSaveDataSize(FileSys::SaveDataType type, - u64 title_id, u128 user_id) { + u64 title_id, u128 user_id) const { if (save_data_factory == nullptr) { return {0, 0}; } @@ -465,7 +469,7 @@ FileSys::SaveDataSize FileSystemController::ReadSaveDataSize(FileSys::SaveDataTy } void FileSystemController::WriteSaveDataSize(FileSys::SaveDataType type, u64 title_id, u128 user_id, - FileSys::SaveDataSize new_value) { + FileSys::SaveDataSize new_value) const { if (save_data_factory != nullptr) save_data_factory->WriteSaveDataSize(type, title_id, user_id, new_value); } @@ -477,19 +481,19 @@ void FileSystemController::SetGameCard(FileSys::VirtualFile file) { gamecard_placeholder = std::make_unique<FileSys::PlaceholderCache>(dir); } -FileSys::XCI* FileSystemController::GetGameCard() { +FileSys::XCI* FileSystemController::GetGameCard() const { return gamecard.get(); } -FileSys::RegisteredCache* FileSystemController::GetGameCardContents() { +FileSys::RegisteredCache* FileSystemController::GetGameCardContents() const { return gamecard_registered.get(); } -FileSys::PlaceholderCache* FileSystemController::GetGameCardPlaceholder() { +FileSys::PlaceholderCache* FileSystemController::GetGameCardPlaceholder() const { return gamecard_placeholder.get(); } -FileSys::RegisteredCache* FileSystemController::GetSystemNANDContents() { +FileSys::RegisteredCache* FileSystemController::GetSystemNANDContents() const { LOG_TRACE(Service_FS, "Opening System NAND Contents"); if (bis_factory == nullptr) @@ -498,7 +502,7 @@ FileSys::RegisteredCache* FileSystemController::GetSystemNANDContents() { return bis_factory->GetSystemNANDContents(); } -FileSys::RegisteredCache* FileSystemController::GetUserNANDContents() { +FileSys::RegisteredCache* FileSystemController::GetUserNANDContents() const { LOG_TRACE(Service_FS, "Opening User NAND Contents"); if (bis_factory == nullptr) @@ -507,7 +511,7 @@ FileSys::RegisteredCache* FileSystemController::GetUserNANDContents() { return bis_factory->GetUserNANDContents(); } -FileSys::RegisteredCache* FileSystemController::GetSDMCContents() { +FileSys::RegisteredCache* FileSystemController::GetSDMCContents() const { LOG_TRACE(Service_FS, "Opening SDMC Contents"); if (sdmc_factory == nullptr) @@ -516,7 +520,7 @@ FileSys::RegisteredCache* FileSystemController::GetSDMCContents() { return sdmc_factory->GetSDMCContents(); } -FileSys::PlaceholderCache* FileSystemController::GetSystemNANDPlaceholder() { +FileSys::PlaceholderCache* FileSystemController::GetSystemNANDPlaceholder() const { LOG_TRACE(Service_FS, "Opening System NAND Placeholder"); if (bis_factory == nullptr) @@ -525,7 +529,7 @@ FileSys::PlaceholderCache* FileSystemController::GetSystemNANDPlaceholder() { return bis_factory->GetSystemNANDPlaceholder(); } -FileSys::PlaceholderCache* FileSystemController::GetUserNANDPlaceholder() { +FileSys::PlaceholderCache* FileSystemController::GetUserNANDPlaceholder() const { LOG_TRACE(Service_FS, "Opening User NAND Placeholder"); if (bis_factory == nullptr) @@ -534,7 +538,7 @@ FileSys::PlaceholderCache* FileSystemController::GetUserNANDPlaceholder() { return bis_factory->GetUserNANDPlaceholder(); } -FileSys::PlaceholderCache* FileSystemController::GetSDMCPlaceholder() { +FileSys::PlaceholderCache* FileSystemController::GetSDMCPlaceholder() const { LOG_TRACE(Service_FS, "Opening SDMC Placeholder"); if (sdmc_factory == nullptr) @@ -544,7 +548,7 @@ FileSys::PlaceholderCache* FileSystemController::GetSDMCPlaceholder() { } FileSys::RegisteredCache* FileSystemController::GetRegisteredCacheForStorage( - FileSys::StorageId id) { + FileSys::StorageId id) const { switch (id) { case FileSys::StorageId::None: case FileSys::StorageId::Host: @@ -564,7 +568,7 @@ FileSys::RegisteredCache* FileSystemController::GetRegisteredCacheForStorage( } FileSys::PlaceholderCache* FileSystemController::GetPlaceholderCacheForStorage( - FileSys::StorageId id) { + FileSys::StorageId id) const { switch (id) { case FileSys::StorageId::None: case FileSys::StorageId::Host: @@ -583,7 +587,7 @@ FileSys::PlaceholderCache* FileSystemController::GetPlaceholderCacheForStorage( return nullptr; } -FileSys::VirtualDir FileSystemController::GetSystemNANDContentDirectory() { +FileSys::VirtualDir FileSystemController::GetSystemNANDContentDirectory() const { LOG_TRACE(Service_FS, "Opening system NAND content directory"); if (bis_factory == nullptr) @@ -592,7 +596,7 @@ FileSys::VirtualDir FileSystemController::GetSystemNANDContentDirectory() { return bis_factory->GetSystemNANDContentDirectory(); } -FileSys::VirtualDir FileSystemController::GetUserNANDContentDirectory() { +FileSys::VirtualDir FileSystemController::GetUserNANDContentDirectory() const { LOG_TRACE(Service_FS, "Opening user NAND content directory"); if (bis_factory == nullptr) @@ -601,7 +605,7 @@ FileSys::VirtualDir FileSystemController::GetUserNANDContentDirectory() { return bis_factory->GetUserNANDContentDirectory(); } -FileSys::VirtualDir FileSystemController::GetSDMCContentDirectory() { +FileSys::VirtualDir FileSystemController::GetSDMCContentDirectory() const { LOG_TRACE(Service_FS, "Opening SDMC content directory"); if (sdmc_factory == nullptr) @@ -610,7 +614,7 @@ FileSys::VirtualDir FileSystemController::GetSDMCContentDirectory() { return sdmc_factory->GetSDMCContentDirectory(); } -FileSys::VirtualDir FileSystemController::GetNANDImageDirectory() { +FileSys::VirtualDir FileSystemController::GetNANDImageDirectory() const { LOG_TRACE(Service_FS, "Opening NAND image directory"); if (bis_factory == nullptr) @@ -619,7 +623,7 @@ FileSys::VirtualDir FileSystemController::GetNANDImageDirectory() { return bis_factory->GetImageDirectory(); } -FileSys::VirtualDir FileSystemController::GetSDMCImageDirectory() { +FileSys::VirtualDir FileSystemController::GetSDMCImageDirectory() const { LOG_TRACE(Service_FS, "Opening SDMC image directory"); if (sdmc_factory == nullptr) @@ -628,7 +632,7 @@ FileSys::VirtualDir FileSystemController::GetSDMCImageDirectory() { return sdmc_factory->GetImageDirectory(); } -FileSys::VirtualDir FileSystemController::GetContentDirectory(ContentStorageId id) { +FileSys::VirtualDir FileSystemController::GetContentDirectory(ContentStorageId id) const { switch (id) { case ContentStorageId::System: return GetSystemNANDContentDirectory(); @@ -641,7 +645,7 @@ FileSys::VirtualDir FileSystemController::GetContentDirectory(ContentStorageId i return nullptr; } -FileSys::VirtualDir FileSystemController::GetImageDirectory(ImageDirectoryId id) { +FileSys::VirtualDir FileSystemController::GetImageDirectory(ImageDirectoryId id) const { switch (id) { case ImageDirectoryId::NAND: return GetNANDImageDirectory(); @@ -652,7 +656,7 @@ FileSys::VirtualDir FileSystemController::GetImageDirectory(ImageDirectoryId id) return nullptr; } -FileSys::VirtualDir FileSystemController::GetModificationLoadRoot(u64 title_id) { +FileSys::VirtualDir FileSystemController::GetModificationLoadRoot(u64 title_id) const { LOG_TRACE(Service_FS, "Opening mod load root for tid={:016X}", title_id); if (bis_factory == nullptr) @@ -661,7 +665,7 @@ FileSys::VirtualDir FileSystemController::GetModificationLoadRoot(u64 title_id) return bis_factory->GetModificationLoadRoot(title_id); } -FileSys::VirtualDir FileSystemController::GetModificationDumpRoot(u64 title_id) { +FileSys::VirtualDir FileSystemController::GetModificationDumpRoot(u64 title_id) const { LOG_TRACE(Service_FS, "Opening mod dump root for tid={:016X}", title_id); if (bis_factory == nullptr) diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 2eb3a641d..4d7da3b6f 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h @@ -52,59 +52,63 @@ enum class ImageDirectoryId : u32 { class FileSystemController { public: + FileSystemController(); + ~FileSystemController(); + ResultCode RegisterRomFS(std::unique_ptr<FileSys::RomFSFactory>&& factory); ResultCode RegisterSaveData(std::unique_ptr<FileSys::SaveDataFactory>&& factory); ResultCode RegisterSDMC(std::unique_ptr<FileSys::SDMCFactory>&& factory); ResultCode RegisterBIS(std::unique_ptr<FileSys::BISFactory>&& factory); void SetPackedUpdate(FileSys::VirtualFile update_raw); - ResultVal<FileSys::VirtualFile> OpenRomFSCurrentProcess(); + ResultVal<FileSys::VirtualFile> OpenRomFSCurrentProcess() const; ResultVal<FileSys::VirtualFile> OpenRomFS(u64 title_id, FileSys::StorageId storage_id, - FileSys::ContentRecordType type); - ResultVal<FileSys::VirtualDir> CreateSaveData(FileSys::SaveDataSpaceId space, - const FileSys::SaveDataDescriptor& save_struct); - ResultVal<FileSys::VirtualDir> OpenSaveData(FileSys::SaveDataSpaceId space, - const FileSys::SaveDataDescriptor& save_struct); - ResultVal<FileSys::VirtualDir> OpenSaveDataSpace(FileSys::SaveDataSpaceId space); - ResultVal<FileSys::VirtualDir> OpenSDMC(); - ResultVal<FileSys::VirtualDir> OpenBISPartition(FileSys::BisPartitionId id); - ResultVal<FileSys::VirtualFile> OpenBISPartitionStorage(FileSys::BisPartitionId id); + FileSys::ContentRecordType type) const; + ResultVal<FileSys::VirtualDir> CreateSaveData( + FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& save_struct) const; + ResultVal<FileSys::VirtualDir> OpenSaveData( + FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& save_struct) const; + ResultVal<FileSys::VirtualDir> OpenSaveDataSpace(FileSys::SaveDataSpaceId space) const; + ResultVal<FileSys::VirtualDir> OpenSDMC() const; + ResultVal<FileSys::VirtualDir> OpenBISPartition(FileSys::BisPartitionId id) const; + ResultVal<FileSys::VirtualFile> OpenBISPartitionStorage(FileSys::BisPartitionId id) const; u64 GetFreeSpaceSize(FileSys::StorageId id) const; u64 GetTotalSpaceSize(FileSys::StorageId id) const; - FileSys::SaveDataSize ReadSaveDataSize(FileSys::SaveDataType type, u64 title_id, u128 user_id); + FileSys::SaveDataSize ReadSaveDataSize(FileSys::SaveDataType type, u64 title_id, + u128 user_id) const; void WriteSaveDataSize(FileSys::SaveDataType type, u64 title_id, u128 user_id, - FileSys::SaveDataSize new_value); + FileSys::SaveDataSize new_value) const; void SetGameCard(FileSys::VirtualFile file); - FileSys::XCI* GetGameCard(); + FileSys::XCI* GetGameCard() const; - FileSys::RegisteredCache* GetSystemNANDContents(); - FileSys::RegisteredCache* GetUserNANDContents(); - FileSys::RegisteredCache* GetSDMCContents(); - FileSys::RegisteredCache* GetGameCardContents(); + FileSys::RegisteredCache* GetSystemNANDContents() const; + FileSys::RegisteredCache* GetUserNANDContents() const; + FileSys::RegisteredCache* GetSDMCContents() const; + FileSys::RegisteredCache* GetGameCardContents() const; - FileSys::PlaceholderCache* GetSystemNANDPlaceholder(); - FileSys::PlaceholderCache* GetUserNANDPlaceholder(); - FileSys::PlaceholderCache* GetSDMCPlaceholder(); - FileSys::PlaceholderCache* GetGameCardPlaceholder(); + FileSys::PlaceholderCache* GetSystemNANDPlaceholder() const; + FileSys::PlaceholderCache* GetUserNANDPlaceholder() const; + FileSys::PlaceholderCache* GetSDMCPlaceholder() const; + FileSys::PlaceholderCache* GetGameCardPlaceholder() const; - FileSys::RegisteredCache* GetRegisteredCacheForStorage(FileSys::StorageId id); - FileSys::PlaceholderCache* GetPlaceholderCacheForStorage(FileSys::StorageId id); + FileSys::RegisteredCache* GetRegisteredCacheForStorage(FileSys::StorageId id) const; + FileSys::PlaceholderCache* GetPlaceholderCacheForStorage(FileSys::StorageId id) const; - FileSys::VirtualDir GetSystemNANDContentDirectory(); - FileSys::VirtualDir GetUserNANDContentDirectory(); - FileSys::VirtualDir GetSDMCContentDirectory(); + FileSys::VirtualDir GetSystemNANDContentDirectory() const; + FileSys::VirtualDir GetUserNANDContentDirectory() const; + FileSys::VirtualDir GetSDMCContentDirectory() const; - FileSys::VirtualDir GetNANDImageDirectory(); - FileSys::VirtualDir GetSDMCImageDirectory(); + FileSys::VirtualDir GetNANDImageDirectory() const; + FileSys::VirtualDir GetSDMCImageDirectory() const; - FileSys::VirtualDir GetContentDirectory(ContentStorageId id); - FileSys::VirtualDir GetImageDirectory(ImageDirectoryId id); + FileSys::VirtualDir GetContentDirectory(ContentStorageId id) const; + FileSys::VirtualDir GetImageDirectory(ImageDirectoryId id) const; - FileSys::VirtualDir GetModificationLoadRoot(u64 title_id); - FileSys::VirtualDir GetModificationDumpRoot(u64 title_id); + FileSys::VirtualDir GetModificationLoadRoot(u64 title_id) const; + FileSys::VirtualDir GetModificationDumpRoot(u64 title_id) const; // Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function // above is called. diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 525fda19f..305d9e176 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -32,8 +32,8 @@ namespace Service::FileSystem { struct SizeGetter { - std::function<u64()> free; - std::function<u64()> total; + std::function<u64()> get_free_size; + std::function<u64()> get_total_size; static SizeGetter FromStorageId(const FileSystemController& fsc, FileSys::StorageId id) { return { @@ -485,7 +485,7 @@ public: IPC::ResponseBuilder rb{ctx, 4}; rb.Push(RESULT_SUCCESS); - rb.Push(size.free()); + rb.Push(size.get_free_size()); } void GetTotalSpaceSize(Kernel::HLERequestContext& ctx) { @@ -493,7 +493,7 @@ public: IPC::ResponseBuilder rb{ctx, 4}; rb.Push(RESULT_SUCCESS); - rb.Push(size.total()); + rb.Push(size.get_total_size()); } private: |