Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variants of FastZip.CreateZip that take filters as IScanFilter instead of strings #482

Merged
merged 1 commit into from
Aug 9, 2020

Conversation

Numpsy
Copy link
Contributor

@Numpsy Numpsy commented Jul 14, 2020

refs #405: Add simple extra versions of FastZip.CreateZip that take file/directory filters as instances of IScanFilter rather than strings.

No unit tests yet (There don't seem to be any tests for ExtendedPathFilter either?)

A possible small api compatibility issue: if you have a call like

zippy.CreateZip(tempZip.Filename, tempDir.Fullpath, true, null, null);

(as in an existing unit test I had to change), the two null literals for the filter parameters are ambiguous between the existing string overload and the new IScanFilter overload, which could possibly need a change to avoid?

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

@Numpsy Numpsy added the zip Related to ZIP file format label Jul 14, 2020
@Numpsy
Copy link
Contributor Author

Numpsy commented Jul 14, 2020

actually, I suppose there would also be a (sort of) conflict with #455 where that adds an extra overload with a leaveOpen param to the string-filter variants, and this would leave it without such an overload for the IScanFilter variants (hurrah for overload explision :-( )

@piksel piksel self-requested a review July 15, 2020 19:54
@piksel piksel self-assigned this Jul 15, 2020
@piksel
Copy link
Member

piksel commented Aug 7, 2020

Yeah, but both variants are really nice to have. The IScanFilter overload could just take the leaveOpen with a default value instead, so it shouldn't be that bad.

Copy link
Member

@piksel piksel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just needs the leaveOpen conflict resolved!

@Numpsy
Copy link
Contributor Author

Numpsy commented Aug 7, 2020

I'll get this updated tomorrow

@Numpsy Numpsy force-pushed the rw/fastzip/scan_filter branch from ce40eff to d80d966 Compare August 8, 2020 15:55
@Numpsy
Copy link
Contributor Author

Numpsy commented Aug 8, 2020

Rebased on top of the other changes, and changed the version of CreateZip that takes an output stream and the ScanFilters to have a leaveOpen parameter that defaults to false.

@piksel piksel merged commit 3491abb into icsharpcode:master Aug 9, 2020
@Numpsy Numpsy deleted the rw/fastzip/scan_filter branch August 9, 2020 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zip Related to ZIP file format
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants