summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorGravatar wwylele2017-02-10 17:15:26 +0200
committerGravatar wwylele2017-02-13 13:57:38 +0200
commit20544977dab5b00a86c73572b94e7e75a7499f7a (patch)
tree1c5f2e443a8c73d70cfbf52b0e5783f99d831802 /src/core/file_sys
parentfile_sys: add Self NCCH archive (diff)
downloadyuzu-20544977dab5b00a86c73572b94e7e75a7499f7a.tar.gz
yuzu-20544977dab5b00a86c73572b94e7e75a7499f7a.tar.xz
yuzu-20544977dab5b00a86c73572b94e7e75a7499f7a.zip
loader: use self NCCH archive
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/archive_romfs.cpp43
-rw-r--r--src/core/file_sys/archive_romfs.h38
2 files changed, 0 insertions, 81 deletions
diff --git a/src/core/file_sys/archive_romfs.cpp b/src/core/file_sys/archive_romfs.cpp
deleted file mode 100644
index 6c99ca5b4..000000000
--- a/src/core/file_sys/archive_romfs.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <algorithm>
6#include <memory>
7#include "common/common_types.h"
8#include "common/logging/log.h"
9#include "core/file_sys/archive_romfs.h"
10#include "core/file_sys/ivfc_archive.h"
11
12////////////////////////////////////////////////////////////////////////////////////////////////////
13// FileSys namespace
14
15namespace FileSys {
16
17ArchiveFactory_RomFS::ArchiveFactory_RomFS(Loader::AppLoader& app_loader) {
18 // Load the RomFS from the app
19 if (Loader::ResultStatus::Success != app_loader.ReadRomFS(romfs_file, data_offset, data_size)) {
20 LOG_ERROR(Service_FS, "Unable to read RomFS!");
21 }
22}
23
24ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_RomFS::Open(const Path& path) {
25 auto archive = std::make_unique<IVFCArchive>(romfs_file, data_offset, data_size);
26 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive));
27}
28
29ResultCode ArchiveFactory_RomFS::Format(const Path& path,
30 const FileSys::ArchiveFormatInfo& format_info) {
31 LOG_ERROR(Service_FS, "Attempted to format a RomFS archive.");
32 // TODO: Verify error code
33 return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::FS, ErrorSummary::NotSupported,
34 ErrorLevel::Permanent);
35}
36
37ResultVal<ArchiveFormatInfo> ArchiveFactory_RomFS::GetFormatInfo(const Path& path) const {
38 // TODO(Subv): Implement
39 LOG_ERROR(Service_FS, "Unimplemented GetFormatInfo archive %s", GetName().c_str());
40 return ResultCode(-1);
41}
42
43} // namespace FileSys
diff --git a/src/core/file_sys/archive_romfs.h b/src/core/file_sys/archive_romfs.h
deleted file mode 100644
index 1eaf99b54..000000000
--- a/src/core/file_sys/archive_romfs.h
+++ /dev/null
@@ -1,38 +0,0 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <memory>
8#include <string>
9#include <vector>
10#include "common/common_types.h"
11#include "core/file_sys/archive_backend.h"
12#include "core/hle/result.h"
13#include "core/loader/loader.h"
14
15////////////////////////////////////////////////////////////////////////////////////////////////////
16// FileSys namespace
17
18namespace FileSys {
19
20/// File system interface to the RomFS archive
21class ArchiveFactory_RomFS final : public ArchiveFactory {
22public:
23 explicit ArchiveFactory_RomFS(Loader::AppLoader& app_loader);
24
25 std::string GetName() const override {
26 return "RomFS";
27 }
28 ResultVal<std::unique_ptr<ArchiveBackend>> Open(const Path& path) override;
29 ResultCode Format(const Path& path, const FileSys::ArchiveFormatInfo& format_info) override;
30 ResultVal<ArchiveFormatInfo> GetFormatInfo(const Path& path) const override;
31
32private:
33 std::shared_ptr<FileUtil::IOFile> romfs_file;
34 u64 data_offset;
35 u64 data_size;
36};
37
38} // namespace FileSys