mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[Filter] Filter was getting unweildy, make it more streamlined to use
This commit is contained in:
@@ -9,106 +9,199 @@ namespace SabreTools.Helper.Dats
|
||||
{
|
||||
#region Private instance variables
|
||||
|
||||
#region Positive
|
||||
|
||||
private List<string> _gameNames;
|
||||
private List<string> _notGameNames;
|
||||
private List<string> _romNames;
|
||||
private List<string> _notRomNames;
|
||||
private List<string> _romTypes;
|
||||
private List<string> _crcs;
|
||||
private List<string> _md5s;
|
||||
private List<string> _sha1s;
|
||||
private ItemStatus _itemStatuses;
|
||||
private MachineType _machineTypes;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Negative
|
||||
|
||||
private List<string> _notGameNames;
|
||||
private List<string> _notRomNames;
|
||||
private List<string> _notRomTypes;
|
||||
private List<string> _notCrcs;
|
||||
private List<string> _notMd5s;
|
||||
private List<string> _notSha1s;
|
||||
private ItemStatus _itemNotStatuses;
|
||||
private MachineType _machineNotTypes;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Neutral
|
||||
|
||||
private long _sizeGreaterThanOrEqual;
|
||||
private long _sizeLessThanOrEqual;
|
||||
private long _sizeEqualTo;
|
||||
private List<string> _crcs;
|
||||
private List<string> _notCrcs;
|
||||
private List<string> _md5s;
|
||||
private List<string> _notMd5s;
|
||||
private List<string> _sha1s;
|
||||
private List<string> _notSha1s;
|
||||
private ItemStatus _itemStatuses;
|
||||
private ItemStatus _itemNotStatuses;
|
||||
private MachineType _machineTypes;
|
||||
private MachineType _machineNotTypes;
|
||||
private bool? _runnable;
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion // Private instance variables
|
||||
|
||||
#region Pubically facing variables
|
||||
|
||||
#region Positive
|
||||
|
||||
public List<string> GameNames
|
||||
{
|
||||
get { return _gameNames; }
|
||||
set { _gameNames = value; }
|
||||
}
|
||||
public List<string> RomNames
|
||||
{
|
||||
get { return _romNames; }
|
||||
set { _romNames = value; }
|
||||
}
|
||||
public List<string> RomTypes
|
||||
{
|
||||
get { return _romTypes; }
|
||||
set { _romTypes = value; }
|
||||
}
|
||||
public List<string> CRCs
|
||||
{
|
||||
get { return _crcs; }
|
||||
set { _crcs = value; }
|
||||
}
|
||||
public List<string> MD5s
|
||||
{
|
||||
get { return _md5s; }
|
||||
set { _md5s = value; }
|
||||
}
|
||||
public List<string> SHA1s
|
||||
{
|
||||
get { return _sha1s; }
|
||||
set { _sha1s = value; }
|
||||
}
|
||||
public ItemStatus ItemStatuses
|
||||
{
|
||||
get { return _itemStatuses; }
|
||||
set { _itemStatuses = value; }
|
||||
}
|
||||
public MachineType MachineTypes
|
||||
{
|
||||
get { return _machineTypes; }
|
||||
set { _machineTypes = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Negative
|
||||
|
||||
public List<string> NotGameNames
|
||||
{
|
||||
get { return _notGameNames; }
|
||||
set { _notGameNames = value; }
|
||||
}
|
||||
public List<string> NotRomNames
|
||||
{
|
||||
get { return _notRomNames; }
|
||||
set { _notRomNames = value; }
|
||||
}
|
||||
public List<string> NotRomTypes
|
||||
{
|
||||
get { return _notRomTypes; }
|
||||
set { _notRomTypes = value; }
|
||||
}
|
||||
public List<string> NotCRCs
|
||||
{
|
||||
get { return _notCrcs; }
|
||||
set { _notCrcs = value; }
|
||||
}
|
||||
public List<string> NotMD5s
|
||||
{
|
||||
get { return _notMd5s; }
|
||||
set { _notMd5s = value; }
|
||||
}
|
||||
public List<string> NotSHA1s
|
||||
{
|
||||
get { return _notSha1s; }
|
||||
set { _notSha1s = value; }
|
||||
}
|
||||
public ItemStatus NotItemStatuses
|
||||
{
|
||||
get { return _itemNotStatuses; }
|
||||
set { _itemNotStatuses = value; }
|
||||
}
|
||||
public MachineType NotMachineTypes
|
||||
{
|
||||
get { return _machineNotTypes; }
|
||||
set { _machineNotTypes = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Neutral
|
||||
|
||||
public long SizeGreaterThanOrEqual
|
||||
{
|
||||
get { return _sizeGreaterThanOrEqual; }
|
||||
set { _sizeGreaterThanOrEqual = value; }
|
||||
}
|
||||
public long SizeLessThanOrEqual
|
||||
{
|
||||
get { return _sizeLessThanOrEqual; }
|
||||
set { _sizeLessThanOrEqual = value; }
|
||||
}
|
||||
public long SizeEqualTo
|
||||
{
|
||||
get { return _sizeEqualTo; }
|
||||
set { _sizeEqualTo = value; }
|
||||
}
|
||||
public bool? Runnable
|
||||
{
|
||||
get { return _runnable; }
|
||||
set { _runnable = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion // Pubically facing variables
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Create an empty Filter object
|
||||
/// </summary>
|
||||
public Filter()
|
||||
{
|
||||
// Positive
|
||||
_gameNames = new List<string>();
|
||||
_notGameNames = new List<string>();
|
||||
_romNames = new List<string>();
|
||||
_notRomNames = new List<string>();
|
||||
_romTypes = new List<string>();
|
||||
_crcs = new List<string>();
|
||||
_md5s = new List<string>();
|
||||
_sha1s = new List<string>();
|
||||
_itemStatuses = ItemStatus.NULL;
|
||||
_machineTypes = MachineType.NULL;
|
||||
|
||||
// Negative
|
||||
_notGameNames = new List<string>();
|
||||
_notRomNames = new List<string>();
|
||||
_notRomTypes = new List<string>();
|
||||
_notCrcs = new List<string>();
|
||||
_notMd5s = new List<string>();
|
||||
_notSha1s = new List<string>();
|
||||
_itemNotStatuses = ItemStatus.NULL;
|
||||
_machineNotTypes = MachineType.NULL;
|
||||
|
||||
// Neutral
|
||||
_sizeGreaterThanOrEqual = -1;
|
||||
_sizeLessThanOrEqual = -1;
|
||||
_sizeEqualTo = -1;
|
||||
_crcs = new List<string>();
|
||||
_notCrcs = new List<string>();
|
||||
_md5s = new List<string>();
|
||||
_notMd5s = new List<string>();
|
||||
_sha1s = new List<string>();
|
||||
_notSha1s = new List<string>();
|
||||
_itemStatuses = ItemStatus.NULL;
|
||||
_itemNotStatuses = ItemStatus.NULL;
|
||||
_machineTypes = MachineType.NULL;
|
||||
_machineNotTypes = MachineType.NULL;
|
||||
_runnable = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a populated Filter object
|
||||
/// </summary>
|
||||
/// <param name="gamenames">Names of the games to match (can use asterisk-partials)</param>
|
||||
/// <param name="romnames">Names of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="romtypes">Types of the roms to match</param>
|
||||
/// <param name="sgt">Find roms greater than or equal to this size</param>
|
||||
/// <param name="slt">Find roms less than or equal to this size</param>
|
||||
/// <param name="seq">Find roms equal to this size</param>
|
||||
/// <param name="crcs">CRCs of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="md5s">MD5s of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="sha1s">SHA-1s of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="itemStatuses">Select roms with the given status</param>
|
||||
/// <param name="machineTypes">Select games with the given type</param>
|
||||
/// <param name="notgamenames">Names of the games to match (can use asterisk-partials)</param>
|
||||
/// <param name="notromnames">Names of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="notromtypes">Type of the roms to match</param>
|
||||
/// <param name="notcrcs">CRCs of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="notmd5s">MD5s of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="notsha1s">SHA-1s of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="itemNotStatuses">Select roms without the given status</param>
|
||||
/// <param name="machineNotTypes">Select games without the given type</param>
|
||||
/// <param name="runnable">Select games that have a value for runnable</param>
|
||||
public Filter(List<string> gamenames, List<string> romnames, List<string> romtypes, long sgt,
|
||||
long slt, long seq, List<string> crcs, List<string> md5s, List<string> sha1s, ItemStatus itemStatuses,
|
||||
MachineType machineTypes, List<string> notgamenames, List<string> notromnames, List<string> notromtypes,
|
||||
List<string> notcrcs, List<string> notmd5s, List<string> notsha1s, ItemStatus itemNotStatuses,
|
||||
MachineType machineNotTypes, bool? runnable)
|
||||
{
|
||||
_gameNames = gamenames;
|
||||
_notGameNames = notgamenames;
|
||||
_romNames = romnames;
|
||||
_notRomNames = notromnames;
|
||||
_romTypes = romtypes;
|
||||
_notRomTypes = notromtypes;
|
||||
_sizeGreaterThanOrEqual = sgt;
|
||||
_sizeLessThanOrEqual = slt;
|
||||
_sizeEqualTo = seq;
|
||||
_crcs = crcs;
|
||||
_notCrcs = notcrcs;
|
||||
_md5s = md5s;
|
||||
_notMd5s = notmd5s;
|
||||
_sha1s = sha1s;
|
||||
_notSha1s = notsha1s;
|
||||
_itemStatuses = itemStatuses;
|
||||
_itemNotStatuses = itemNotStatuses;
|
||||
_machineTypes = machineTypes;
|
||||
_machineNotTypes = machineNotTypes;
|
||||
_runnable = runnable;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Instance methods
|
||||
|
||||
/// <summary>
|
||||
/// Check to see if a DatItem passes the filter
|
||||
@@ -838,5 +931,78 @@ namespace SabreTools.Helper.Dats
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Static methods
|
||||
|
||||
/// <summary>
|
||||
/// Get the machine type from a string
|
||||
/// </summary>
|
||||
/// <param name="gametype">Machine type as a string</param>
|
||||
/// <param name="logger">Logger object for file and console output</param>
|
||||
/// <returns>A machine type based on the input</returns>
|
||||
public static MachineType GetMachneTypeFromString(string gametype, Logger logger)
|
||||
{
|
||||
MachineType machineType = MachineType.NULL;
|
||||
switch (gametype.ToLowerInvariant())
|
||||
{
|
||||
case "none":
|
||||
machineType |= MachineType.None;
|
||||
break;
|
||||
case "bios":
|
||||
machineType |= MachineType.Bios;
|
||||
break;
|
||||
case "dev":
|
||||
case "device":
|
||||
machineType |= MachineType.Device;
|
||||
break;
|
||||
case "mech":
|
||||
case "mechanical":
|
||||
machineType |= MachineType.Mechanical;
|
||||
break;
|
||||
default:
|
||||
logger.Warning(gametype + " is not a valid type");
|
||||
break;
|
||||
}
|
||||
|
||||
return machineType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the item status from a string
|
||||
/// </summary>
|
||||
/// <param name="status">Item status as a string</param>
|
||||
/// <param name="logger">Logger object for file and console output</param>
|
||||
/// <returns>An item status based on the input</returns>
|
||||
public static ItemStatus GetStatusFromString(string status, Logger logger)
|
||||
{
|
||||
ItemStatus itemStatus = ItemStatus.NULL;
|
||||
switch (status.ToLowerInvariant())
|
||||
{
|
||||
case "none":
|
||||
itemStatus |= ItemStatus.None;
|
||||
break;
|
||||
case "good":
|
||||
itemStatus |= ItemStatus.Good;
|
||||
break;
|
||||
case "baddump":
|
||||
itemStatus |= ItemStatus.BadDump;
|
||||
break;
|
||||
case "nodump":
|
||||
itemStatus |= ItemStatus.Nodump;
|
||||
break;
|
||||
case "verified":
|
||||
itemStatus |= ItemStatus.Verified;
|
||||
break;
|
||||
default:
|
||||
logger.Warning(status + " is not a valid status");
|
||||
break;
|
||||
}
|
||||
|
||||
return itemStatus;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,26 +460,7 @@ namespace SabreTools
|
||||
/// <param name="skip">True if the first cascaded diff file should be skipped on output, false otherwise</param>
|
||||
/// <param name="bare">True if the date should not be appended to the default name, false otherwise [OBSOLETE]</param>
|
||||
/// /* Filtering info */
|
||||
/// <param name="gamenames">Names of the games to match (can use asterisk-partials)</param>
|
||||
/// <param name="romnames">Names of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="romtypes">Types of the roms to match</param>
|
||||
/// <param name="sgt">Find roms greater than or equal to this size</param>
|
||||
/// <param name="slt">Find roms less than or equal to this size</param>
|
||||
/// <param name="seq">Find roms equal to this size</param>
|
||||
/// <param name="crcs">CRCs of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="md5s">MD5s of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="sha1s">SHA-1s of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="statuses">Select roms with the given item statuses</param>
|
||||
/// <param name="gametypes">Select games with the given types</param>
|
||||
/// <param name="notgamenames">Name of the game to match (can use asterisk-partials)</param>
|
||||
/// <param name="notromnames">Name of the rom to match (can use asterisk-partials)</param>
|
||||
/// <param name="notromtypes">Type of the rom to match</param>
|
||||
/// <param name="notcrcs">CRCs of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="notmd5s">MD5s of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="notsha1s">SHA-1s of the roms to match (can use asterisk-partials)</param>
|
||||
/// <param name="notstatuses">Select roms without the given item statuses</param>
|
||||
/// <param name="notgametypes">Select games without the given types</param>
|
||||
/// <param name="runnable">Select games with the given runability</param>
|
||||
/// <param name="filter">Pre-populated filter object for DAT filtering</param>
|
||||
/// /* Trimming info */
|
||||
/// <param name="splitType">Type of the split that should be performed (split, merged, fully merged)</param>
|
||||
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
||||
@@ -533,26 +514,7 @@ namespace SabreTools
|
||||
bool bare,
|
||||
|
||||
/* Filtering info */
|
||||
List<string> gamenames,
|
||||
List<string> romnames,
|
||||
List<string> romtypes,
|
||||
long sgt,
|
||||
long slt,
|
||||
long seq,
|
||||
List<string> crcs,
|
||||
List<string> md5s,
|
||||
List<string> sha1s,
|
||||
List<string> statuses,
|
||||
List<string> gametypes,
|
||||
List<string> notgamenames,
|
||||
List<string> notromnames,
|
||||
List<string> notromtypes,
|
||||
List<string> notcrcs,
|
||||
List<string> notmd5s,
|
||||
List<string> notsha1s,
|
||||
List<string> notstatuses,
|
||||
List<string> notgametypes,
|
||||
bool? runnable,
|
||||
Filter filter,
|
||||
|
||||
/* Trimming info */
|
||||
SplitType splitType,
|
||||
@@ -565,7 +527,7 @@ namespace SabreTools
|
||||
bool clean,
|
||||
bool softlist,
|
||||
bool dedup,
|
||||
|
||||
|
||||
/* Multithreading info */
|
||||
int maxDegreeOfParallelism)
|
||||
{
|
||||
@@ -633,112 +595,6 @@ namespace SabreTools
|
||||
}
|
||||
}
|
||||
|
||||
// Set the status flag for filtering
|
||||
ItemStatus itemStatus = ItemStatus.NULL;
|
||||
foreach (string status in statuses)
|
||||
{
|
||||
switch (status.ToLowerInvariant())
|
||||
{
|
||||
case "none":
|
||||
itemStatus |= ItemStatus.None;
|
||||
break;
|
||||
case "good":
|
||||
itemStatus |= ItemStatus.Good;
|
||||
break;
|
||||
case "baddump":
|
||||
itemStatus |= ItemStatus.BadDump;
|
||||
break;
|
||||
case "nodump":
|
||||
itemStatus |= ItemStatus.Nodump;
|
||||
break;
|
||||
case "verified":
|
||||
itemStatus |= ItemStatus.Verified;
|
||||
break;
|
||||
default:
|
||||
_logger.Warning(status + " is not a valid status");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the not status flag for filtering
|
||||
ItemStatus itemNotStatus = ItemStatus.NULL;
|
||||
foreach (string status in notstatuses)
|
||||
{
|
||||
switch (status.ToLowerInvariant())
|
||||
{
|
||||
case "none":
|
||||
itemNotStatus |= ItemStatus.None;
|
||||
break;
|
||||
case "good":
|
||||
itemNotStatus |= ItemStatus.Good;
|
||||
break;
|
||||
case "baddump":
|
||||
itemNotStatus |= ItemStatus.BadDump;
|
||||
break;
|
||||
case "nodump":
|
||||
itemNotStatus |= ItemStatus.Nodump;
|
||||
break;
|
||||
case "verified":
|
||||
itemNotStatus |= ItemStatus.Verified;
|
||||
break;
|
||||
default:
|
||||
_logger.Warning(status + " is not a valid status");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the machine type flag for filtering
|
||||
MachineType machineType = MachineType.NULL;
|
||||
foreach (string gametype in gametypes)
|
||||
{
|
||||
switch (gametype.ToLowerInvariant())
|
||||
{
|
||||
case "none":
|
||||
machineType |= MachineType.None;
|
||||
break;
|
||||
case "bios":
|
||||
machineType |= MachineType.Bios;
|
||||
break;
|
||||
case "dev":
|
||||
case "device":
|
||||
machineType |= MachineType.Device;
|
||||
break;
|
||||
case "mech":
|
||||
case "mechanical":
|
||||
machineType |= MachineType.Mechanical;
|
||||
break;
|
||||
default:
|
||||
_logger.Warning(gametype + " is not a valid type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the not machine type flag for filtering
|
||||
MachineType machineNotType = MachineType.NULL;
|
||||
foreach (string gametype in notgametypes)
|
||||
{
|
||||
switch (gametype.ToLowerInvariant())
|
||||
{
|
||||
case "none":
|
||||
machineNotType = MachineType.None;
|
||||
break;
|
||||
case "bios":
|
||||
machineNotType = MachineType.Bios;
|
||||
break;
|
||||
case "dev":
|
||||
case "device":
|
||||
machineNotType = MachineType.Device;
|
||||
break;
|
||||
case "mech":
|
||||
case "mechanical":
|
||||
machineNotType = MachineType.Mechanical;
|
||||
break;
|
||||
default:
|
||||
_logger.Warning(gametype + " is not a valid type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Normalize the extensions
|
||||
addext = (addext == "" || addext.StartsWith(".") ? addext : "." + addext);
|
||||
repext = (repext == "" || repext.StartsWith(".") ? repext : "." + repext);
|
||||
@@ -807,11 +663,7 @@ namespace SabreTools
|
||||
GameName = datprefix,
|
||||
Romba = romba,
|
||||
};
|
||||
|
||||
// Create the Filter object to be used
|
||||
Filter filter = new Filter(gamenames, romnames, romtypes, sgt, slt, seq, crcs, md5s, sha1s, itemStatus, machineType,
|
||||
notgamenames, notromnames, notromtypes, notcrcs, notmd5s, notsha1s, itemNotStatus, machineNotType, runnable);
|
||||
|
||||
|
||||
userInputDat.DetermineUpdateType(inputs, outDir, merge, diffMode, inplace, skip, bare, clean, softlist,
|
||||
filter, splitType, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
|
||||
using SabreTools.Helper;
|
||||
using SabreTools.Helper.Data;
|
||||
using SabreTools.Helper.Dats;
|
||||
using SabreTools.Helper.Help;
|
||||
|
||||
#if MONO
|
||||
@@ -118,7 +119,6 @@ namespace SabreTools
|
||||
skip = false,
|
||||
updateDat = false,
|
||||
usegame = true;
|
||||
bool? runnable = null;
|
||||
DatFormat datFormat = 0x0;
|
||||
DiffMode diffMode = 0x0;
|
||||
OutputFormat outputFormat = OutputFormat.Folder;
|
||||
@@ -131,9 +131,6 @@ namespace SabreTools
|
||||
rar = 2,
|
||||
sevenzip = 1,
|
||||
zip = 1;
|
||||
long sgt = -1,
|
||||
slt = -1,
|
||||
seq = -1;
|
||||
string addext = "",
|
||||
author = null,
|
||||
category = null,
|
||||
@@ -157,26 +154,11 @@ namespace SabreTools
|
||||
tempDir = "",
|
||||
url = null,
|
||||
version = null;
|
||||
List<string> crc = new List<string>();
|
||||
Filter filter = new Filter();
|
||||
List<string> datfiles = new List<string>();
|
||||
List<string> exta = new List<string>();
|
||||
List<string> extb = new List<string>();
|
||||
List<string> gamename = new List<string>();
|
||||
List<string> gametype = new List<string>();
|
||||
List<string> inputs = new List<string>();
|
||||
List<string> md5 = new List<string>();
|
||||
List<string> notcrc = new List<string>();
|
||||
List<string> notgamename = new List<string>();
|
||||
List<string> notgametype = new List<string>();
|
||||
List<string> notmd5 = new List<string>();
|
||||
List<string> notromname = new List<string>();
|
||||
List<string> notromtype = new List<string>();
|
||||
List<string> notsha1 = new List<string>();
|
||||
List<string> notstatus = new List<string>();
|
||||
List<string> romname = new List<string>();
|
||||
List<string> romtype = new List<string>();
|
||||
List<string> sha1 = new List<string>();
|
||||
List<string> status = new List<string>();
|
||||
|
||||
// Get the first argument as a feature flag
|
||||
string feature = args[0];
|
||||
@@ -406,7 +388,7 @@ namespace SabreTools
|
||||
break;
|
||||
case "-nrun":
|
||||
case "--not-run":
|
||||
runnable = false;
|
||||
filter.Runnable = false;
|
||||
break;
|
||||
case "-ns":
|
||||
case "--noSHA1":
|
||||
@@ -498,7 +480,7 @@ namespace SabreTools
|
||||
break;
|
||||
case "-run":
|
||||
case "--runnable":
|
||||
runnable = true;
|
||||
filter.Runnable = true;
|
||||
break;
|
||||
case "-s":
|
||||
case "--short":
|
||||
@@ -591,7 +573,7 @@ namespace SabreTools
|
||||
break;
|
||||
case "-crc":
|
||||
case "--crc":
|
||||
crc.Add(args[++i]);
|
||||
filter.CRCs.Add(args[++i]);
|
||||
break;
|
||||
case "-da":
|
||||
case "--date":
|
||||
@@ -642,11 +624,11 @@ namespace SabreTools
|
||||
break;
|
||||
case "-gn":
|
||||
case "--game-name":
|
||||
gamename.Add(args[++i]);
|
||||
filter.GameNames.Add(args[++i]);
|
||||
break;
|
||||
case "-gt":
|
||||
case "--game-type":
|
||||
gametype.Add(args[++i]);
|
||||
filter.MachineTypes |= Filter.GetMachneTypeFromString(args[++i], _logger);
|
||||
break;
|
||||
case "-gz":
|
||||
case "--gz":
|
||||
@@ -665,11 +647,11 @@ namespace SabreTools
|
||||
break;
|
||||
case "-is":
|
||||
case "--status":
|
||||
status.Add(args[++i]);
|
||||
filter.ItemStatuses |= Filter.GetStatusFromString(args[++i], _logger);
|
||||
break;
|
||||
case "-md5":
|
||||
case "--md5":
|
||||
md5.Add(args[++i]);
|
||||
filter.MD5s.Add(args[++i]);
|
||||
break;
|
||||
case "-mt":
|
||||
case "--mt":
|
||||
@@ -681,35 +663,35 @@ namespace SabreTools
|
||||
break;
|
||||
case "-ncrc":
|
||||
case "--not-crc":
|
||||
notcrc.Add(args[++i]);
|
||||
filter.NotCRCs.Add(args[++i]);
|
||||
break;
|
||||
case "-ngn":
|
||||
case "--not-game":
|
||||
notgamename.Add(args[++i]);
|
||||
filter.NotGameNames.Add(args[++i]);
|
||||
break;
|
||||
case "-ngt":
|
||||
case "--not-gtype":
|
||||
notgametype.Add(args[++i]);
|
||||
filter.NotMachineTypes |= Filter.GetMachneTypeFromString(args[++i], _logger);
|
||||
break;
|
||||
case "-nis":
|
||||
case "--not-status":
|
||||
notstatus.Add(args[++i]);
|
||||
filter.NotItemStatuses |= Filter.GetStatusFromString(args[++i], _logger);
|
||||
break;
|
||||
case "-nmd5":
|
||||
case "--not-md5":
|
||||
notmd5.Add(args[++i]);
|
||||
filter.NotMD5s.Add(args[++i]);
|
||||
break;
|
||||
case "-nrn":
|
||||
case "--not-rom":
|
||||
notromname.Add(args[++i]);
|
||||
filter.NotRomNames.Add(args[++i]);
|
||||
break;
|
||||
case "-nrt":
|
||||
case "--not-type":
|
||||
notromtype.Add(args[++i]);
|
||||
filter.NotRomTypes.Add(args[++i]);
|
||||
break;
|
||||
case "-nsha1":
|
||||
case "--not-sha1":
|
||||
notsha1.Add(args[++i]);
|
||||
filter.NotSHA1s.Add(args[++i]);
|
||||
break;
|
||||
case "-out":
|
||||
case "--out":
|
||||
@@ -740,7 +722,7 @@ namespace SabreTools
|
||||
break;
|
||||
case "-rn":
|
||||
case "--rom-name":
|
||||
romname.Add(args[++i]);
|
||||
filter.RomNames.Add(args[++i]);
|
||||
break;
|
||||
case "-root":
|
||||
case "--root":
|
||||
@@ -748,23 +730,23 @@ namespace SabreTools
|
||||
break;
|
||||
case "-rt":
|
||||
case "--rom-type":
|
||||
romtype.Add(args[++i]);
|
||||
filter.RomTypes.Add(args[++i]);
|
||||
break;
|
||||
case "-seq":
|
||||
case "--equal":
|
||||
seq = GetSizeFromString(args[++i]);
|
||||
filter.SizeEqualTo = GetSizeFromString(args[++i]);
|
||||
break;
|
||||
case "-sgt":
|
||||
case "--greater":
|
||||
sgt = GetSizeFromString(args[++i]);
|
||||
filter.SizeGreaterThanOrEqual = GetSizeFromString(args[++i]);
|
||||
break;
|
||||
case "-sha1":
|
||||
case "--sha1":
|
||||
sha1.Add(args[++i]);
|
||||
filter.SHA1s.Add(args[++i]);
|
||||
break;
|
||||
case "-slt":
|
||||
case "--less":
|
||||
slt = GetSizeFromString(args[++i]);
|
||||
filter.SizeLessThanOrEqual = GetSizeFromString(args[++i]);
|
||||
break;
|
||||
case "-t":
|
||||
case "--temp":
|
||||
@@ -825,7 +807,7 @@ namespace SabreTools
|
||||
break;
|
||||
case "-crc":
|
||||
case "--crc":
|
||||
crc.Add(split[1]);
|
||||
filter.CRCs.Add(split[1]);
|
||||
break;
|
||||
case "-da":
|
||||
case "--date":
|
||||
@@ -875,11 +857,11 @@ namespace SabreTools
|
||||
break;
|
||||
case "-gn":
|
||||
case "--game-name":
|
||||
gamename.Add(split[1]);
|
||||
filter.GameNames.Add(split[1]);
|
||||
break;
|
||||
case "-gt":
|
||||
case "--game-type":
|
||||
gametype.Add(split[1]);
|
||||
filter.MachineTypes |= Filter.GetMachneTypeFromString(split[1], _logger);
|
||||
break;
|
||||
case "-gz":
|
||||
case "--gz":
|
||||
@@ -898,11 +880,11 @@ namespace SabreTools
|
||||
break;
|
||||
case "-is":
|
||||
case "--status":
|
||||
status.Add(split[1]);
|
||||
filter.ItemStatuses |= Filter.GetStatusFromString(split[1], _logger);
|
||||
break;
|
||||
case "-md5":
|
||||
case "--md5":
|
||||
md5.Add(split[1]);
|
||||
filter.MD5s.Add(split[1]);
|
||||
break;
|
||||
case "-mt":
|
||||
case "--mt":
|
||||
@@ -914,35 +896,35 @@ namespace SabreTools
|
||||
break;
|
||||
case "-ncrc":
|
||||
case "--not-crc":
|
||||
notcrc.Add(split[1]);
|
||||
filter.NotCRCs.Add(split[i]);
|
||||
break;
|
||||
case "-ngn":
|
||||
case "--not-game":
|
||||
notgamename.Add(split[1]);
|
||||
filter.NotGameNames.Add(split[1]);
|
||||
break;
|
||||
case "-ngt":
|
||||
case "--not-gtype":
|
||||
notgametype.Add(split[1]);
|
||||
filter.NotMachineTypes |= Filter.GetMachneTypeFromString(split[1], _logger);
|
||||
break;
|
||||
case "-nis":
|
||||
case "--not-status":
|
||||
notstatus.Add(split[1]);
|
||||
filter.NotItemStatuses |= Filter.GetStatusFromString(split[1], _logger);
|
||||
break;
|
||||
case "-nmd5":
|
||||
case "--not-md5":
|
||||
notmd5.Add(split[1]);
|
||||
filter.NotMD5s.Add(split[1]);
|
||||
break;
|
||||
case "-nrn":
|
||||
case "--not-rom":
|
||||
notromname.Add(split[1]);
|
||||
filter.NotRomNames.Add(split[1]);
|
||||
break;
|
||||
case "-nrt":
|
||||
case "--not-type":
|
||||
notromtype.Add(split[1]);
|
||||
filter.NotRomTypes.Add(split[1]);
|
||||
break;
|
||||
case "-nsha1":
|
||||
case "--not-sha1":
|
||||
notsha1.Add(split[1]);
|
||||
filter.NotSHA1s.Add(split[1]);
|
||||
break;
|
||||
case "-out":
|
||||
case "--out":
|
||||
@@ -977,27 +959,27 @@ namespace SabreTools
|
||||
break;
|
||||
case "-rn":
|
||||
case "--rom-name":
|
||||
romname.Add(split[1]);
|
||||
filter.RomNames.Add(split[1]);
|
||||
break;
|
||||
case "-rt":
|
||||
case "--rom-type":
|
||||
romtype.Add(split[1]);
|
||||
filter.RomTypes.Add(split[1]);
|
||||
break;
|
||||
case "-seq":
|
||||
case "--equal":
|
||||
seq = GetSizeFromString(split[1]);
|
||||
filter.SizeEqualTo = GetSizeFromString(split[1]);
|
||||
break;
|
||||
case "-sgt":
|
||||
case "--greater":
|
||||
sgt = GetSizeFromString(split[1]);
|
||||
filter.SizeGreaterThanOrEqual = GetSizeFromString(split[1]);
|
||||
break;
|
||||
case "-sha1":
|
||||
case "--sha1":
|
||||
sha1.Add(split[1]);
|
||||
filter.SHA1s.Add(split[1]);
|
||||
break;
|
||||
case "-slt":
|
||||
case "--less":
|
||||
slt = GetSizeFromString(split[1]);
|
||||
filter.SizeLessThanOrEqual = GetSizeFromString(split[1]);
|
||||
break;
|
||||
case "-t":
|
||||
case "--temp":
|
||||
@@ -1168,9 +1150,7 @@ namespace SabreTools
|
||||
InitUpdate(inputs, filename, name, description, rootdir, category, version, date, author, email, homepage, url, comment, header,
|
||||
superdat, forcemerge, forcend, forcepack, excludeOf, datFormat, usegame, prefix,
|
||||
postfix, quotes, repext, addext, remext, datPrefix, romba, merge, diffMode, inplace, skip, removeDateFromAutomaticName,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, status, gametype,
|
||||
notgamename, notromname, notromtype, notcrc, notmd5, notsha1, notstatus, notgametype, runnable,
|
||||
splitType, trim, single, root, outDir, cleanGameNames, softlist, dedup, maxParallelism);
|
||||
filter, splitType, trim, single, root, outDir, cleanGameNames, softlist, dedup, maxParallelism);
|
||||
}
|
||||
|
||||
// If we're using the verifier
|
||||
|
||||
Reference in New Issue
Block a user