romfs_factory.h 947 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2018 yuzu emulator team
  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/filesystem.h"
  10. #include "core/hle/result.h"
  11. #include "core/loader/loader.h"
  12. namespace FileSys {
  13. /// File system interface to the RomFS archive
  14. class RomFS_Factory final : public FileSystemFactory {
  15. public:
  16. explicit RomFS_Factory(Loader::AppLoader& app_loader);
  17. std::string GetName() const override {
  18. return "ArchiveFactory_RomFS";
  19. }
  20. ResultVal<std::unique_ptr<FileSystemBackend>> Open(const Path& path) override;
  21. ResultCode Format(const Path& path) override;
  22. ResultVal<ArchiveFormatInfo> GetFormatInfo(const Path& path) const override;
  23. private:
  24. std::shared_ptr<FileUtil::IOFile> romfs_file;
  25. u64 data_offset;
  26. u64 data_size;
  27. };
  28. } // namespace FileSys