From 00851a5ef442947c4237f32e063c37e7751db3ed Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 19 Jan 2018 22:34:48 -0500 Subject: file_sys: Cleanup to better match Switch file system constructs. file_sys: Add factory class for RomFS file system. --- src/core/file_sys/romfs_factory.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/core/file_sys/romfs_factory.h (limited to 'src/core/file_sys/romfs_factory.h') diff --git a/src/core/file_sys/romfs_factory.h b/src/core/file_sys/romfs_factory.h new file mode 100644 index 000000000..10ea13966 --- /dev/null +++ b/src/core/file_sys/romfs_factory.h @@ -0,0 +1,35 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include +#include +#include "common/common_types.h" +#include "core/file_sys/filesystem.h" +#include "core/hle/result.h" +#include "core/loader/loader.h" + +namespace FileSys { + +/// File system interface to the RomFS archive +class RomFS_Factory final : public FileSystemFactory { +public: + explicit RomFS_Factory(Loader::AppLoader& app_loader); + + std::string GetName() const override { + return "ArchiveFactory_RomFS"; + } + ResultVal> Open(const Path& path) override; + ResultCode Format(const Path& path, const FileSys::ArchiveFormatInfo& format_info) override; + ResultVal GetFormatInfo(const Path& path) const override; + +private: + std::shared_ptr romfs_file; + u64 data_offset; + u64 data_size; +}; + +} // namespace FileSys -- cgit v1.2.3