diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index 35672eda..4579e9c9 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -16,12 +16,14 @@ using SabreTools.Library.Reports; using SabreTools.Library.Skippers; using SabreTools.Library.Tools; using NaturalSort; +using Newtonsoft.Json; namespace SabreTools.Library.DatFiles { /// /// Represents a format-agnostic DAT /// + [JsonObject("datfile")] public abstract class DatFile { #region Fields @@ -29,11 +31,13 @@ namespace SabreTools.Library.DatFiles /// /// Header values /// + [JsonProperty("header")] public DatHeader Header { get; set; } = new DatHeader(); /// /// DatItems and related statistics /// + [JsonProperty("items")] public ItemDictionary Items { get; set; } = new ItemDictionary(); #endregion diff --git a/SabreTools.Library/DatFiles/DatHeader.cs b/SabreTools.Library/DatFiles/DatHeader.cs index 04c34881..4ca6a853 100644 --- a/SabreTools.Library/DatFiles/DatHeader.cs +++ b/SabreTools.Library/DatFiles/DatHeader.cs @@ -11,6 +11,7 @@ namespace SabreTools.Library.DatFiles /// /// Represents all possible DAT header information /// + [JsonObject("header")] public class DatHeader : ICloneable { #region Fields diff --git a/SabreTools.Library/DatFiles/ItemDictionary.cs b/SabreTools.Library/DatFiles/ItemDictionary.cs index 48479bda..4d5f0dfd 100644 --- a/SabreTools.Library/DatFiles/ItemDictionary.cs +++ b/SabreTools.Library/DatFiles/ItemDictionary.cs @@ -10,12 +10,14 @@ using SabreTools.Library.DatItems; using SabreTools.Library.IO; using SabreTools.Library.Reports; using NaturalSort; +using Newtonsoft.Json; namespace SabreTools.Library.DatFiles { /// /// Item dictionary with statistics, bucketing, and sorting /// + [JsonObject("items")] public class ItemDictionary : IDictionary> { #region Private instance variables @@ -71,104 +73,124 @@ namespace SabreTools.Library.DatFiles /// /// Overall item count /// + [JsonIgnore] public long TotalCount { get; private set; } = 0; /// /// Number of Archive items /// + [JsonIgnore] public long ArchiveCount { get; private set; } = 0; /// /// Number of BiosSet items /// + [JsonIgnore] public long BiosSetCount { get; private set; } = 0; /// /// Number of Disk items /// + [JsonIgnore] public long DiskCount { get; private set; } = 0; /// /// Number of Release items /// + [JsonIgnore] public long ReleaseCount { get; private set; } = 0; /// /// Number of Rom items /// + [JsonIgnore] public long RomCount { get; private set; } = 0; /// /// Number of Sample items /// + [JsonIgnore] public long SampleCount { get; private set; } = 0; /// /// Number of machines /// /// Special count only used by statistics output + [JsonIgnore] public long GameCount { get; private set; } = 0; /// /// Total uncompressed size /// + [JsonIgnore] public long TotalSize { get; private set; } = 0; /// /// Number of items with a CRC hash /// + [JsonIgnore] public long CRCCount { get; private set; } = 0; /// /// Number of items with an MD5 hash /// + [JsonIgnore] public long MD5Count { get; private set; } = 0; #if NET_FRAMEWORK /// /// Number of items with a RIPEMD160 hash /// + [JsonIgnore] public long RIPEMD160Count { get; private set; } = 0; #endif /// /// Number of items with a SHA-1 hash /// + [JsonIgnore] public long SHA1Count { get; private set; } = 0; /// /// Number of items with a SHA-256 hash /// + [JsonIgnore] public long SHA256Count { get; private set; } = 0; /// /// Number of items with a SHA-384 hash /// + [JsonIgnore] public long SHA384Count { get; private set; } = 0; /// /// Number of items with a SHA-512 hash /// + [JsonIgnore] public long SHA512Count { get; private set; } = 0; /// /// Number of items with the baddump status /// + [JsonIgnore] public long BaddumpCount { get; private set; } = 0; /// /// Number of items with the good status /// + [JsonIgnore] public long GoodCount { get; private set; } = 0; /// /// Number of items with the nodump status /// + [JsonIgnore] public long NodumpCount { get; private set; } = 0; /// /// Number of items with the verified status /// + [JsonIgnore] public long VerifiedCount { get; private set; } = 0; #endregion