mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
move more zip parsings
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
8c36be048c
commit
f38a0c8f98
20 changed files with 167 additions and 251 deletions
|
|
@ -176,4 +176,21 @@ bool ArchiveWriter::addFile(ArchiveReader::File* f)
|
|||
{
|
||||
return f->writeFile(m_archive, "", true);
|
||||
}
|
||||
std::unique_ptr<archive, void (*)(archive*)> ArchiveWriter::createDiskWriter()
|
||||
{
|
||||
int flags = ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL | ARCHIVE_EXTRACT_FFLAGS;
|
||||
|
||||
std::unique_ptr<archive, void (*)(archive*)> extPtr(archive_write_disk_new(), [](archive* a) {
|
||||
if (a) {
|
||||
archive_write_close(a);
|
||||
archive_write_free(a);
|
||||
}
|
||||
});
|
||||
|
||||
archive* ext = extPtr.get();
|
||||
archive_write_disk_set_options(ext, flags);
|
||||
archive_write_disk_set_standard_lookup(ext);
|
||||
|
||||
return extPtr;
|
||||
}
|
||||
} // namespace MMCZip
|
||||
Loading…
Add table
Add a link
Reference in a new issue