mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #1080] Standardize extraction API to WriteToDirectory with IProgress support #1508
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/1080
State: closed
Merged: Yes
Standardize on WriteToDirectory Naming
This PR resolves the naming inconsistency between
WriteToDirectoryandExtractToDirectorymethods as requested in the issue.Changes Made
1. ✅ Removed
ExtractToDirectorymethodIArchiveExtensions.csto standardize onWriteToDirectorynaming2. ✅ Enhanced
WriteToDirectoryoverloadsExtractAllEntries()for optimal performanceIProgress<ProgressReport>for consistent progress reporting (without CancellationToken for sync methods)3. ✅ Added
WriteToDirectoryAsyncIArchivewith full async/await supportIProgress<ProgressReport>progress reporting, and cancellation tokens4. ✅ Updated Tests
ArchiveExtractToDirectorytest helper to useWriteToDirectoryWriteToDirectoryAsyncmethodIProgress<ProgressReport>5. ✅ Code Quality
emptyDirectorytoparentDirectory6. ✅ Merged master branch
7. ✅ Standardized on IProgress
Action<double>withIProgress<ProgressReport>for consistency with the rest of the codebase8. ✅ Code Formatting
dotnet csharpier check .anddotnet csharpier format .9. ✅ Removed CancellationToken from sync method
CancellationTokenparameter from synchronousWriteToDirectory(string, ExtractionOptions?, IProgress<ProgressReport>?)API Consistency Verification
All archive and reader types now have consistent
WriteTo*naming patterns:IArchive (IArchiveExtensions):
IArchiveEntry (IArchiveEntryExtensions):
IReader (IReaderExtensions):
ArchiveFactory (static):
Breaking Change Notice
⚠️ Breaking Change:
ExtractToDirectorymethod has been removed.Migration Guide:
Test Results
Files Modified
src/SharpCompress/Archives/IArchiveExtensions.cs- Main API changes with IProgress and formattingtests/SharpCompress.Test/ArchiveTests.cs- Test helper updatetests/SharpCompress.Test/Zip/ZipArchiveAsyncTests.cs- New async tests with progressAGENTS.md- Added detailed documentation for check-format processOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.