Use Matching to replace NaturalSort

This commit is contained in:
Matt Nadareski
2024-02-29 21:20:44 -05:00
parent 4ed3c45722
commit 17c023efaa
24 changed files with 23 additions and 385 deletions

View File

@@ -1,7 +1,7 @@
using System.IO;
using System.Text;
using SabreTools.Core;
using SabreTools.IO;
using SabreTools.Matching;
namespace SabreTools.FileTypes.Aaru
{

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using SabreTools.Core;
using SabreTools.Matching;
#if NET462_OR_GREATER || NETCOREAPP
using SharpCompress.Archives;
using SharpCompress.Archives.Rar;
@@ -242,7 +243,7 @@ namespace SabreTools.FileTypes.Archives
try
{
SharpCompress.Archives.Rar.RarArchive ra = SharpCompress.Archives.Rar.RarArchive.Open(this.Filename, new ReaderOptions { LeaveStreamOpen = false });
List<RarArchiveEntry> rarEntries = ra.Entries.OrderBy(e => e.Key, new NaturalSort.NaturalReversedComparer()).ToList();
List<RarArchiveEntry> rarEntries = ra.Entries.OrderBy(e => e.Key, new NaturalReversedComparer()).ToList();
string? lastRarEntry = null;
foreach (RarArchiveEntry entry in rarEntries)
{

View File

@@ -2,12 +2,11 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using SabreTools.Core;
using SabreTools.Core.Tools;
using Compress;
using Compress.SevenZip;
using NaturalSort;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.Matching;
namespace SabreTools.FileTypes.Archives
{

View File

@@ -2,9 +2,10 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Compress;
using SabreTools.Core;
using SabreTools.Core.Tools;
using Compress;
using SabreTools.Matching;
#if NET462_OR_GREATER || NETCOREAPP
using SharpCompress.Archives;
using SharpCompress.Archives.Tar;
@@ -231,7 +232,7 @@ namespace SabreTools.FileTypes.Archives
try
{
TarArchive ta = TarArchive.Open(this.Filename!, new ReaderOptions { LeaveStreamOpen = false });
List<TarArchiveEntry> tarEntries = ta.Entries.OrderBy(e => e.Key, new NaturalSort.NaturalReversedComparer()).ToList();
List<TarArchiveEntry> tarEntries = ta.Entries.OrderBy(e => e.Key, new NaturalReversedComparer()).ToList();
string? lastTarEntry = null;
foreach (TarArchiveEntry entry in tarEntries)
{

View File

@@ -4,9 +4,9 @@ using System.IO;
using System.Linq;
using Compress;
using Compress.ZipFile;
using NaturalSort;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.Matching;
namespace SabreTools.FileTypes.Archives
{

View File

@@ -8,6 +8,7 @@ using SabreTools.FileTypes.Aaru;
using SabreTools.FileTypes.CHD;
using SabreTools.IO;
using SabreTools.Logging;
using SabreTools.Matching;
using SabreTools.Skippers;
namespace SabreTools.FileTypes

View File

@@ -21,7 +21,6 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\NaturalSort\NaturalSort.csproj" />
<ProjectReference Include="..\SabreTools.Core\SabreTools.Core.csproj" />
<ProjectReference Include="..\SabreTools.Logging\SabreTools.Logging.csproj" />
</ItemGroup>
@@ -35,6 +34,7 @@
<ItemGroup>
<PackageReference Include="SabreTools.IO" Version="1.3.0" />
<PackageReference Include="SabreTools.Matching" Version="1.3.1" />
<PackageReference Include="SabreTools.Skippers" Version="1.1.2" />
</ItemGroup>