aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/romfs_filesystem.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-03-01 22:14:31 -0500
committerGitHub <noreply@github.com>2018-03-01 22:14:31 -0500
commit46fc7d85023f4449b542f0c58830421d667f92b7 (patch)
treea605aabd8c776bebea1111fccd8df01d569d5170 /src/core/file_sys/romfs_filesystem.cpp
parentb1709410dd9b1f9ed9bf76f54ce82b5e7f89ab66 (diff)
parent3209cff5307ab16044ccc22e6b922545aae8215d (diff)
Merge pull request #216 from Subv/savedata
Implemented the SaveData archive and MountSaveData.
Diffstat (limited to 'src/core/file_sys/romfs_filesystem.cpp')
-rw-r--r--src/core/file_sys/romfs_filesystem.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/file_sys/romfs_filesystem.cpp b/src/core/file_sys/romfs_filesystem.cpp
index ca1463d7c..f1f9b4d04 100644
--- a/src/core/file_sys/romfs_filesystem.cpp
+++ b/src/core/file_sys/romfs_filesystem.cpp
@@ -14,8 +14,8 @@ std::string RomFS_FileSystem::GetName() const {
return "RomFS";
}
-ResultVal<std::unique_ptr<StorageBackend>> RomFS_FileSystem::OpenFile(const Path& path,
- const Mode& mode) const {
+ResultVal<std::unique_ptr<StorageBackend>> RomFS_FileSystem::OpenFile(const std::string& path,
+ Mode mode) const {
return MakeResult<std::unique_ptr<StorageBackend>>(
std::make_unique<RomFS_Storage>(romfs_file, data_offset, data_size));
}
@@ -48,7 +48,7 @@ ResultCode RomFS_FileSystem::DeleteDirectoryRecursively(const Path& path) const
return ResultCode(-1);
}
-ResultCode RomFS_FileSystem::CreateFile(const Path& path, u64 size) const {
+ResultCode RomFS_FileSystem::CreateFile(const std::string& path, u64 size) const {
LOG_CRITICAL(Service_FS, "Attempted to create a file in an ROMFS archive (%s).",
GetName().c_str());
// TODO(bunnei): Use correct error code
@@ -79,6 +79,12 @@ u64 RomFS_FileSystem::GetFreeSpaceSize() const {
return 0;
}
+ResultVal<FileSys::EntryType> RomFS_FileSystem::GetEntryType(const std::string& path) const {
+ LOG_CRITICAL(Service_FS, "Called within an ROMFS archive (path %s).", path.c_str());
+ // TODO(wwylele): Use correct error code
+ return ResultCode(-1);
+}
+
ResultVal<size_t> RomFS_Storage::Read(const u64 offset, const size_t length, u8* buffer) const {
LOG_TRACE(Service_FS, "called offset=%llu, length=%zu", offset, length);
romfs_file->Seek(data_offset + offset, SEEK_SET);