mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ALL] Move a couple things
This commit is contained in:
@@ -17,7 +17,6 @@ using MemoryStream = System.IO.MemoryStream;
|
|||||||
using PathTooLongException = System.IO.PathTooLongException;
|
using PathTooLongException = System.IO.PathTooLongException;
|
||||||
using Stream = System.IO.Stream;
|
using Stream = System.IO.Stream;
|
||||||
#endif
|
#endif
|
||||||
using OCRC;
|
|
||||||
|
|
||||||
namespace ROMVault2.SupportedFiles.Zip
|
namespace ROMVault2.SupportedFiles.Zip
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ using SabreTools.Library.Data;
|
|||||||
using SabreTools.Library.Tools;
|
using SabreTools.Library.Tools;
|
||||||
|
|
||||||
using Ionic.Zlib;
|
using Ionic.Zlib;
|
||||||
using OCRC;
|
|
||||||
|
|
||||||
namespace ROMVault2.SupportedFiles.Zip
|
namespace ROMVault2.SupportedFiles.Zip
|
||||||
{
|
{
|
||||||
|
|||||||
69
SabreTools.Library/External/Traverse.cs
vendored
69
SabreTools.Library/External/Traverse.cs
vendored
@@ -1,69 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
#if MONO
|
|
||||||
using System.IO;
|
|
||||||
#else
|
|
||||||
using Alphaleonis.Win32.Filesystem;
|
|
||||||
|
|
||||||
using IOException = System.IO.IOException;
|
|
||||||
using SearchOption = System.IO.SearchOption;
|
|
||||||
#endif
|
|
||||||
using SabreTools.Library.Data;
|
|
||||||
|
|
||||||
namespace SabreTools.Library.External
|
|
||||||
{
|
|
||||||
public class Traverse
|
|
||||||
{
|
|
||||||
/// Original version: Microsoft (example code), updated by edc
|
|
||||||
public void TraverseTreeParallelForEach(string root, Action<FileInfo> action)
|
|
||||||
{
|
|
||||||
List<string> dirs = new List<string>();
|
|
||||||
|
|
||||||
if (!Directory.Exists(root))
|
|
||||||
{
|
|
||||||
throw new ArgumentException();
|
|
||||||
}
|
|
||||||
|
|
||||||
dirs.Add(root);
|
|
||||||
|
|
||||||
List<string> subdirs = new List<string>();
|
|
||||||
|
|
||||||
while (dirs.Count > 0 || subdirs.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (string dir in subdirs)
|
|
||||||
{
|
|
||||||
dirs.Add(dir);
|
|
||||||
}
|
|
||||||
subdirs.Clear();
|
|
||||||
|
|
||||||
foreach (string currentDir in dirs)
|
|
||||||
{
|
|
||||||
string[] subDirs = Directory.GetDirectories(currentDir);
|
|
||||||
|
|
||||||
lock (subdirs)
|
|
||||||
{
|
|
||||||
foreach (string str in subDirs)
|
|
||||||
{
|
|
||||||
subdirs.Add(str);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var dir = new DirectoryInfo(currentDir);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
FileInfo[] files = dir.GetFiles("*.*", SearchOption.TopDirectoryOnly);
|
|
||||||
Parallel.ForEach(files, Globals.ParallelOptions, info =>
|
|
||||||
{
|
|
||||||
action(info);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
}
|
|
||||||
|
|
||||||
dirs.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@ using SabreTools.Library.Data;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// http://www.rarlab.com/technote.htm#srvheaders
|
/// http://www.rarlab.com/technote.htm#srvheaders
|
||||||
/// </summary>
|
/// </summary>
|
||||||
namespace SabreTools.Library.Tools
|
namespace SabreTools.Library.FileTypes
|
||||||
{
|
{
|
||||||
public class CoreRarArchive
|
public class CoreRarArchive
|
||||||
{
|
{
|
||||||
@@ -131,11 +131,10 @@
|
|||||||
<Compile Include="DatFiles\SeparatedValue.cs" />
|
<Compile Include="DatFiles\SeparatedValue.cs" />
|
||||||
<Compile Include="DatFiles\SoftwareList.cs" />
|
<Compile Include="DatFiles\SoftwareList.cs" />
|
||||||
<Compile Include="FileTypes\CHDFile.cs" />
|
<Compile Include="FileTypes\CHDFile.cs" />
|
||||||
<Compile Include="External\CoreRarArchive.cs" />
|
<Compile Include="FileTypes\CoreRarArchive.cs" />
|
||||||
<Compile Include="External\NaturalSort\NaturalComparer.cs" />
|
<Compile Include="External\NaturalSort\NaturalComparer.cs" />
|
||||||
<Compile Include="External\NaturalSort\NaturalReversedComparer.cs" />
|
<Compile Include="External\NaturalSort\NaturalReversedComparer.cs" />
|
||||||
<Compile Include="External\OptimizedCRC.cs" />
|
<Compile Include="Tools\OptimizedCRC.cs" />
|
||||||
<Compile Include="External\Traverse.cs" />
|
|
||||||
<Compile Include="External\xxHash\xxHash.cs" />
|
<Compile Include="External\xxHash\xxHash.cs" />
|
||||||
<Compile Include="External\Zlib\CRC32.cs" />
|
<Compile Include="External\Zlib\CRC32.cs" />
|
||||||
<Compile Include="External\Zlib\Deflate.cs" />
|
<Compile Include="External\Zlib\Deflate.cs" />
|
||||||
|
|||||||
@@ -23,9 +23,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace OCRC
|
namespace SabreTools.Library.Tools
|
||||||
{
|
{
|
||||||
public class OptimizedCRC : IDisposable
|
public class OptimizedCRC : IDisposable
|
||||||
{
|
{
|
||||||
@@ -35,7 +35,6 @@ using Stream = System.IO.Stream;
|
|||||||
using StreamReader = System.IO.StreamReader;
|
using StreamReader = System.IO.StreamReader;
|
||||||
#endif
|
#endif
|
||||||
using NaturalSort;
|
using NaturalSort;
|
||||||
using OCRC;
|
|
||||||
using SharpCompress.Common;
|
using SharpCompress.Common;
|
||||||
|
|
||||||
namespace SabreTools.Library.Tools
|
namespace SabreTools.Library.Tools
|
||||||
|
|||||||
Reference in New Issue
Block a user