Add UnZip method for a single file to TUnZipper
Original Reporter info from Mantis: wp @wpam
-
Reporter name:
Original Reporter info from Mantis: wp @wpam
- Reporter name:
Description:
Extracting a single file from a zip archive is an often-used operation when working with TUnzipper. Doing this, however, is a bit cumbersome: a stringlist must be created, the filename must be added to the stringlist, UnZipFiles must be invoked with the stringlist as parameter (and the name of the zip file -- or the name of the zip file must already have been assigned to the FileName property), and the stringlist must be destroyed.
It would be much more convenient to have an UnZipFile method which does all this in a single call:
procedure TForm1.Button2Click(Sender: TObject);
var
unzipper: TUnZipper;
begin
unzipper := TUnZipper.Create;
try
unzipper.UnZipFile('test.zip', 'project2.lpi'); // the second parameter is the file to be extracted
finally
unzipper.Free;
end;
end;
A patch is added to provide this functionality.
Mantis conversion info:
- Mantis ID: 36399
- Fixed in version: 3.3.1
- Fixed in revision: 43640 (#6747654f)
- Target version: 3.2.0