Data and Tools -> Core

This commit is contained in:
Matt Nadareski
2020-12-08 13:23:59 -08:00
parent 174be6ca54
commit b41ae7a7c3
133 changed files with 1239 additions and 1353 deletions

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using SabreTools.Data;
using SabreTools.Core;
namespace SabreTools.IO
{

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
// TODO: Figure out a reasonable way of adding logging back to this
namespace SabreTools.IO
{
/// <summary>
@@ -92,34 +91,13 @@ namespace SabreTools.IO
}
// Get the parent path in case of appending
string parentPath;
try
{
parentPath = Path.GetFullPath(input);
}
catch (Exception ex)
{
//LoggerImpl.Error(ex, $"An exception occurred getting the full path for '{input}'");
continue;
}
string parentPath = Path.GetFullPath(input);
if (Directory.Exists(input))
{
List<string> directories = GetDirectoriesOrdered(input, pattern);
foreach (string dir in directories)
{
try
{
outputs.Add(new ParentablePath(Path.GetFullPath(dir), appendparent ? parentPath : string.Empty));
}
catch (PathTooLongException ex)
{
//LoggerImpl.Warning(ex, $"The path for '{dir}' was too long");
}
catch (Exception ex)
{
//LoggerImpl.Error(ex, $"An exception occurred processing '{dir}'");
}
outputs.Add(new ParentablePath(Path.GetFullPath(dir), appendparent ? parentPath : string.Empty));
}
}
}
@@ -188,50 +166,18 @@ namespace SabreTools.IO
}
// Get the parent path in case of appending
string parentPath;
try
{
parentPath = Path.GetFullPath(input);
}
catch (Exception ex)
{
//LoggerImpl.Error(ex, $"An exception occurred getting the full path for '{input}'");
continue;
}
string parentPath = Path.GetFullPath(input);
if (Directory.Exists(input))
{
List<string> files = GetFilesOrdered(input, pattern);
foreach (string file in files)
{
try
{
outputs.Add(new ParentablePath(Path.GetFullPath(file), appendparent ? parentPath : string.Empty));
}
catch (PathTooLongException ex)
{
//LoggerImpl.Warning(ex, $"The path for '{file}' was too long");
}
catch (Exception ex)
{
//LoggerImpl.Error(ex, $"An exception occurred processing '{file}'");
}
outputs.Add(new ParentablePath(Path.GetFullPath(file), appendparent ? parentPath : string.Empty));
}
}
else if (File.Exists(input))
{
try
{
outputs.Add(new ParentablePath(Path.GetFullPath(input), appendparent ? parentPath : string.Empty));
}
catch (PathTooLongException ex)
{
//LoggerImpl.Warning(ex, $"The path for '{input}' was too long");
}
catch (Exception ex)
{
//LoggerImpl.Error(ex, $"An exception occurred processing '{input}'");
}
outputs.Add(new ParentablePath(Path.GetFullPath(input), appendparent ? parentPath : string.Empty));
}
}

View File

@@ -3,7 +3,7 @@ using System.Linq;
using System.Security.Cryptography;
using Aaru.Checksums;
using SabreTools.Data;
using SabreTools.Core;
namespace SabreTools.IO
{

View File

@@ -1,6 +1,6 @@
using System.IO;
using SabreTools.Data;
using SabreTools.Core;
namespace SabreTools.IO
{

View File

@@ -12,7 +12,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SabreTools.Data\SabreTools.Data.csproj" />
<ProjectReference Include="..\SabreTools.Core\SabreTools.Core.csproj" />
</ItemGroup>
</Project>