Minor formatting cleanups in DatFiles

This commit is contained in:
Matt Nadareski
2024-10-24 04:48:21 -04:00
parent 5fa34df64d
commit d1393d3731
17 changed files with 32 additions and 59 deletions

View File

@@ -11,8 +11,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public ArchiveDotOrg(DatFile? datFile) public ArchiveDotOrg(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -12,8 +12,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public AttractMode(DatFile? datFile) public AttractMode(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -16,7 +16,7 @@ namespace SabreTools.DatFiles.Formats
/// <summary> /// <summary>
/// Get whether to assume quote usage on read and write or not /// Get whether to assume quote usage on read and write or not
/// </summary> /// </summary>
public bool Quotes { get; set; } = true; private readonly bool _quotes;
#endregion #endregion
@@ -25,10 +25,9 @@ namespace SabreTools.DatFiles.Formats
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
/// <param name="quotes">Enable quotes on read and write, false otherwise</param> /// <param name="quotes">Enable quotes on read and write, false otherwise</param>
public ClrMamePro(DatFile? datFile, bool quotes) public ClrMamePro(DatFile? datFile, bool quotes) : base(datFile)
: base(datFile)
{ {
Quotes = quotes; _quotes = quotes;
} }
/// <inheritdoc/> /// <inheritdoc/>
@@ -37,7 +36,7 @@ namespace SabreTools.DatFiles.Formats
try try
{ {
// Deserialize the input file // Deserialize the input file
var metadataFile = Serialization.Deserializers.ClrMamePro.DeserializeFile(filename, this.Quotes); var metadataFile = Serialization.Deserializers.ClrMamePro.DeserializeFile(filename, this._quotes);
var metadata = new Serialization.CrossModel.ClrMamePro().Serialize(metadataFile); var metadata = new Serialization.CrossModel.ClrMamePro().Serialize(metadataFile);
// Convert to the internal format // Convert to the internal format
@@ -180,7 +179,7 @@ namespace SabreTools.DatFiles.Formats
// Serialize the input file // Serialize the input file
var metadata = ConvertMetadata(ignoreblanks); var metadata = ConvertMetadata(ignoreblanks);
var metadataFile = new Serialization.CrossModel.ClrMamePro().Deserialize(metadata); var metadataFile = new Serialization.CrossModel.ClrMamePro().Deserialize(metadata);
if (!(Serialization.Serializers.ClrMamePro.SerializeFile(metadataFile, outfile, Quotes))) if (!Serialization.Serializers.ClrMamePro.SerializeFile(metadataFile, outfile, _quotes))
{ {
logger.Warning($"File '{outfile}' could not be written! See the log for more details."); logger.Warning($"File '{outfile}' could not be written! See the log for more details.");
return false; return false;

View File

@@ -13,8 +13,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public DosCenter(DatFile? datFile) public DosCenter(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -13,8 +13,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public EverdriveSMDB(DatFile? datFile) public EverdriveSMDB(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -18,8 +18,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public Hashfile(DatFile? datFile) public Hashfile(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }
@@ -218,8 +217,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public SfvFile(DatFile? datFile) public SfvFile(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
_hash = HashType.CRC32; _hash = HashType.CRC32;
} }
@@ -234,8 +232,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public Md5File(DatFile? datFile) public Md5File(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
_hash = HashType.MD5; _hash = HashType.MD5;
} }
@@ -250,8 +247,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public Sha1File(DatFile? datFile) public Sha1File(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
_hash = HashType.SHA1; _hash = HashType.SHA1;
} }
@@ -266,8 +262,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public Sha256File(DatFile? datFile) public Sha256File(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
_hash = HashType.SHA256; _hash = HashType.SHA256;
} }
@@ -282,8 +277,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public Sha384File(DatFile? datFile) public Sha384File(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
_hash = HashType.SHA384; _hash = HashType.SHA384;
} }
@@ -298,8 +292,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public Sha512File(DatFile? datFile) public Sha512File(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
_hash = HashType.SHA512; _hash = HashType.SHA512;
} }
@@ -314,8 +307,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public SpamSumFile(DatFile? datFile) public SpamSumFile(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
_hash = HashType.SpamSum; _hash = HashType.SpamSum;
} }

View File

@@ -13,8 +13,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public Listrom(DatFile? datFile) public Listrom(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -181,8 +181,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public Listxml(DatFile? datFile) public Listxml(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -225,8 +225,7 @@ namespace SabreTools.DatFiles.Formats
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
/// <param name="deprecated">True if the output uses "game", false if the output uses "machine"</param> /// <param name="deprecated">True if the output uses "game", false if the output uses "machine"</param>
public Logiqx(DatFile? datFile, bool deprecated) public Logiqx(DatFile? datFile, bool deprecated) : base(datFile)
: base(datFile)
{ {
_deprecated = deprecated; _deprecated = deprecated;
} }
@@ -353,7 +352,7 @@ namespace SabreTools.DatFiles.Formats
// Serialize the input file // Serialize the input file
var metadata = ConvertMetadata(ignoreblanks); var metadata = ConvertMetadata(ignoreblanks);
var datafile = new Serialization.CrossModel.Logiqx().Deserialize(metadata); var datafile = new Serialization.CrossModel.Logiqx().Deserialize(metadata, _deprecated);
// TODO: Reenable doctype writing // TODO: Reenable doctype writing
// Only write the doctype if we don't have No-Intro data // Only write the doctype if we don't have No-Intro data

View File

@@ -16,8 +16,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public Missfile(DatFile? datFile) public Missfile(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -13,8 +13,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public OfflineList(DatFile? datFile) public OfflineList(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -44,8 +44,7 @@ The softwaredb.xml file contains information about rom mapper types
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public OpenMSX(DatFile? datFile) public OpenMSX(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -13,8 +13,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public RomCenter(DatFile? datFile) public RomCenter(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -22,8 +22,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public SabreJSON(DatFile? datFile) public SabreJSON(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -18,8 +18,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public SabreXML(DatFile? datFile) public SabreXML(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }

View File

@@ -17,8 +17,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public SeparatedValue(DatFile? datFile) public SeparatedValue(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }
@@ -126,8 +125,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public CommaSeparatedValue(DatFile? datFile) public CommaSeparatedValue(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
_delim = ','; _delim = ',';
} }
@@ -142,8 +140,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public SemicolonSeparatedValue(DatFile? datFile) public SemicolonSeparatedValue(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
_delim = ';'; _delim = ';';
} }
@@ -158,8 +155,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public TabSeparatedValue(DatFile? datFile) public TabSeparatedValue(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
_delim = '\t'; _delim = '\t';
} }

View File

@@ -75,8 +75,7 @@ namespace SabreTools.DatFiles.Formats
/// Constructor designed for casting a base DatFile /// Constructor designed for casting a base DatFile
/// </summary> /// </summary>
/// <param name="datFile">Parent DatFile to copy from</param> /// <param name="datFile">Parent DatFile to copy from</param>
public SoftwareList(DatFile? datFile) public SoftwareList(DatFile? datFile) : base(datFile)
: base(datFile)
{ {
} }