rikyoz / bit7z

A C++ static library offering a clean and simple interface to the 7-zip shared libraries.
https://rikyoz.github.io/bit7z
Mozilla Public License 2.0
634 stars 116 forks source link

[Feature Request]: nice api for using different output names during decompressing #123

Open RScherzer opened 1 year ago

RScherzer commented 1 year ago

Feature description

While compression already has the options to modify the final name in the archive

std::map< std::string, std::string > files_map = {
    { "path/to/file1.jpg", "alias/path/file1.jpg" },
    { "path/to/file2.pdf", "alias/path/file2.pdf" }
};
compressor.compress( files_map, "output_archive2.zip" );

it would be great to have a feature for decompressing files directly to a newly chosen name

In 7zip SDK speech this could be achieved by having an ArchiveExtractCallback's GetStream function which opens the ISequentialOutStream for the file with the new name instead of the old name. You could also add code before that which recursively creates the possibly needed not existing subfolders for the new file.

Additional context

No response

Code of Conduct

rikyoz commented 1 year ago

it would be great to have a feature for decompressing files directly to a newly chosen name

Yeah, I think it would be a useful feature. I'll add it to the next v4.1. Thank you for the suggestion! 🙏