mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile, DatHeader, DatStats] Descriptors
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -10,43 +10,183 @@ namespace SabreTools.Library.DatFiles
|
||||
{
|
||||
#region Publicly facing variables
|
||||
|
||||
// Data common to most DAT types
|
||||
#region Data common to most DAT types
|
||||
|
||||
/// <summary>
|
||||
/// External name of the DAT
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Internal name of the DAT
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DAT description
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Root directory for the files; currently TruRip/EmuARC-exclusive
|
||||
/// </summary>
|
||||
public string RootDir { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// General category of items found in the DAT
|
||||
/// </summary>
|
||||
public string Category { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Version of the DAT
|
||||
/// </summary>
|
||||
public string Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creation or modification date
|
||||
/// </summary>
|
||||
public string Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of authors who contributed to the DAT
|
||||
/// </summary>
|
||||
public string Author { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Email address for DAT author(s)
|
||||
/// </summary>
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Author or distribution homepage name
|
||||
/// </summary>
|
||||
public string Homepage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Author or distribution URL
|
||||
/// </summary>
|
||||
public string Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Any comment that does not already fit an existing field
|
||||
/// </summary>
|
||||
public string Comment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Header skipper to be used when loading the DAT
|
||||
/// </summary>
|
||||
public string Header { get; set; }
|
||||
public string Type { get; set; } // Generally only used for SuperDAT
|
||||
|
||||
/// <summary>
|
||||
/// Classification of the DAT. Generally only used for SuperDAT
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Force a merging style when loaded
|
||||
/// </summary>
|
||||
public ForceMerging ForceMerging { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Force nodump handling when loaded
|
||||
/// </summary>
|
||||
public ForceNodump ForceNodump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Force output packing when loaded
|
||||
/// </summary>
|
||||
public ForcePacking ForcePacking { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Read or write format
|
||||
/// </summary>
|
||||
public DatFormat DatFormat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of fields in machine and items to exclude from writing
|
||||
/// </summary>
|
||||
public bool[] ExcludeFields { get; set; } = new bool[Enum.GetNames(typeof(Field)).Length];
|
||||
|
||||
/// <summary>
|
||||
/// Enable "One Rom, One Region (1G1R)" mode
|
||||
/// </summary>
|
||||
public bool OneRom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Keep machines that don't contain any items
|
||||
/// </summary>
|
||||
public bool KeepEmptyGames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Remove scene dates from the beginning of machine names
|
||||
/// </summary>
|
||||
public bool SceneDateStrip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Deduplicate items using the given method
|
||||
/// </summary>
|
||||
public DedupeType DedupeRoms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Strip hash types from items
|
||||
/// </summary>
|
||||
public Hash StripHash { get; private set; }
|
||||
|
||||
// Data specific to the Miss DAT type
|
||||
public bool UseRomName { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Write pre-processing
|
||||
|
||||
/// <summary>
|
||||
/// Text to prepend to all outputted lines
|
||||
/// </summary>
|
||||
public string Prefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Text to append to all outputted lines
|
||||
/// </summary>
|
||||
public string Postfix { get; set; }
|
||||
public bool Quotes { get; set; }
|
||||
public string ReplaceExtension { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Add a new extension to all items
|
||||
/// </summary>
|
||||
public string AddExtension { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Replace all item extensions
|
||||
/// </summary>
|
||||
public string ReplaceExtension { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Remove all item extensions
|
||||
/// </summary>
|
||||
public bool RemoveExtension { get; set; }
|
||||
public bool GameName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Romba output mode
|
||||
/// </summary>
|
||||
public bool Romba { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Output the machine name
|
||||
/// </summary>
|
||||
public bool GameName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Wrap quotes around the entire line, sans prefix and postfix
|
||||
/// </summary>
|
||||
public bool Quotes { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Data specific to the Miss DAT type
|
||||
|
||||
/// <summary>
|
||||
/// Output the item name
|
||||
/// </summary>
|
||||
public bool UseRomName { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Instance Methods
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatItems;
|
||||
|
||||
@@ -12,45 +11,114 @@ namespace SabreTools.Library.DatFiles
|
||||
{
|
||||
#region Private instance variables
|
||||
|
||||
// Object used to lock stats updates
|
||||
/// <summary>
|
||||
/// Object used to lock stats updates
|
||||
/// </summary>
|
||||
private object _lockObject = new object();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Publicly facing variables
|
||||
|
||||
// Statistics report format
|
||||
/// <summary>
|
||||
/// Statistics writing format
|
||||
/// </summary>
|
||||
public StatReportFormat ReportFormat { get; set; } = StatReportFormat.None;
|
||||
|
||||
// Overall item count
|
||||
/// <summary>
|
||||
/// Overall item count
|
||||
/// </summary>
|
||||
public long Count { get; set; } = 0;
|
||||
|
||||
// Individual DatItem type counts
|
||||
/// <summary>
|
||||
/// Number of Archive items
|
||||
/// </summary>
|
||||
public long ArchiveCount { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of BiosSet items
|
||||
/// </summary>
|
||||
public long BiosSetCount { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of Disk items
|
||||
/// </summary>
|
||||
public long DiskCount { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of Release items
|
||||
/// </summary>
|
||||
public long ReleaseCount { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of Rom items
|
||||
/// </summary>
|
||||
public long RomCount { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of Sample items
|
||||
/// </summary>
|
||||
public long SampleCount { get; set; } = 0;
|
||||
|
||||
// Special count only used by statistics output
|
||||
/// <summary>
|
||||
/// Number of machines
|
||||
/// </summary>
|
||||
/// <remarks>Special count only used by statistics output</remarks>
|
||||
public long GameCount { get; set; } = 0;
|
||||
|
||||
// Total reported size
|
||||
/// <summary>
|
||||
/// Total uncompressed size
|
||||
/// </summary>
|
||||
public long TotalSize { get; set; } = 0;
|
||||
|
||||
// Individual hash counts
|
||||
/// <summary>
|
||||
/// Number of items with a CRC hash
|
||||
/// </summary>
|
||||
public long CRCCount { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of items with an MD5 hash
|
||||
/// </summary>
|
||||
public long MD5Count { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of items with a SHA-1 hash
|
||||
/// </summary>
|
||||
public long SHA1Count { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of items with a SHA-256 hash
|
||||
/// </summary>
|
||||
public long SHA256Count { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of items with a SHA-384 hash
|
||||
/// </summary>
|
||||
public long SHA384Count { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of items with a SHA-512 hash
|
||||
/// </summary>
|
||||
public long SHA512Count { get; set; } = 0;
|
||||
|
||||
// Individual status counts
|
||||
/// <summary>
|
||||
/// Number of items with the baddump status
|
||||
/// </summary>
|
||||
public long BaddumpCount { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of items with the good status
|
||||
/// </summary>
|
||||
public long GoodCount { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of items with the nodump status
|
||||
/// </summary>
|
||||
public long NodumpCount { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of items with the verified status
|
||||
/// </summary>
|
||||
public long VerifiedCount { get; set; } = 0;
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user