mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix JSON read/write, XML write
This commit is contained in:
@@ -36,19 +36,19 @@ namespace SabreTools.Library.DatItems
|
||||
/// <summary>
|
||||
/// What BIOS is required for this rom
|
||||
/// </summary>
|
||||
[JsonProperty("bios")]
|
||||
[JsonProperty("bios", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Bios { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Byte size of the rom
|
||||
/// </summary>
|
||||
[JsonProperty("size")]
|
||||
[JsonProperty("size", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public long Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File CRC32 hash
|
||||
/// </summary>
|
||||
[JsonProperty("crc")]
|
||||
[JsonProperty("crc", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string CRC
|
||||
{
|
||||
get { return _crc.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_crc); }
|
||||
@@ -58,7 +58,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// <summary>
|
||||
/// File MD5 hash
|
||||
/// </summary>
|
||||
[JsonProperty("md5")]
|
||||
[JsonProperty("md5", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string MD5
|
||||
{
|
||||
get { return _md5.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_md5); }
|
||||
@@ -69,7 +69,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// <summary>
|
||||
/// File RIPEMD160 hash
|
||||
/// </summary>
|
||||
[JsonProperty("ripemd160")]
|
||||
[JsonProperty("ripemd160", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string RIPEMD160
|
||||
{
|
||||
get { return _ripemd160.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_ripemd160); }
|
||||
@@ -80,7 +80,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// <summary>
|
||||
/// File SHA-1 hash
|
||||
/// </summary>
|
||||
[JsonProperty("sha1")]
|
||||
[JsonProperty("sha1", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string SHA1
|
||||
{
|
||||
get { return _sha1.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha1); }
|
||||
@@ -90,7 +90,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// <summary>
|
||||
/// File SHA-256 hash
|
||||
/// </summary>
|
||||
[JsonProperty("sha256")]
|
||||
[JsonProperty("sha256", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string SHA256
|
||||
{
|
||||
get { return _sha256.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha256); }
|
||||
@@ -100,7 +100,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// <summary>
|
||||
/// File SHA-384 hash
|
||||
/// </summary>
|
||||
[JsonProperty("sha384")]
|
||||
[JsonProperty("sha384", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string SHA384
|
||||
{
|
||||
get { return _sha384.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha384); }
|
||||
@@ -110,7 +110,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// <summary>
|
||||
/// File SHA-512 hash
|
||||
/// </summary>
|
||||
[JsonProperty("sha512")]
|
||||
[JsonProperty("sha512", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string SHA512
|
||||
{
|
||||
get { return _sha512.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha512); }
|
||||
@@ -120,44 +120,44 @@ namespace SabreTools.Library.DatItems
|
||||
/// <summary>
|
||||
/// Rom name to merge from parent
|
||||
/// </summary>
|
||||
[JsonProperty("merge")]
|
||||
[JsonProperty("merge", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string MergeTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rom region
|
||||
/// </summary>
|
||||
[JsonProperty("region")]
|
||||
[JsonProperty("region", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Region { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Data offset within rom
|
||||
/// </summary>
|
||||
[JsonProperty("offset")]
|
||||
[JsonProperty("offset", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Offset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File created date
|
||||
/// </summary>
|
||||
[JsonProperty("date")]
|
||||
[JsonProperty("date", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rom dump status
|
||||
/// </summary>
|
||||
[JsonProperty("status")]
|
||||
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public ItemStatus ItemStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determine if the rom is optional in the set
|
||||
/// </summary>
|
||||
[JsonProperty("optional")]
|
||||
[JsonProperty("optional", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public bool? Optional { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determine if the CRC32 hash is inverted
|
||||
/// </summary>
|
||||
[JsonProperty("inverted")]
|
||||
[JsonProperty("inverted", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public bool? Inverted { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user