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;
// Filter on description
if (filter.Description.MatchesPositiveSet(Description) == false)
if (filter.DatItem_Description.MatchesPositiveSet(Description) == false)
return false;
if (filter.Description.MatchesNegativeSet(Description) == true)
if (filter.DatItem_Description.MatchesNegativeSet(Description) == true)
return false;
// Filter on default
if (filter.Default.MatchesNeutral(null, Default) == false)
if (filter.DatItem_Default.MatchesNeutral(null, Default) == false)
return false;
return true;

View File

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

View File

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

View File

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

View File

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

View File

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