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.Core;
|
||||||
using SabreTools.DatItems;
|
using SabreTools.DatItems;
|
||||||
using SabreTools.IO;
|
using SabreTools.IO;
|
||||||
|
using SabreTools.Logging;
|
||||||
using NaturalSort;
|
using NaturalSort;
|
||||||
|
|
||||||
// This file represents all methods related to splitting a DatFile into multiple
|
// This file represents all methods related to splitting a DatFile into multiple
|
||||||
namespace SabreTools.DatFiles
|
namespace SabreTools.DatFiles
|
||||||
{
|
{
|
||||||
// TODO: Implement Level split
|
// 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>
|
/// <summary>
|
||||||
/// Split a DAT by input extensions
|
/// Split a DAT by input extensions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -303,7 +313,7 @@ namespace SabreTools.DatFiles
|
|||||||
newDatFile.Header.Type = null;
|
newDatFile.Header.Type = null;
|
||||||
|
|
||||||
// Write out the temporary DAT to the proper directory
|
// Write out the temporary DAT to the proper directory
|
||||||
Write(newDatFile, outDir);
|
DatTool.Write(newDatFile, outDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -63,7 +63,7 @@ namespace SabreTools.Features
|
|||||||
// Extension splitting
|
// Extension splitting
|
||||||
if (splittingMode.HasFlag(SplittingMode.Extension))
|
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");
|
InternalStopwatch watch = new InternalStopwatch("Outputting extension-split DATs");
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ namespace SabreTools.Features
|
|||||||
// Hash splitting
|
// Hash splitting
|
||||||
if (splittingMode.HasFlag(SplittingMode.Hash))
|
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");
|
InternalStopwatch watch = new InternalStopwatch("Outputting hash-split DATs");
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ namespace SabreTools.Features
|
|||||||
if (splittingMode.HasFlag(SplittingMode.Level))
|
if (splittingMode.HasFlag(SplittingMode.Level))
|
||||||
{
|
{
|
||||||
logger.Warning("This feature is not implemented: level-split");
|
logger.Warning("This feature is not implemented: level-split");
|
||||||
DatTool.SplitByLevel(
|
Splitter.SplitByLevel(
|
||||||
internalDat,
|
internalDat,
|
||||||
OutputDir,
|
OutputDir,
|
||||||
GetBoolean(features, ShortValue),
|
GetBoolean(features, ShortValue),
|
||||||
@@ -104,7 +104,7 @@ namespace SabreTools.Features
|
|||||||
// Size splitting
|
// Size splitting
|
||||||
if (splittingMode.HasFlag(SplittingMode.Size))
|
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");
|
InternalStopwatch watch = new InternalStopwatch("Outputting size-split DATs");
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ namespace SabreTools.Features
|
|||||||
// Type splitting
|
// Type splitting
|
||||||
if (splittingMode.HasFlag(SplittingMode.Type))
|
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");
|
InternalStopwatch watch = new InternalStopwatch("Outputting ItemType DATs");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user