Ensure every Field has a FilterItem

This commit is contained in:
Matt Nadareski
2020-08-25 14:24:34 -07:00
parent 623651804c
commit 8070805359
6 changed files with 234 additions and 366 deletions

View File

@@ -133,13 +133,13 @@ namespace SabreTools.Library.DatItems
return false; return false;
// Filter on description // Filter on description
if (filter.Description.MatchesPositiveSet(Description) == false) if (filter.DatItem_Description.MatchesPositiveSet(Description) == false)
return false; return false;
if (filter.Description.MatchesNegativeSet(Description) == true) if (filter.DatItem_Description.MatchesNegativeSet(Description) == true)
return false; return false;
// Filter on default // Filter on default
if (filter.Default.MatchesNeutral(null, Default) == false) if (filter.DatItem_Default.MatchesNeutral(null, Default) == false)
return false; return false;
return true; return true;

View File

@@ -581,15 +581,15 @@ namespace SabreTools.Library.DatItems
#region Common #region Common
// Filter on item name // Filter on item name
if (filter.ItemName.MatchesPositiveSet(Name) == false) if (filter.DatItem_Name.MatchesPositiveSet(Name) == false)
return false; return false;
if (filter.ItemName.MatchesNegativeSet(Name) == true) if (filter.DatItem_Name.MatchesNegativeSet(Name) == true)
return false; return false;
// Filter on item type // Filter on item type
if (filter.ItemTypes.MatchesPositiveSet(ItemType.ToString()) == false) if (filter.DatItem_Type.MatchesPositiveSet(ItemType.ToString()) == false)
return false; return false;
if (filter.ItemTypes.MatchesNegativeSet(ItemType.ToString()) == true) if (filter.DatItem_Type.MatchesNegativeSet(ItemType.ToString()) == true)
return false; return false;
#endregion #endregion
@@ -597,15 +597,15 @@ namespace SabreTools.Library.DatItems
#region AttractMode #region AttractMode
// Filter on alt name // Filter on alt name
if (filter.AltName.MatchesPositiveSet(AltName) == false) if (filter.DatItem_AltName.MatchesPositiveSet(AltName) == false)
return false; return false;
if (filter.AltName.MatchesNegativeSet(AltName) == true) if (filter.DatItem_AltName.MatchesNegativeSet(AltName) == true)
return false; return false;
// Filter on alt title // Filter on alt title
if (filter.AltTitle.MatchesPositiveSet(AltTitle) == false) if (filter.DatItem_AltTitle.MatchesPositiveSet(AltTitle) == false)
return false; return false;
if (filter.AltTitle.MatchesNegativeSet(AltTitle) == true) if (filter.DatItem_AltTitle.MatchesNegativeSet(AltTitle) == true)
return false; return false;
#endregion #endregion
@@ -613,33 +613,33 @@ namespace SabreTools.Library.DatItems
#region OpenMSX #region OpenMSX
// Filter on original // Filter on original
if (filter.Original.MatchesPositiveSet(Original?.Content) == false) if (filter.DatItem_Original.MatchesPositiveSet(Original?.Content) == false)
return false; return false;
if (filter.Original.MatchesNegativeSet(Original?.Content) == true) if (filter.DatItem_Original.MatchesNegativeSet(Original?.Content) == true)
return false; return false;
// Filter on OpenMSX subtype // Filter on OpenMSX subtype
if (filter.SubType.MatchesPositiveSet(OpenMSXSubType) == false) if (filter.DatItem_OpenMSXSubType.MatchesPositiveSet(OpenMSXSubType) == false)
return false; return false;
if (filter.SubType.MatchesNegativeSet(OpenMSXSubType) == true) if (filter.DatItem_OpenMSXSubType.MatchesNegativeSet(OpenMSXSubType) == true)
return false; return false;
// Filter on OpenMSX type // Filter on OpenMSX type
if (filter.OpenMSXType.MatchesPositiveSet(OpenMSXType) == false) if (filter.DatItem_OpenMSXType.MatchesPositiveSet(OpenMSXType) == false)
return false; return false;
if (filter.OpenMSXType.MatchesNegativeSet(OpenMSXType) == true) if (filter.DatItem_OpenMSXType.MatchesNegativeSet(OpenMSXType) == true)
return false; return false;
// Filter on remark // Filter on remark
if (filter.Remark.MatchesPositiveSet(Remark) == false) if (filter.DatItem_Remark.MatchesPositiveSet(Remark) == false)
return false; return false;
if (filter.Remark.MatchesNegativeSet(Remark) == true) if (filter.DatItem_Remark.MatchesNegativeSet(Remark) == true)
return false; return false;
// Filter on boot // Filter on boot
if (filter.Boot.MatchesPositiveSet(Boot) == false) if (filter.DatItem_Boot.MatchesPositiveSet(Boot) == false)
return false; return false;
if (filter.Boot.MatchesNegativeSet(Boot) == true) if (filter.DatItem_Boot.MatchesNegativeSet(Boot) == true)
return false; return false;
#endregion #endregion
@@ -647,53 +647,53 @@ namespace SabreTools.Library.DatItems
#region SoftwareList #region SoftwareList
// Filter on part name // Filter on part name
if (filter.PartName.MatchesPositiveSet(Part?.Name) == false) if (filter.DatItem_Part_Name.MatchesPositiveSet(Part?.Name) == false)
return false; return false;
if (filter.PartName.MatchesNegativeSet(Part?.Name) == true) if (filter.DatItem_Part_Name.MatchesNegativeSet(Part?.Name) == true)
return false; return false;
// Filter on part interface // Filter on part interface
if (filter.PartInterface.MatchesPositiveSet(Part?.Interface) == false) if (filter.DatItem_Part_Interface.MatchesPositiveSet(Part?.Interface) == false)
return false; return false;
if (filter.PartInterface.MatchesNegativeSet(Part?.Interface) == true) if (filter.DatItem_Part_Interface.MatchesNegativeSet(Part?.Interface) == true)
return false; return false;
// Filter on area name // Filter on area name
if (filter.AreaName.MatchesPositiveSet(AreaName) == false) if (filter.DatItem_AreaName.MatchesPositiveSet(AreaName) == false)
return false; return false;
if (filter.AreaName.MatchesNegativeSet(AreaName) == true) if (filter.DatItem_AreaName.MatchesNegativeSet(AreaName) == true)
return false; return false;
// Filter on area size // Filter on area size
if (filter.AreaSize.MatchesNeutral(null, AreaSize) == false) if (filter.DatItem_AreaSize.MatchesNeutral(null, AreaSize) == false)
return false; return false;
else if (filter.AreaSize.MatchesPositive(null, AreaSize) == false) else if (filter.DatItem_AreaSize.MatchesPositive(null, AreaSize) == false)
return false; return false;
else if (filter.AreaSize.MatchesNegative(null, AreaSize) == false) else if (filter.DatItem_AreaSize.MatchesNegative(null, AreaSize) == false)
return false; return false;
// Filter on area byte width // Filter on area byte width
if (filter.AreaWidth.MatchesPositiveSet(AreaWidth) == false) if (filter.DatItem_AreaWidth.MatchesPositiveSet(AreaWidth) == false)
return false; return false;
if (filter.AreaWidth.MatchesNegativeSet(AreaWidth) == true) if (filter.DatItem_AreaWidth.MatchesNegativeSet(AreaWidth) == true)
return false; return false;
// Filter on area endianness // Filter on area endianness
if (filter.AreaEndianness.MatchesPositiveSet(AreaEndianness) == false) if (filter.DatItem_AreaEndianness.MatchesPositiveSet(AreaEndianness) == false)
return false; return false;
if (filter.AreaEndianness.MatchesNegativeSet(AreaEndianness) == true) if (filter.DatItem_AreaEndianness.MatchesNegativeSet(AreaEndianness) == true)
return false; return false;
// Filter on softwarelist value // Filter on softwarelist value
if (filter.Value.MatchesPositiveSet(Value) == false) if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
return false; return false;
if (filter.Value.MatchesNegativeSet(Value) == true) if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
return false; return false;
// Filter on load flag // Filter on load flag
if (filter.LoadFlag.MatchesPositiveSet(LoadFlag) == false) if (filter.DatItem_LoadFlag.MatchesPositiveSet(LoadFlag) == false)
return false; return false;
if (filter.LoadFlag.MatchesNegativeSet(LoadFlag) == true) if (filter.DatItem_LoadFlag.MatchesNegativeSet(LoadFlag) == true)
return false; return false;
#endregion #endregion

View File

@@ -476,73 +476,73 @@ namespace SabreTools.Library.DatItems
return false; return false;
// Filter on MD5 // Filter on MD5
if (filter.MD5.MatchesPositiveSet(MD5) == false) if (filter.DatItem_MD5.MatchesPositiveSet(MD5) == false)
return false; return false;
if (filter.MD5.MatchesNegativeSet(MD5) == true) if (filter.DatItem_MD5.MatchesNegativeSet(MD5) == true)
return false; return false;
#if NET_FRAMEWORK #if NET_FRAMEWORK
// Filter on RIPEMD160 // Filter on RIPEMD160
if (filter.RIPEMD160.MatchesPositiveSet(RIPEMD160) == false) if (filter.DatItem_RIPEMD160.MatchesPositiveSet(RIPEMD160) == false)
return false; return false;
if (filter.RIPEMD160.MatchesNegativeSet(RIPEMD160) == true) if (filter.DatItem_RIPEMD160.MatchesNegativeSet(RIPEMD160) == true)
return false; return false;
#endif #endif
// Filter on SHA-1 // Filter on SHA-1
if (filter.SHA1.MatchesPositiveSet(SHA1) == false) if (filter.DatItem_SHA1.MatchesPositiveSet(SHA1) == false)
return false; return false;
if (filter.SHA1.MatchesNegativeSet(SHA1) == true) if (filter.DatItem_SHA1.MatchesNegativeSet(SHA1) == true)
return false; return false;
// Filter on SHA-256 // Filter on SHA-256
if (filter.SHA256.MatchesPositiveSet(SHA256) == false) if (filter.DatItem_SHA256.MatchesPositiveSet(SHA256) == false)
return false; return false;
if (filter.SHA256.MatchesNegativeSet(SHA256) == true) if (filter.DatItem_SHA256.MatchesNegativeSet(SHA256) == true)
return false; return false;
// Filter on SHA-384 // Filter on SHA-384
if (filter.SHA384.MatchesPositiveSet(SHA384) == false) if (filter.DatItem_SHA384.MatchesPositiveSet(SHA384) == false)
return false; return false;
if (filter.SHA384.MatchesNegativeSet(SHA384) == true) if (filter.DatItem_SHA384.MatchesNegativeSet(SHA384) == true)
return false; return false;
// Filter on SHA-512 // Filter on SHA-512
if (filter.SHA512.MatchesPositiveSet(SHA512) == false) if (filter.DatItem_SHA512.MatchesPositiveSet(SHA512) == false)
return false; return false;
if (filter.SHA512.MatchesNegativeSet(SHA512) == true) if (filter.DatItem_SHA512.MatchesNegativeSet(SHA512) == true)
return false; return false;
// Filter on merge tag // Filter on merge tag
if (filter.MergeTag.MatchesPositiveSet(MergeTag) == false) if (filter.DatItem_Merge.MatchesPositiveSet(MergeTag) == false)
return false; return false;
if (filter.MergeTag.MatchesNegativeSet(MergeTag) == true) if (filter.DatItem_Merge.MatchesNegativeSet(MergeTag) == true)
return false; return false;
// Filter on region // Filter on region
if (filter.Region.MatchesPositiveSet(Region) == false) if (filter.DatItem_Region.MatchesPositiveSet(Region) == false)
return false; return false;
if (filter.Region.MatchesNegativeSet(Region) == true) if (filter.DatItem_Region.MatchesNegativeSet(Region) == true)
return false; return false;
// Filter on index // Filter on index
if (filter.Index.MatchesPositiveSet(Index) == false) if (filter.DatItem_Index.MatchesPositiveSet(Index) == false)
return false; return false;
if (filter.Index.MatchesNegativeSet(Index) == true) if (filter.DatItem_Index.MatchesNegativeSet(Index) == true)
return false; return false;
// Filter on writable // Filter on writable
if (filter.Writable.MatchesNeutral(null, Writable) == false) if (filter.DatItem_Writable.MatchesNeutral(null, Writable) == false)
return false; return false;
// Filter on status // Filter on status
if (filter.Status.MatchesPositive(ItemStatus.NULL, ItemStatus) == false) if (filter.DatItem_Status.MatchesPositive(ItemStatus.NULL, ItemStatus) == false)
return false; return false;
if (filter.Status.MatchesNegative(ItemStatus.NULL, ItemStatus) == true) if (filter.DatItem_Status.MatchesNegative(ItemStatus.NULL, ItemStatus) == true)
return false; return false;
// Filter on optional // Filter on optional
if (filter.Optional.MatchesNeutral(null, Optional) == false) if (filter.DatItem_Optional.MatchesNeutral(null, Optional) == false)
return false; return false;
return true; return true;

View File

@@ -161,25 +161,25 @@ namespace SabreTools.Library.DatItems
return false; return false;
// Filter on region // Filter on region
if (filter.Region.MatchesPositiveSet(Region) == false) if (filter.DatItem_Region.MatchesPositiveSet(Region) == false)
return false; return false;
if (filter.Region.MatchesNegativeSet(Region) == true) if (filter.DatItem_Region.MatchesNegativeSet(Region) == true)
return false; return false;
// Filter on language // Filter on language
if (filter.Language.MatchesPositiveSet(Language) == false) if (filter.DatItem_Language.MatchesPositiveSet(Language) == false)
return false; return false;
if (filter.Language.MatchesNegativeSet(Language) == true) if (filter.DatItem_Language.MatchesNegativeSet(Language) == true)
return false; return false;
// Filter on date // Filter on date
if (filter.Date.MatchesPositiveSet(Date) == false) if (filter.DatItem_Date.MatchesPositiveSet(Date) == false)
return false; return false;
if (filter.Date.MatchesNegativeSet(Date) == true) if (filter.DatItem_Date.MatchesNegativeSet(Date) == true)
return false; return false;
// Filter on default // Filter on default
if (filter.Default.MatchesNeutral(null, Default) == false) if (filter.DatItem_Default.MatchesNeutral(null, Default) == false)
return false; return false;
return true; return true;

View File

@@ -513,99 +513,99 @@ namespace SabreTools.Library.DatItems
return false; return false;
// Filter on bios // Filter on bios
if (filter.Bios.MatchesPositiveSet(Bios) == false) if (filter.DatItem_Bios.MatchesPositiveSet(Bios) == false)
return false; return false;
if (filter.Bios.MatchesNegativeSet(Bios) == true) if (filter.DatItem_Bios.MatchesNegativeSet(Bios) == true)
return false; return false;
// Filter on rom size // Filter on rom size
if (filter.Size.MatchesNeutral(-1, Size) == false) if (filter.DatItem_Size.MatchesNeutral(-1, Size) == false)
return false; return false;
else if (filter.Size.MatchesPositive(-1, Size) == false) else if (filter.DatItem_Size.MatchesPositive(-1, Size) == false)
return false; return false;
else if (filter.Size.MatchesNegative(-1, Size) == false) else if (filter.DatItem_Size.MatchesNegative(-1, Size) == false)
return false; return false;
// Filter on CRC // Filter on CRC
if (filter.CRC.MatchesPositiveSet(CRC) == false) if (filter.DatItem_CRC.MatchesPositiveSet(CRC) == false)
return false; return false;
if (filter.CRC.MatchesNegativeSet(CRC) == true) if (filter.DatItem_CRC.MatchesNegativeSet(CRC) == true)
return false; return false;
// Filter on MD5 // Filter on MD5
if (filter.MD5.MatchesPositiveSet(MD5) == false) if (filter.DatItem_MD5.MatchesPositiveSet(MD5) == false)
return false; return false;
if (filter.MD5.MatchesNegativeSet(MD5) == true) if (filter.DatItem_MD5.MatchesNegativeSet(MD5) == true)
return false; return false;
#if NET_FRAMEWORK #if NET_FRAMEWORK
// Filter on RIPEMD160 // Filter on RIPEMD160
if (filter.RIPEMD160.MatchesPositiveSet(RIPEMD160) == false) if (filter.DatItem_RIPEMD160.MatchesPositiveSet(RIPEMD160) == false)
return false; return false;
if (filter.RIPEMD160.MatchesNegativeSet(RIPEMD160) == true) if (filter.DatItem_RIPEMD160.MatchesNegativeSet(RIPEMD160) == true)
return false; return false;
#endif #endif
// Filter on SHA-1 // Filter on SHA-1
if (filter.SHA1.MatchesPositiveSet(SHA1) == false) if (filter.DatItem_SHA1.MatchesPositiveSet(SHA1) == false)
return false; return false;
if (filter.SHA1.MatchesNegativeSet(SHA1) == true) if (filter.DatItem_SHA1.MatchesNegativeSet(SHA1) == true)
return false; return false;
// Filter on SHA-256 // Filter on SHA-256
if (filter.SHA256.MatchesPositiveSet(SHA256) == false) if (filter.DatItem_SHA256.MatchesPositiveSet(SHA256) == false)
return false; return false;
if (filter.SHA256.MatchesNegativeSet(SHA256) == true) if (filter.DatItem_SHA256.MatchesNegativeSet(SHA256) == true)
return false; return false;
// Filter on SHA-384 // Filter on SHA-384
if (filter.SHA384.MatchesPositiveSet(SHA384) == false) if (filter.DatItem_SHA384.MatchesPositiveSet(SHA384) == false)
return false; return false;
if (filter.SHA384.MatchesNegativeSet(SHA384) == true) if (filter.DatItem_SHA384.MatchesNegativeSet(SHA384) == true)
return false; return false;
// Filter on SHA-512 // Filter on SHA-512
if (filter.SHA512.MatchesPositiveSet(SHA512) == false) if (filter.DatItem_SHA512.MatchesPositiveSet(SHA512) == false)
return false; return false;
if (filter.SHA512.MatchesNegativeSet(SHA512) == true) if (filter.DatItem_SHA512.MatchesNegativeSet(SHA512) == true)
return false; return false;
// Filter on merge tag // Filter on merge tag
if (filter.MergeTag.MatchesPositiveSet(MergeTag) == false) if (filter.DatItem_Merge.MatchesPositiveSet(MergeTag) == false)
return false; return false;
if (filter.MergeTag.MatchesNegativeSet(MergeTag) == true) if (filter.DatItem_Merge.MatchesNegativeSet(MergeTag) == true)
return false; return false;
// Filter on region // Filter on region
if (filter.Region.MatchesPositiveSet(Region) == false) if (filter.DatItem_Region.MatchesPositiveSet(Region) == false)
return false; return false;
if (filter.Region.MatchesNegativeSet(Region) == true) if (filter.DatItem_Region.MatchesNegativeSet(Region) == true)
return false; return false;
// Filter on offset // Filter on offset
if (filter.Offset.MatchesPositiveSet(Offset) == false) if (filter.DatItem_Offset.MatchesPositiveSet(Offset) == false)
return false; return false;
if (filter.Offset.MatchesNegativeSet(Offset) == true) if (filter.DatItem_Offset.MatchesNegativeSet(Offset) == true)
return false; return false;
// Filter on date // Filter on date
if (filter.Date.MatchesPositiveSet(Date) == false) if (filter.DatItem_Date.MatchesPositiveSet(Date) == false)
return false; return false;
if (filter.Date.MatchesNegativeSet(Date) == true) if (filter.DatItem_Date.MatchesNegativeSet(Date) == true)
return false; return false;
// Filter on status // Filter on status
if (filter.Status.MatchesPositive(ItemStatus.NULL, ItemStatus) == false) if (filter.DatItem_Status.MatchesPositive(ItemStatus.NULL, ItemStatus) == false)
return false; return false;
if (filter.Status.MatchesNegative(ItemStatus.NULL, ItemStatus) == true) if (filter.DatItem_Status.MatchesNegative(ItemStatus.NULL, ItemStatus) == true)
return false; return false;
// Filter on optional // Filter on optional
if (filter.Optional.MatchesNeutral(null, Optional) == false) if (filter.DatItem_Optional.MatchesNeutral(null, Optional) == false)
return false; return false;
// Filter on inverted // Filter on inverted
if (filter.Inverted.MatchesNeutral(null, Inverted) == false) if (filter.DatItem_Inverted.MatchesNeutral(null, Inverted) == false)
return false; return false;
return true; return true;

View File

@@ -272,215 +272,83 @@ namespace SabreTools.Library.Filtering
#region Common #region Common
/// <summary> public FilterItem<string> DatItem_Name { get; private set; } = new FilterItem<string>();
/// Include or exclude item names public FilterItem<string> DatItem_Type { get; private set; } = new FilterItem<string>();
/// </summary>
public FilterItem<string> ItemName { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude item types
/// </summary>
public FilterItem<string> ItemTypes { get; private set; } = new FilterItem<string>();
#endregion #endregion
#region AttractMode #region AttractMode
/// <summary> public FilterItem<string> DatItem_AltName { get; private set; } = new FilterItem<string>();
/// Include or exclude alt names public FilterItem<string> DatItem_AltTitle { get; private set; } = new FilterItem<string>();
/// </summary>
public FilterItem<string> AltName { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude alt titles
/// </summary>
public FilterItem<string> AltTitle { get; private set; } = new FilterItem<string>();
#endregion #endregion
#region OpenMSX #region OpenMSX
/// <summary> public FilterItem<string> DatItem_Original { get; private set; } = new FilterItem<string>();
/// Include or exclude original value public FilterItem<OpenMSXSubType> DatItem_OpenMSXSubType { get; private set; } = new FilterItem<OpenMSXSubType>() { Positive = OpenMSXSubType.NULL, Negative = OpenMSXSubType.NULL };
/// </summary> public FilterItem<string> DatItem_OpenMSXType { get; private set; } = new FilterItem<string>();
public FilterItem<string> Original { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_Remark { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_Boot { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude items of a certain OpenMSX subtype
/// </summary>
public FilterItem<OpenMSXSubType> SubType { get; private set; } = new FilterItem<OpenMSXSubType>() { Positive = OpenMSXSubType.NULL, Negative = OpenMSXSubType.NULL };
/// <summary>
/// Include or exclude OpenMSX type
/// </summary>
public FilterItem<string> OpenMSXType { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude remarks
/// </summary>
public FilterItem<string> Remark { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude boots
/// </summary>
public FilterItem<string> Boot { get; private set; } = new FilterItem<string>();
#endregion #endregion
#region SoftwareList #region SoftwareList
/// <summary> // Part
/// Include or exclude part names public FilterItem<bool?> DatItem_Part { get; private set; } = new FilterItem<bool?>() { Neutral = null };
/// </summary> public FilterItem<string> DatItem_Part_Name { get; private set; } = new FilterItem<string>();
public FilterItem<string> PartName { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_Part_Interface { get; private set; } = new FilterItem<string>();
/// <summary> // Feature
/// Include or exclude part interfaces public FilterItem<bool?> DatItem_Features { get; private set; } = new FilterItem<bool?>() { Neutral = null };
/// </summary> public FilterItem<string> DatItem_Feature_Name { get; private set; } = new FilterItem<string>();
public FilterItem<string> PartInterface { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_Feature_Value { get; private set; } = new FilterItem<string>();
// TODO: DatItem.Features - List<SoftwareListFeature> public FilterItem<string> DatItem_AreaName { get; private set; } = new FilterItem<string>();
public FilterItem<long?> DatItem_AreaSize { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
/// <summary> public FilterItem<string> DatItem_AreaWidth { get; private set; } = new FilterItem<string>();
/// Include or exclude area names public FilterItem<string> DatItem_AreaEndianness { get; private set; } = new FilterItem<string>();
/// </summary> public FilterItem<string> DatItem_Value { get; private set; } = new FilterItem<string>();
public FilterItem<string> AreaName { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_LoadFlag { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude area sizes
/// </summary>
/// <remarks>Positive means "Greater than or equal", Negative means "Less than or equal", Neutral means "Equal"</remarks>
public FilterItem<long?> AreaSize { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
/// <summary>
/// Include or exclude area byte widths
/// </summary>
public FilterItem<string> AreaWidth { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude area endianness
/// </summary>
public FilterItem<string> AreaEndianness { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude softwarelist value
/// </summary>
public FilterItem<string> Value { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude load flag
/// </summary>
public FilterItem<string> LoadFlag { get; private set; } = new FilterItem<string>();
#endregion #endregion
/// <summary> #region Item-Specific
/// Include or exclude items with the "Default" tag
/// </summary>
public FilterItem<bool?> Default { get; private set; } = new FilterItem<bool?>() { Neutral = null };
/// <summary> // BiosSet
/// Include or exclude descriptions public FilterItem<bool?> DatItem_Default { get; private set; } = new FilterItem<bool?>() { Neutral = null };
/// </summary> public FilterItem<string> DatItem_Description { get; private set; } = new FilterItem<string>();
public FilterItem<string> Description { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude item sizes
/// </summary>
/// <remarks>Positive means "Greater than or equal", Negative means "Less than or equal", Neutral means "Equal"</remarks>
public FilterItem<long> Size { get; private set; } = new FilterItem<long>() { Positive = -1, Negative = -1, Neutral = -1 };
/// <summary>
/// Include or exclude CRC32 hashes
/// </summary>
public FilterItem<string> CRC { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude MD5 hashes
/// </summary>
public FilterItem<string> MD5 { get; private set; } = new FilterItem<string>();
// Disk
public FilterItem<string> DatItem_MD5 { get; private set; } = new FilterItem<string>();
#if NET_FRAMEWORK #if NET_FRAMEWORK
/// <summary> public FilterItem<string> DatItem_RIPEMD160 { get; private set; } = new FilterItem<string>();
/// Include or exclude RIPEMD160 hashes
/// </summary>
public FilterItem<string> RIPEMD160 { get; private set; } = new FilterItem<string>();
#endif #endif
public FilterItem<string> DatItem_SHA1 { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_SHA256 { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_SHA384 { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_SHA512 { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_Merge { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_Region { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_Index { get; private set; } = new FilterItem<string>();
public FilterItem<bool?> DatItem_Writable { get; private set; } = new FilterItem<bool?>() { Neutral = null };
public FilterItem<bool?> DatItem_Optional { get; private set; } = new FilterItem<bool?>() { Neutral = null };
public FilterItem<ItemStatus> DatItem_Status { get; private set; } = new FilterItem<ItemStatus>() { Positive = ItemStatus.NULL, Negative = ItemStatus.NULL };
/// <summary> // Release
/// Include or exclude SHA-1 hashes public FilterItem<string> DatItem_Language { get; private set; } = new FilterItem<string>();
/// </summary> public FilterItem<string> DatItem_Date { get; private set; } = new FilterItem<string>();
public FilterItem<string> SHA1 { get; private set; } = new FilterItem<string>();
/// <summary> // Rom
/// Include or exclude SHA-256 hashes public FilterItem<string> DatItem_Bios { get; private set; } = new FilterItem<string>();
/// </summary> public FilterItem<long> DatItem_Size { get; private set; } = new FilterItem<long>() { Positive = -1, Negative = -1, Neutral = -1 };
public FilterItem<string> SHA256 { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_CRC { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_Offset { get; private set; } = new FilterItem<string>();
public FilterItem<bool?> DatItem_Inverted { get; private set; } = new FilterItem<bool?>();
/// <summary> #endregion
/// Include or exclude SHA-384 hashes
/// </summary>
public FilterItem<string> SHA384 { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude SHA-512 hashes
/// </summary>
public FilterItem<string> SHA512 { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude merge tags
/// </summary>
public FilterItem<string> MergeTag { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude regions
/// </summary>
public FilterItem<string> Region { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude indexes
/// </summary>
public FilterItem<string> Index { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude items with the "Writable" tag
/// </summary>
public FilterItem<bool?> Writable { get; private set; } = new FilterItem<bool?>() { Neutral = null };
/// <summary>
/// Include or exclude items with the "Writable" tag
/// </summary>
public FilterItem<bool?> Optional { get; private set; } = new FilterItem<bool?>() { Neutral = null };
/// <summary>
/// Include or exclude item statuses
/// </summary>
public FilterItem<ItemStatus> Status { get; private set; } = new FilterItem<ItemStatus>() { Positive = ItemStatus.NULL, Negative = ItemStatus.NULL };
/// <summary>
/// Include or exclude languages
/// </summary>
public FilterItem<string> Language { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude dates
/// </summary>
public FilterItem<string> Date { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude bioses
/// </summary>
public FilterItem<string> Bios { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude offsets
/// </summary>
public FilterItem<string> Offset { get; private set; } = new FilterItem<string>();
/// <summary>
/// Include or exclude offsets
/// </summary>
public FilterItem<bool?> Inverted { get; private set; } = new FilterItem<bool?>();
#endregion // DatItem Filters #endregion // DatItem Filters
@@ -871,9 +739,9 @@ namespace SabreTools.Library.Filtering
case Field.DatItem_Name: case Field.DatItem_Name:
if (negate) if (negate)
ItemName.NegativeSet.Add(value); DatItem_Name.NegativeSet.Add(value);
else else
ItemName.PositiveSet.Add(value); DatItem_Name.PositiveSet.Add(value);
break; break;
case Field.DatItem_Type: case Field.DatItem_Type:
@@ -881,9 +749,9 @@ namespace SabreTools.Library.Filtering
return; return;
if (negate) if (negate)
ItemTypes.NegativeSet.Add(value); DatItem_Type.NegativeSet.Add(value);
else else
ItemTypes.PositiveSet.Add(value); DatItem_Type.PositiveSet.Add(value);
break; break;
#endregion #endregion
@@ -892,16 +760,16 @@ namespace SabreTools.Library.Filtering
case Field.DatItem_AltName: case Field.DatItem_AltName:
if (negate) if (negate)
AltName.NegativeSet.Add(value); DatItem_AltName.NegativeSet.Add(value);
else else
AltName.PositiveSet.Add(value); DatItem_AltName.PositiveSet.Add(value);
break; break;
case Field.DatItem_AltTitle: case Field.DatItem_AltTitle:
if (negate) if (negate)
AltTitle.NegativeSet.Add(value); DatItem_AltTitle.NegativeSet.Add(value);
else else
AltTitle.PositiveSet.Add(value); DatItem_AltTitle.PositiveSet.Add(value);
break; break;
#endregion #endregion
@@ -910,37 +778,37 @@ namespace SabreTools.Library.Filtering
case Field.DatItem_Original: case Field.DatItem_Original:
if (negate) if (negate)
Original.NegativeSet.Add(value); DatItem_Original.NegativeSet.Add(value);
else else
Original.PositiveSet.Add(value); DatItem_Original.PositiveSet.Add(value);
break; break;
case Field.DatItem_OpenMSXSubType: case Field.DatItem_OpenMSXSubType:
if (negate) if (negate)
SubType.Negative |= value.AsOpenMSXSubType(); DatItem_OpenMSXSubType.Negative |= value.AsOpenMSXSubType();
else else
SubType.Positive |= value.AsOpenMSXSubType(); DatItem_OpenMSXSubType.Positive |= value.AsOpenMSXSubType();
break; break;
case Field.DatItem_OpenMSXType: case Field.DatItem_OpenMSXType:
if (negate) if (negate)
OpenMSXType.NegativeSet.Add(value); DatItem_OpenMSXType.NegativeSet.Add(value);
else else
OpenMSXType.PositiveSet.Add(value); DatItem_OpenMSXType.PositiveSet.Add(value);
break; break;
case Field.DatItem_Remark: case Field.DatItem_Remark:
if (negate) if (negate)
Remark.NegativeSet.Add(value); DatItem_Remark.NegativeSet.Add(value);
else else
Remark.PositiveSet.Add(value); DatItem_Remark.PositiveSet.Add(value);
break; break;
case Field.DatItem_Boot: case Field.DatItem_Boot:
if (negate) if (negate)
Boot.NegativeSet.Add(value); DatItem_Boot.NegativeSet.Add(value);
else else
Boot.PositiveSet.Add(value); DatItem_Boot.PositiveSet.Add(value);
break; break;
#endregion #endregion
@@ -949,23 +817,23 @@ namespace SabreTools.Library.Filtering
case Field.DatItem_Part_Name: case Field.DatItem_Part_Name:
if (negate) if (negate)
PartName.NegativeSet.Add(value); DatItem_Part_Name.NegativeSet.Add(value);
else else
PartName.PositiveSet.Add(value); DatItem_Part_Name.PositiveSet.Add(value);
break; break;
case Field.DatItem_Part_Interface: case Field.DatItem_Part_Interface:
if (negate) if (negate)
PartInterface.NegativeSet.Add(value); DatItem_Part_Interface.NegativeSet.Add(value);
else else
PartInterface.PositiveSet.Add(value); DatItem_Part_Interface.PositiveSet.Add(value);
break; break;
case Field.DatItem_AreaName: case Field.DatItem_AreaName:
if (negate) if (negate)
AreaName.NegativeSet.Add(value); DatItem_AreaName.NegativeSet.Add(value);
else else
AreaName.PositiveSet.Add(value); DatItem_AreaName.PositiveSet.Add(value);
break; break;
case Field.DatItem_AreaSize: case Field.DatItem_AreaSize:
@@ -984,84 +852,84 @@ namespace SabreTools.Library.Filtering
// Equal // Equal
if (asOperation == null && !negate) if (asOperation == null && !negate)
{ {
AreaSize.Neutral = areasize; DatItem_AreaSize.Neutral = areasize;
} }
// Not Equal // Not Equal
else if (asOperation == null && negate) else if (asOperation == null && negate)
{ {
AreaSize.Negative = areasize - 1; DatItem_AreaSize.Negative = areasize - 1;
AreaSize.Positive = areasize + 1; DatItem_AreaSize.Positive = areasize + 1;
} }
// Greater Than or Equal // Greater Than or Equal
else if (asOperation == true && !negate) else if (asOperation == true && !negate)
{ {
AreaSize.Positive = areasize; DatItem_AreaSize.Positive = areasize;
} }
// Strictly Less Than // Strictly Less Than
else if (asOperation == true && negate) else if (asOperation == true && negate)
{ {
AreaSize.Negative = areasize - 1; DatItem_AreaSize.Negative = areasize - 1;
} }
// Less Than or Equal // Less Than or Equal
else if (asOperation == false && !negate) else if (asOperation == false && !negate)
{ {
AreaSize.Negative = areasize; DatItem_AreaSize.Negative = areasize;
} }
// Strictly Greater Than // Strictly Greater Than
else if (asOperation == false && negate) else if (asOperation == false && negate)
{ {
AreaSize.Positive = areasize + 1; DatItem_AreaSize.Positive = areasize + 1;
} }
break; break;
case Field.DatItem_AreaWidth: case Field.DatItem_AreaWidth:
if (negate) if (negate)
AreaWidth.NegativeSet.Add(value); DatItem_AreaWidth.NegativeSet.Add(value);
else else
AreaWidth.PositiveSet.Add(value); DatItem_AreaWidth.PositiveSet.Add(value);
break; break;
case Field.DatItem_AreaEndianness: case Field.DatItem_AreaEndianness:
if (negate) if (negate)
AreaEndianness.NegativeSet.Add(value); DatItem_AreaEndianness.NegativeSet.Add(value);
else else
AreaEndianness.PositiveSet.Add(value); DatItem_AreaEndianness.PositiveSet.Add(value);
break; break;
case Field.DatItem_Value: case Field.DatItem_Value:
if (negate) if (negate)
Value.NegativeSet.Add(value); DatItem_Value.NegativeSet.Add(value);
else else
Value.PositiveSet.Add(value); DatItem_Value.PositiveSet.Add(value);
break; break;
case Field.DatItem_LoadFlag: case Field.DatItem_LoadFlag:
if (negate) if (negate)
LoadFlag.NegativeSet.Add(value); DatItem_LoadFlag.NegativeSet.Add(value);
else else
LoadFlag.PositiveSet.Add(value); DatItem_LoadFlag.PositiveSet.Add(value);
break; break;
#endregion #endregion
case Field.DatItem_Default: case Field.DatItem_Default:
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase)) if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
Default.Neutral = false; DatItem_Default.Neutral = false;
else else
Default.Neutral = true; DatItem_Default.Neutral = true;
break; break;
case Field.DatItem_Description: case Field.DatItem_Description:
if (negate) if (negate)
Description.NegativeSet.Add(value); DatItem_Description.NegativeSet.Add(value);
else else
Description.PositiveSet.Add(value); DatItem_Description.PositiveSet.Add(value);
break; break;
case Field.DatItem_Size: case Field.DatItem_Size:
@@ -1080,168 +948,168 @@ namespace SabreTools.Library.Filtering
// Equal // Equal
if (sOperation == null && !negate) if (sOperation == null && !negate)
{ {
Size.Neutral = size; DatItem_Size.Neutral = size;
} }
// Not Equal // Not Equal
else if (sOperation == null && negate) else if (sOperation == null && negate)
{ {
Size.Negative = size - 1; DatItem_Size.Negative = size - 1;
Size.Positive = size + 1; DatItem_Size.Positive = size + 1;
} }
// Greater Than or Equal // Greater Than or Equal
else if (sOperation == true && !negate) else if (sOperation == true && !negate)
{ {
Size.Positive = size; DatItem_Size.Positive = size;
} }
// Strictly Less Than // Strictly Less Than
else if (sOperation == true && negate) else if (sOperation == true && negate)
{ {
Size.Negative = size - 1; DatItem_Size.Negative = size - 1;
} }
// Less Than or Equal // Less Than or Equal
else if (sOperation == false && !negate) else if (sOperation == false && !negate)
{ {
Size.Negative = size; DatItem_Size.Negative = size;
} }
// Strictly Greater Than // Strictly Greater Than
else if (sOperation == false && negate) else if (sOperation == false && negate)
{ {
Size.Positive = size + 1; DatItem_Size.Positive = size + 1;
} }
break; break;
case Field.DatItem_CRC: case Field.DatItem_CRC:
if (negate) if (negate)
CRC.NegativeSet.Add(value); DatItem_CRC.NegativeSet.Add(value);
else else
CRC.PositiveSet.Add(value); DatItem_CRC.PositiveSet.Add(value);
break; break;
case Field.DatItem_MD5: case Field.DatItem_MD5:
if (negate) if (negate)
MD5.NegativeSet.Add(value); DatItem_MD5.NegativeSet.Add(value);
else else
MD5.PositiveSet.Add(value); DatItem_MD5.PositiveSet.Add(value);
break; break;
#if NET_FRAMEWORK #if NET_FRAMEWORK
case Field.DatItem_RIPEMD160: case Field.DatItem_RIPEMD160:
if (negate) if (negate)
RIPEMD160.NegativeSet.Add(value); DatItem_RIPEMD160.NegativeSet.Add(value);
else else
RIPEMD160.PositiveSet.Add(value); DatItem_RIPEMD160.PositiveSet.Add(value);
break; break;
#endif #endif
case Field.DatItem_SHA1: case Field.DatItem_SHA1:
if (negate) if (negate)
SHA1.NegativeSet.Add(value); DatItem_SHA1.NegativeSet.Add(value);
else else
SHA1.PositiveSet.Add(value); DatItem_SHA1.PositiveSet.Add(value);
break; break;
case Field.DatItem_SHA256: case Field.DatItem_SHA256:
if (negate) if (negate)
SHA256.NegativeSet.Add(value); DatItem_SHA256.NegativeSet.Add(value);
else else
SHA256.PositiveSet.Add(value); DatItem_SHA256.PositiveSet.Add(value);
break; break;
case Field.DatItem_SHA384: case Field.DatItem_SHA384:
if (negate) if (negate)
SHA384.NegativeSet.Add(value); DatItem_SHA384.NegativeSet.Add(value);
else else
SHA384.PositiveSet.Add(value); DatItem_SHA384.PositiveSet.Add(value);
break; break;
case Field.DatItem_SHA512: case Field.DatItem_SHA512:
if (negate) if (negate)
SHA512.NegativeSet.Add(value); DatItem_SHA512.NegativeSet.Add(value);
else else
SHA512.PositiveSet.Add(value); DatItem_SHA512.PositiveSet.Add(value);
break; break;
case Field.DatItem_Merge: case Field.DatItem_Merge:
if (negate) if (negate)
MergeTag.NegativeSet.Add(value); DatItem_Merge.NegativeSet.Add(value);
else else
MergeTag.PositiveSet.Add(value); DatItem_Merge.PositiveSet.Add(value);
break; break;
case Field.DatItem_Region: case Field.DatItem_Region:
if (negate) if (negate)
Region.NegativeSet.Add(value); DatItem_Region.NegativeSet.Add(value);
else else
Region.PositiveSet.Add(value); DatItem_Region.PositiveSet.Add(value);
break; break;
case Field.DatItem_Index: case Field.DatItem_Index:
if (negate) if (negate)
Index.NegativeSet.Add(value); DatItem_Index.NegativeSet.Add(value);
else else
Index.PositiveSet.Add(value); DatItem_Index.PositiveSet.Add(value);
break; break;
case Field.DatItem_Writable: case Field.DatItem_Writable:
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase)) if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
Writable.Neutral = false; DatItem_Writable.Neutral = false;
else else
Writable.Neutral = true; DatItem_Writable.Neutral = true;
break; break;
case Field.DatItem_Optional: case Field.DatItem_Optional:
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase)) if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
Optional.Neutral = false; DatItem_Optional.Neutral = false;
else else
Optional.Neutral = true; DatItem_Optional.Neutral = true;
break; break;
case Field.DatItem_Status: case Field.DatItem_Status:
if (negate) if (negate)
Status.Negative |= value.AsItemStatus(); DatItem_Status.Negative |= value.AsItemStatus();
else else
Status.Positive |= value.AsItemStatus(); DatItem_Status.Positive |= value.AsItemStatus();
break; break;
case Field.DatItem_Language: case Field.DatItem_Language:
if (negate) if (negate)
Language.NegativeSet.Add(value); DatItem_Language.NegativeSet.Add(value);
else else
Language.PositiveSet.Add(value); DatItem_Language.PositiveSet.Add(value);
break; break;
case Field.DatItem_Date: case Field.DatItem_Date:
if (negate) if (negate)
Date.NegativeSet.Add(value); DatItem_Date.NegativeSet.Add(value);
else else
Date.PositiveSet.Add(value); DatItem_Date.PositiveSet.Add(value);
break; break;
case Field.DatItem_Bios: case Field.DatItem_Bios:
if (negate) if (negate)
Bios.NegativeSet.Add(value); DatItem_Bios.NegativeSet.Add(value);
else else
Bios.PositiveSet.Add(value); DatItem_Bios.PositiveSet.Add(value);
break; break;
case Field.DatItem_Offset: case Field.DatItem_Offset:
if (negate) if (negate)
Offset.NegativeSet.Add(value); DatItem_Offset.NegativeSet.Add(value);
else else
Offset.PositiveSet.Add(value); DatItem_Offset.PositiveSet.Add(value);
break; break;
case Field.DatItem_Inverted: case Field.DatItem_Inverted:
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase)) if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
Inverted.Neutral = false; DatItem_Inverted.Neutral = false;
else else
Inverted.Neutral = true; DatItem_Inverted.Neutral = true;
break; break;
#endregion // DatItem Filters #endregion // DatItem Filters