diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-02-06 14:53:14 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-02-10 16:43:44 +0100 |
commit | 3f1a3952d707bce7851652ce54701ca14334f314 (patch) | |
tree | 04c79ff9887f0074813276cdf989e6814901e943 /src/core/file_sys/ivfc_archive.cpp | |
parent | FS: Get rid of completely useless Archive class (diff) | |
download | yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar.gz yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar.bz2 yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar.lz yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar.xz yuzu-3f1a3952d707bce7851652ce54701ca14334f314.tar.zst yuzu-3f1a3952d707bce7851652ce54701ca14334f314.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/ivfc_archive.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index 68c3c8b81..35aca54fa 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp @@ -15,11 +15,15 @@ namespace FileSys { -IVFCArchive::IVFCArchive() { +IVFCArchive::IVFCArchive(std::shared_ptr<const std::vector<u8>> data) : data(data) { +} + +std::string IVFCArchive::GetName() const { + return "IVFC"; } std::unique_ptr<FileBackend> IVFCArchive::OpenFile(const Path& path, const Mode mode) const { - return Common::make_unique<IVFCFile>(this); + return Common::make_unique<IVFCFile>(data); } bool IVFCArchive::DeleteFile(const Path& path) const { @@ -57,31 +61,25 @@ std::unique_ptr<DirectoryBackend> IVFCArchive::OpenDirectory(const Path& path) c return Common::make_unique<IVFCDirectory>(); } -ResultCode IVFCArchive::Format(const Path& path) const { - LOG_CRITICAL(Service_FS, "Attempted to format an IVFC archive (%s).", GetName().c_str()); - // TODO: Verify error code - return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::FS, ErrorSummary::NotSupported, ErrorLevel::Permanent); -} - //////////////////////////////////////////////////////////////////////////////////////////////////// size_t IVFCFile::Read(const u64 offset, const u32 length, u8* buffer) const { LOG_TRACE(Service_FS, "called offset=%llu, length=%d", offset, length); - memcpy(buffer, &archive->raw_data[(u32)offset], length); + memcpy(buffer, data->data() + offset, length); return length; } size_t IVFCFile::Write(const u64 offset, const u32 length, const u32 flush, const u8* buffer) const { - LOG_CRITICAL(Service_FS, "Attempted to write to IVFC file in archive %s.", archive->GetName().c_str()); + LOG_ERROR(Service_FS, "Attempted to write to IVFC file"); return 0; } size_t IVFCFile::GetSize() const { - return sizeof(u8) * archive->raw_data.size(); + return sizeof(u8) * data->size(); } bool IVFCFile::SetSize(const u64 size) const { - LOG_CRITICAL(Service_FS, "Attempted to set the size of an IVFC file in archive %s", archive->GetName().c_str()); + LOG_ERROR(Service_FS, "Attempted to set the size of an IVFC file"); return false; } |