diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs
index 13f2ed09..b99386e0 100644
--- a/SabreTools.Library/DatFiles/DatFile.cs
+++ b/SabreTools.Library/DatFiles/DatFile.cs
@@ -4736,16 +4736,16 @@ namespace SabreTools.Library.DatFiles
/// List of inputs to be used
/// Output directory for the split files
/// True if files should be written to the source folders, false otherwise
- /// Type of split to perform, if any
+ /// Type of split to perform, if any
/// First extension to split on (Extension Split only)
/// Second extension to split on (Extension Split only)
/// True if short filenames should be used, false otherwise (Level Split only)
/// True if original filenames should be used as the base for output filename, false otherwise (Level Split only)
- public void DetermineSplitType(List inputs, string outDir, bool inplace, ExternalSplitType splitType,
+ public void DetermineSplitType(List inputs, string outDir, bool inplace, SplittingMode splittingMode,
List exta, List extb, bool shortname, bool basedat)
{
// If we somehow have the "none" split type, return
- if (splitType == ExternalSplitType.None)
+ if (splittingMode == SplittingMode.None)
{
return;
}
@@ -4766,19 +4766,19 @@ namespace SabreTools.Library.DatFiles
outDir = Utilities.GetOutputPath(outDir, file, inplace, splitpath: true);
// Split and write the DAT
- if ((splitType & ExternalSplitType.Extension) != 0)
+ if ((splittingMode & SplittingMode.Extension) != 0)
{
SplitByExtension(outDir, inplace, exta, extb);
}
- if ((splitType & ExternalSplitType.Hash) != 0)
+ if ((splittingMode & SplittingMode.Hash) != 0)
{
SplitByHash(outDir, inplace);
}
- if ((splitType & ExternalSplitType.Level) != 0)
+ if ((splittingMode & SplittingMode.Level) != 0)
{
SplitByLevel(outDir, inplace, shortname, basedat);
}
- if ((splitType & ExternalSplitType.Type) != 0)
+ if ((splittingMode & SplittingMode.Type) != 0)
{
SplitByType(outDir, inplace);
}
diff --git a/SabreTools.Library/Data/Flags.cs b/SabreTools.Library/Data/Flags.cs
index a716c0f4..6c851e4b 100644
--- a/SabreTools.Library/Data/Flags.cs
+++ b/SabreTools.Library/Data/Flags.cs
@@ -222,20 +222,6 @@ namespace SabreTools.Library.Data
ALL = 0xFFFFFFF,
}
- ///
- /// Determines how the DAT will be split on output
- ///
- [Flags]
- public enum ExternalSplitType
- {
- None = 0x0,
-
- Extension = 0x01,
- Hash = Extension << 1,
- Level = Hash << 1,
- Type = Level << 1,
- }
-
///
/// Determine what hashes to strip from the DAT
///
@@ -271,6 +257,20 @@ namespace SabreTools.Library.Data
All = Textfile | HTML | CSV | TSV,
}
+ ///
+ /// Determines how the DAT will be split on output
+ ///
+ [Flags]
+ public enum SplittingMode
+ {
+ None = 0x0,
+
+ Extension = 0x01,
+ Hash = Extension << 1,
+ Level = Hash << 1,
+ Type = Level << 1,
+ }
+
///
/// Determines special update modes
///
diff --git a/SabreTools/SabreTools.Inits.cs b/SabreTools/SabreTools.Inits.cs
index a75d8e2a..0b86f504 100644
--- a/SabreTools/SabreTools.Inits.cs
+++ b/SabreTools/SabreTools.Inits.cs
@@ -250,17 +250,17 @@ namespace SabreTools
/// Output directory for the split files
/// True if files should be written to the source folders, false otherwise
/// DatFormat to be used for outputting the DAT
- /// Type of split to perform, if any
+ /// Type of split to perform, if any
/// First extension to split on (Extension Split only)
/// Second extension to split on (Extension Split only)
/// True if short filenames should be used, false otherwise (Level Split only)
/// True if original filenames should be used as the base for output filename, false otherwise (Level Split only)
private static void InitSplit(List inputs, string outDir, bool inplace, DatFormat datFormat,
- ExternalSplitType splitType, List exta, List extb, bool shortname, bool basedat)
+ SplittingMode splittingMode, List exta, List extb, bool shortname, bool basedat)
{
DatFile datfile = new DatFile();
datfile.DatFormat = datFormat;
- datfile.DetermineSplitType(inputs, outDir, inplace, splitType, exta, extb, shortname, basedat);
+ datfile.DetermineSplitType(inputs, outDir, inplace, splittingMode, exta, extb, shortname, basedat);
}
///
diff --git a/SabreTools/SabreTools.cs b/SabreTools/SabreTools.cs
index 550f046e..5550af78 100644
--- a/SabreTools/SabreTools.cs
+++ b/SabreTools/SabreTools.cs
@@ -119,11 +119,11 @@ namespace SabreTools
usegame = true;
DatFormat datFormat = 0x0;
DedupeType dedup = DedupeType.None;
- ExternalSplitType externalSplitType = ExternalSplitType.None;
Hash omitFromScan = Hash.DeepHashes; // TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually
Hash stripHash = 0x0;
OutputFormat outputFormat = OutputFormat.Folder;
SkipFileType skipFileType = SkipFileType.None;
+ SplittingMode splittingMode = SplittingMode.None;
SplitType splitType = SplitType.None;
StatReportFormat statDatFormat = StatReportFormat.None;
UpdateMode updateMode = UpdateMode.None;
@@ -360,7 +360,7 @@ namespace SabreTools
break;
case "-es":
case "--ext":
- externalSplitType |= ExternalSplitType.Extension;
+ splittingMode |= SplittingMode.Extension;
break;
case "-f":
case "--files":
@@ -384,7 +384,7 @@ namespace SabreTools
break;
case "-hs":
case "--hash":
- externalSplitType |= ExternalSplitType.Hash;
+ splittingMode |= SplittingMode.Hash;
break;
case "-ic":
case "--ignore-chd":
@@ -400,7 +400,7 @@ namespace SabreTools
break;
case "-ls":
case "--level":
- externalSplitType |= ExternalSplitType.Level;
+ splittingMode |= SplittingMode.Level;
break;
case "-m":
case "--merge":
@@ -628,7 +628,7 @@ namespace SabreTools
break;
case "-ts":
case "--type":
- externalSplitType |= ExternalSplitType.Type;
+ splittingMode |= SplittingMode.Type;
break;
case "-tsv":
case "--tsv":
@@ -1302,7 +1302,7 @@ namespace SabreTools
// Split a DAT by the split type
else if (split)
{
- InitSplit(inputs, outDir, inplace, datFormat, externalSplitType, exta, extb, shortname, basedat);
+ InitSplit(inputs, outDir, inplace, datFormat, splittingMode, exta, extb, shortname, basedat);
}
// Get statistics on input files