ISO: Remove psf hack
This commit is contained in:
@@ -257,6 +257,8 @@ namespace fs
|
|||||||
// Open file with specified mode
|
// Open file with specified mode
|
||||||
explicit file(const std::string& path, bs_t<open_mode> mode = ::fs::read);
|
explicit file(const std::string& path, bs_t<open_mode> mode = ::fs::read);
|
||||||
|
|
||||||
|
file(std::unique_ptr<file_base>&& ptr) : m_file(std::move(ptr)) {}
|
||||||
|
|
||||||
static file from_native_handle(native_handle handle);
|
static file from_native_handle(native_handle handle);
|
||||||
|
|
||||||
// Open memory for read
|
// Open memory for read
|
||||||
|
|||||||
@@ -348,10 +348,7 @@ psf::registry iso_archive::open_psf(const std::string& path)
|
|||||||
auto* archive_file = retrieve(path);
|
auto* archive_file = retrieve(path);
|
||||||
if (!archive_file) return psf::registry();
|
if (!archive_file) return psf::registry();
|
||||||
|
|
||||||
// HACK: psf does not accept a file_base argument,
|
const fs::file psf_file(std::make_unique<iso_file>(fs::file(m_path), *archive_file));
|
||||||
// instead we are creating a dummy fs::file and replacing the internal file_base handle with an iso_file
|
|
||||||
fs::file psf_file(path);
|
|
||||||
psf_file.reset(std::make_unique<iso_file>(fs::file(m_path), *archive_file));
|
|
||||||
|
|
||||||
return psf::load_object(psf_file, path);
|
return psf::load_object(psf_file, path);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user