Add override method to all required places

This commit is contained in:
Matt Nadareski
2022-11-03 17:02:38 -07:00
parent a6d02d8c9c
commit d35faea5a9
17 changed files with 111 additions and 58 deletions

View File

@@ -511,9 +511,6 @@ namespace SabreTools.DatFiles
/// Return list of required fields missing from a DatItem
/// </summary>
/// <returns>List of missing required fields, null or empty if none were found</returns>
/// <remarks>
/// TODO: Implement this in all relevant DatFile types
/// </remarks>
protected virtual List<DatItemField> GetMissingRequiredFields(DatItem datItem) => null;
/// <summary>

View File

@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -15,9 +15,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of a Archive.org file list
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class ArchiveDotOrg : DatFile
{
/// <summary>
@@ -268,6 +265,13 @@ namespace SabreTools.DatFiles.Formats
};
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using SabreTools.Core;
using SabreTools.DatItems;
using SabreTools.DatItems.Formats;
@@ -14,9 +14,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of an AttractMode DAT
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class AttractMode : DatFile
{
/// <summary>
@@ -115,6 +112,13 @@ namespace SabreTools.DatFiles.Formats
return new ItemType[] { ItemType.Rom };
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -15,9 +15,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of a ClrMamePro DAT
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class ClrMamePro : DatFile
{
#region Fields
@@ -436,6 +433,13 @@ namespace SabreTools.DatFiles.Formats
};
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -17,9 +16,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of a DosCenter DAT
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class DosCenter : DatFile
{
/// <summary>
@@ -262,6 +258,13 @@ namespace SabreTools.DatFiles.Formats
return new ItemType[] { ItemType.Rom };
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -15,9 +15,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of an Everdrive SMDB file
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class EverdriveSMDB : DatFile
{
/// <summary>
@@ -112,6 +109,13 @@ namespace SabreTools.DatFiles.Formats
return new ItemType[] { ItemType.Rom };
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -14,9 +14,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of a MAME Listrom DAT
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class Listrom : DatFile
{
/// <summary>
@@ -261,6 +258,13 @@ namespace SabreTools.DatFiles.Formats
return new ItemType[] { ItemType.Disk, ItemType.Rom };
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -5,7 +5,6 @@ using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -1349,6 +1348,13 @@ namespace SabreTools.DatFiles.Formats
};
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -6,7 +6,6 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Schema;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -18,9 +17,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of a Logiqx-derived DAT
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class Logiqx : DatFile
{
// Private instance variables specific to Logiqx DATs
@@ -776,6 +772,13 @@ namespace SabreTools.DatFiles.Formats
};
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using SabreTools.Core;
using SabreTools.DatItems;
@@ -10,9 +10,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of a Missfile
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class Missfile : DatFile
{
/// <summary>
@@ -31,6 +28,13 @@ namespace SabreTools.DatFiles.Formats
throw new NotImplementedException();
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -4,7 +4,6 @@ using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -16,9 +15,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of an OfflineList XML DAT
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class OfflineList : DatFile
{
/// <summary>
@@ -665,6 +661,13 @@ namespace SabreTools.DatFiles.Formats
return new ItemType[] { ItemType.Rom };
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -4,7 +4,6 @@ using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -16,9 +15,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of a openMSX softawre list XML DAT
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class OpenMSX : DatFile
{
/// <summary>
@@ -538,6 +534,13 @@ namespace SabreTools.DatFiles.Formats
return new ItemType[] { ItemType.Rom };
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -15,9 +14,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of a RomCenter DAT
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class RomCenter : DatFile
{
/// <summary>
@@ -367,6 +363,13 @@ namespace SabreTools.DatFiles.Formats
return new ItemType[] { ItemType.Rom };
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -3,14 +3,13 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
using SabreTools.DatItems.Formats;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
namespace SabreTools.DatFiles.Formats
{

View File

@@ -4,7 +4,6 @@ using System.Text;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using SabreTools.Core;
using SabreTools.DatItems;

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -15,9 +15,6 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// Represents parsing and writing of a value-separated DAT
/// </summary>
/// <remarks>
/// TODO: Check and enforce required fields in output
/// </remarks>
internal class SeparatedValue : DatFile
{
// Private instance variables specific to Separated Value DATs
@@ -98,6 +95,13 @@ namespace SabreTools.DatFiles.Formats
return new ItemType[] { ItemType.Disk, ItemType.Media, ItemType.Rom };
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{

View File

@@ -5,7 +5,6 @@ using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using SabreTools.Core;
using SabreTools.Core.Tools;
using SabreTools.DatItems;
@@ -26,6 +25,9 @@ namespace SabreTools.DatFiles.Formats
/// <summary>
/// DTD for original MAME Software List DATs
/// </summary>
/// <remarks>
/// TODO: See if there's an updated DTD and then check for required fields
/// </remarks>
private const string SoftwareListDTD = @"<!ELEMENT softwarelist (software+)>
<!ATTLIST softwarelist name CDATA #REQUIRED>
<!ATTLIST softwarelist description CDATA #IMPLIED>
@@ -585,6 +587,13 @@ namespace SabreTools.DatFiles.Formats
};
}
/// <inheritdoc/>
protected override List<DatItemField> GetMissingRequiredFields(DatItem datItem)
{
// TODO: Check required fields
return null;
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool ignoreblanks = false, bool throwOnError = false)
{