mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Splitting to actual class
This commit is contained in:
@@ -8,14 +8,24 @@ using System.Threading.Tasks;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.DatItems;
|
||||
using SabreTools.IO;
|
||||
using SabreTools.Logging;
|
||||
using NaturalSort;
|
||||
|
||||
// This file represents all methods related to splitting a DatFile into multiple
|
||||
namespace SabreTools.DatFiles
|
||||
{
|
||||
// TODO: Implement Level split
|
||||
public partial class DatTool
|
||||
public class Splitter
|
||||
{
|
||||
#region Logging
|
||||
|
||||
/// <summary>
|
||||
/// Logging object
|
||||
/// </summary>
|
||||
private static readonly Logger logger = new Logger();
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Split a DAT by input extensions
|
||||
/// </summary>
|
||||
@@ -303,7 +313,7 @@ namespace SabreTools.DatFiles
|
||||
newDatFile.Header.Type = null;
|
||||
|
||||
// Write out the temporary DAT to the proper directory
|
||||
Write(newDatFile, outDir);
|
||||
DatTool.Write(newDatFile, outDir);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -63,7 +63,7 @@ namespace SabreTools.Features
|
||||
// Extension splitting
|
||||
if (splittingMode.HasFlag(SplittingMode.Extension))
|
||||
{
|
||||
(DatFile extADat, DatFile extBDat) = DatTool.SplitByExtension(internalDat, GetList(features, ExtAListValue), GetList(features, ExtBListValue));
|
||||
(DatFile extADat, DatFile extBDat) = Splitter.SplitByExtension(internalDat, GetList(features, ExtAListValue), GetList(features, ExtBListValue));
|
||||
|
||||
InternalStopwatch watch = new InternalStopwatch("Outputting extension-split DATs");
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace SabreTools.Features
|
||||
// Hash splitting
|
||||
if (splittingMode.HasFlag(SplittingMode.Hash))
|
||||
{
|
||||
Dictionary<Field, DatFile> typeDats = DatTool.SplitByHash(internalDat);
|
||||
Dictionary<Field, DatFile> typeDats = Splitter.SplitByHash(internalDat);
|
||||
|
||||
InternalStopwatch watch = new InternalStopwatch("Outputting hash-split DATs");
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace SabreTools.Features
|
||||
if (splittingMode.HasFlag(SplittingMode.Level))
|
||||
{
|
||||
logger.Warning("This feature is not implemented: level-split");
|
||||
DatTool.SplitByLevel(
|
||||
Splitter.SplitByLevel(
|
||||
internalDat,
|
||||
OutputDir,
|
||||
GetBoolean(features, ShortValue),
|
||||
@@ -104,7 +104,7 @@ namespace SabreTools.Features
|
||||
// Size splitting
|
||||
if (splittingMode.HasFlag(SplittingMode.Size))
|
||||
{
|
||||
(DatFile lessThan, DatFile greaterThan) = DatTool.SplitBySize(internalDat, GetInt64(features, RadixInt64Value));
|
||||
(DatFile lessThan, DatFile greaterThan) = Splitter.SplitBySize(internalDat, GetInt64(features, RadixInt64Value));
|
||||
|
||||
InternalStopwatch watch = new InternalStopwatch("Outputting size-split DATs");
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace SabreTools.Features
|
||||
// Type splitting
|
||||
if (splittingMode.HasFlag(SplittingMode.Type))
|
||||
{
|
||||
Dictionary<ItemType, DatFile> typeDats = DatTool.SplitByType(internalDat);
|
||||
Dictionary<ItemType, DatFile> typeDats = Splitter.SplitByType(internalDat);
|
||||
|
||||
InternalStopwatch watch = new InternalStopwatch("Outputting ItemType DATs");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user