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
623 stars 113 forks source link

Rename files and folders #43

Closed fabri9532 closed 11 months ago

fabri9532 commented 4 years ago

Is there a method to rename files and folders inside the compressed file? If it doesn't exist, can it be implemented?

Fabrizio.

rikyoz commented 4 years ago

Hi Fabrizio! Unfortunately, at the moment there is no such method. However, it should be possible to implement such a feature, even though it may require quite a few changes in both the external API and internal code of bit7z. Hopefully, I'll be able to implement it in the next stable version. Riccardo

fabri9532 commented 4 years ago

Thank you! Riccardo.

Fabrizio.

msghera commented 3 years ago

Is this thread still open for contribution ?

rikyoz commented 3 years ago

Hi! Yeah, sure! I'm still working on implementing this feature; unfortunately, it requires a lot of changes in the internal code of bit7z. During these last months, I've been busy with my main job, but now I'm going back to work on bit7z. I hope to finish this and the other pending features asap. Anyway, I'm open to any helpful contribution!

msghera commented 3 years ago

If the task is huge, you can share or I am find new areas for contribution.

rikyoz commented 11 months ago

Implemented in v4.0.0.

Now the BitArchiveEditor can be used for renaming/deleting files and folders inside archives.

Example:

BitArchiveEditor editor{ lib, "path/to/archive.7z", BitFormat::SevenZip };

// Set compressed_file1.txt to be renamed as compressed_file.txt.
editor.renameItem("compressed_file1.txt", "compressed_file.txt"); 

// Set folder/compressed_file2.txt to be deleted from the archive.
editor.deleteItem("folder/compressed_file2.txt");

// Applying the requested changes
editor.applyChanges();