summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/ivfc_archive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/file_sys/ivfc_archive.cpp')
-rw-r--r--src/core/file_sys/ivfc_archive.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp
index af59d296d..2735d2e3c 100644
--- a/src/core/file_sys/ivfc_archive.cpp
+++ b/src/core/file_sys/ivfc_archive.cpp
@@ -18,7 +18,7 @@ std::string IVFCArchive::GetName() const {
}
ResultVal<std::unique_ptr<FileBackend>> IVFCArchive::OpenFile(const Path& path,
- const Mode mode) const {
+ const Mode& mode) const {
return MakeResult<std::unique_ptr<FileBackend>>(
std::make_unique<IVFCFile>(romfs_file, data_offset, data_size));
}
@@ -31,22 +31,25 @@ ResultCode IVFCArchive::DeleteFile(const Path& path) const {
ErrorLevel::Status);
}
-bool IVFCArchive::RenameFile(const Path& src_path, const Path& dest_path) const {
+ResultCode IVFCArchive::RenameFile(const Path& src_path, const Path& dest_path) const {
LOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive (%s).",
GetName().c_str());
- return false;
+ // TODO(wwylele): Use correct error code
+ return ResultCode(-1);
}
-bool IVFCArchive::DeleteDirectory(const Path& path) const {
+ResultCode IVFCArchive::DeleteDirectory(const Path& path) const {
LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive (%s).",
GetName().c_str());
- return false;
+ // TODO(wwylele): Use correct error code
+ return ResultCode(-1);
}
-bool IVFCArchive::DeleteDirectoryRecursively(const Path& path) const {
+ResultCode IVFCArchive::DeleteDirectoryRecursively(const Path& path) const {
LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive (%s).",
GetName().c_str());
- return false;
+ // TODO(wwylele): Use correct error code
+ return ResultCode(-1);
}
ResultCode IVFCArchive::CreateFile(const Path& path, u64 size) const {
@@ -57,20 +60,22 @@ ResultCode IVFCArchive::CreateFile(const Path& path, u64 size) const {
ErrorLevel::Permanent);
}
-bool IVFCArchive::CreateDirectory(const Path& path) const {
+ResultCode IVFCArchive::CreateDirectory(const Path& path) const {
LOG_CRITICAL(Service_FS, "Attempted to create a directory in an IVFC archive (%s).",
GetName().c_str());
- return false;
+ // TODO(wwylele): Use correct error code
+ return ResultCode(-1);
}
-bool IVFCArchive::RenameDirectory(const Path& src_path, const Path& dest_path) const {
+ResultCode IVFCArchive::RenameDirectory(const Path& src_path, const Path& dest_path) const {
LOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive (%s).",
GetName().c_str());
- return false;
+ // TODO(wwylele): Use correct error code
+ return ResultCode(-1);
}
-std::unique_ptr<DirectoryBackend> IVFCArchive::OpenDirectory(const Path& path) const {
- return std::make_unique<IVFCDirectory>();
+ResultVal<std::unique_ptr<DirectoryBackend>> IVFCArchive::OpenDirectory(const Path& path) const {
+ return MakeResult<std::unique_ptr<DirectoryBackend>>(std::make_unique<IVFCDirectory>());
}
u64 IVFCArchive::GetFreeBytes() const {