mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Minor formatting cleanups in DatFiles
This commit is contained in:
@@ -11,8 +11,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public ArchiveDotOrg(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public ArchiveDotOrg(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public AttractMode(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public AttractMode(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// <summary>
|
||||
/// Get whether to assume quote usage on read and write or not
|
||||
/// </summary>
|
||||
public bool Quotes { get; set; } = true;
|
||||
private readonly bool _quotes;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -25,10 +25,9 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
/// <param name="quotes">Enable quotes on read and write, false otherwise</param>
|
||||
public ClrMamePro(DatFile? datFile, bool quotes)
|
||||
: base(datFile)
|
||||
public ClrMamePro(DatFile? datFile, bool quotes) : base(datFile)
|
||||
{
|
||||
Quotes = quotes;
|
||||
_quotes = quotes;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -37,7 +36,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
try
|
||||
{
|
||||
// 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);
|
||||
|
||||
// Convert to the internal format
|
||||
@@ -180,7 +179,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
// Serialize the input file
|
||||
var metadata = ConvertMetadata(ignoreblanks);
|
||||
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.");
|
||||
return false;
|
||||
|
||||
@@ -13,8 +13,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public DosCenter(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public DosCenter(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public EverdriveSMDB(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public EverdriveSMDB(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Hashfile(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public Hashfile(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -218,8 +217,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public SfvFile(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public SfvFile(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
_hash = HashType.CRC32;
|
||||
}
|
||||
@@ -234,8 +232,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Md5File(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public Md5File(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
_hash = HashType.MD5;
|
||||
}
|
||||
@@ -250,8 +247,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Sha1File(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public Sha1File(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
_hash = HashType.SHA1;
|
||||
}
|
||||
@@ -266,8 +262,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Sha256File(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public Sha256File(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
_hash = HashType.SHA256;
|
||||
}
|
||||
@@ -282,8 +277,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Sha384File(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public Sha384File(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
_hash = HashType.SHA384;
|
||||
}
|
||||
@@ -298,8 +292,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Sha512File(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public Sha512File(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
_hash = HashType.SHA512;
|
||||
}
|
||||
@@ -314,8 +307,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public SpamSumFile(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public SpamSumFile(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
_hash = HashType.SpamSum;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Listrom(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public Listrom(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -181,8 +181,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Listxml(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public Listxml(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -225,8 +225,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// </summary>
|
||||
/// <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>
|
||||
public Logiqx(DatFile? datFile, bool deprecated)
|
||||
: base(datFile)
|
||||
public Logiqx(DatFile? datFile, bool deprecated) : base(datFile)
|
||||
{
|
||||
_deprecated = deprecated;
|
||||
}
|
||||
@@ -353,7 +352,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
|
||||
// Serialize the input file
|
||||
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
|
||||
// Only write the doctype if we don't have No-Intro data
|
||||
|
||||
@@ -16,8 +16,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public Missfile(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public Missfile(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public OfflineList(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public OfflineList(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -44,8 +44,7 @@ The softwaredb.xml file contains information about rom mapper types
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public OpenMSX(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public OpenMSX(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public RomCenter(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public RomCenter(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public SabreJSON(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public SabreJSON(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public SabreXML(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public SabreXML(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public SeparatedValue(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public SeparatedValue(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -126,8 +125,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public CommaSeparatedValue(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public CommaSeparatedValue(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
_delim = ',';
|
||||
}
|
||||
@@ -142,8 +140,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public SemicolonSeparatedValue(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public SemicolonSeparatedValue(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
_delim = ';';
|
||||
}
|
||||
@@ -158,8 +155,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public TabSeparatedValue(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public TabSeparatedValue(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
_delim = '\t';
|
||||
}
|
||||
|
||||
@@ -75,8 +75,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
/// Constructor designed for casting a base DatFile
|
||||
/// </summary>
|
||||
/// <param name="datFile">Parent DatFile to copy from</param>
|
||||
public SoftwareList(DatFile? datFile)
|
||||
: base(datFile)
|
||||
public SoftwareList(DatFile? datFile) : base(datFile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user