[ALL] Nearly all work for SHA384/512 support

This commit is contained in:
Matt Nadareski
2017-02-27 00:01:24 -08:00
parent d3111add08
commit 9b73018589
13 changed files with 607 additions and 34 deletions

View File

@@ -19,6 +19,8 @@ namespace SabreTools.Helper.Dats
private List<string> _md5s;
private List<string> _sha1s;
private List<string> _sha256s;
private List<string> _sha384s;
private List<string> _sha512s;
private ItemStatus _itemStatuses;
private MachineType _machineTypes;
@@ -33,6 +35,8 @@ namespace SabreTools.Helper.Dats
private List<string> _notMd5s;
private List<string> _notSha1s;
private List<string> _notSha256s;
private List<string> _notSha384s;
private List<string> _notSha512s;
private ItemStatus _itemNotStatuses;
private MachineType _machineNotTypes;
@@ -89,6 +93,16 @@ namespace SabreTools.Helper.Dats
get { return _sha256s; }
set { _sha256s = value; }
}
public List<string> SHA384s
{
get { return _sha384s; }
set { _sha384s = value; }
}
public List<string> SHA512s
{
get { return _sha512s; }
set { _sha512s = value; }
}
public ItemStatus ItemStatuses
{
get { return _itemStatuses; }
@@ -139,6 +153,16 @@ namespace SabreTools.Helper.Dats
get { return _notSha256s; }
set { _notSha256s = value; }
}
public List<string> NotSHA384s
{
get { return _notSha384s; }
set { _notSha384s = value; }
}
public List<string> NotSHA512s
{
get { return _notSha512s; }
set { _notSha512s = value; }
}
public ItemStatus NotItemStatuses
{
get { return _itemNotStatuses; }
@@ -199,6 +223,8 @@ namespace SabreTools.Helper.Dats
_md5s = new List<string>();
_sha1s = new List<string>();
_sha256s = new List<string>();
_sha384s = new List<string>();
_sha512s = new List<string>();
_itemStatuses = ItemStatus.NULL;
_machineTypes = MachineType.NULL;
@@ -210,6 +236,8 @@ namespace SabreTools.Helper.Dats
_notMd5s = new List<string>();
_notSha1s = new List<string>();
_notSha256s = new List<string>();
_notSha384s = new List<string>();
_notSha512s = new List<string>();
_itemNotStatuses = ItemStatus.NULL;
_machineNotTypes = MachineType.NULL;
@@ -364,6 +392,42 @@ namespace SabreTools.Helper.Dats
return false;
}
}
// Filter on SHA384
if (_sha384s.Count > 0)
{
// If the SHA-1 isn't in the list, return false
if (!FindValueInList(_sha384s, rom.SHA384))
{
return false;
}
}
if (_notSha384s.Count > 0)
{
// If the SHA-1 is in the list, return false
if (FindValueInList(_notSha384s, rom.SHA384))
{
return false;
}
}
// Filter on SHA512
if (_sha512s.Count > 0)
{
// If the SHA-1 isn't in the list, return false
if (!FindValueInList(_sha512s, rom.SHA512))
{
return false;
}
}
if (_notSha512s.Count > 0)
{
// If the SHA-1 is in the list, return false
if (FindValueInList(_notSha512s, rom.SHA512))
{
return false;
}
}
}
else if (item.Type == ItemType.Disk)
{
@@ -432,6 +496,42 @@ namespace SabreTools.Helper.Dats
return false;
}
}
// Filter on SHA384
if (_sha384s.Count > 0)
{
// If the SHA-1 isn't in the list, return false
if (!FindValueInList(_sha384s, rom.SHA384))
{
return false;
}
}
if (_notSha384s.Count > 0)
{
// If the SHA-1 is in the list, return false
if (FindValueInList(_notSha384s, rom.SHA384))
{
return false;
}
}
// Filter on SHA512
if (_sha512s.Count > 0)
{
// If the SHA-1 isn't in the list, return false
if (!FindValueInList(_sha512s, rom.SHA512))
{
return false;
}
}
if (_notSha512s.Count > 0)
{
// If the SHA-1 is in the list, return false
if (FindValueInList(_notSha512s, rom.SHA512))
{
return false;
}
}
}
// Filter on game name