archive_romfs.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <memory>
  6. #include <string>
  7. #include <vector>
  8. #include "common/common_types.h"
  9. #include "core/file_sys/archive_backend.h"
  10. #include "core/hle/result.h"
  11. #include "core/loader/loader.h"
  12. ////////////////////////////////////////////////////////////////////////////////////////////////////
  13. // FileSys namespace
  14. namespace FileSys {
  15. /// File system interface to the RomFS archive
  16. class ArchiveFactory_RomFS final : public ArchiveFactory {
  17. public:
  18. explicit ArchiveFactory_RomFS(Loader::AppLoader& app_loader);
  19. std::string GetName() const override {
  20. return "RomFS";
  21. }
  22. ResultVal<std::unique_ptr<ArchiveBackend>> Open(const Path& path) override;
  23. ResultCode Format(const Path& path, const FileSys::ArchiveFormatInfo& format_info) override;
  24. ResultVal<ArchiveFormatInfo> GetFormatInfo(const Path& path) const override;
  25. private:
  26. std::shared_ptr<FileUtil::IOFile> romfs_file;
  27. u64 data_offset;
  28. u64 data_size;
  29. };
  30. } // namespace FileSys