[ALL} Preliminary hookup of listxml (nw)

This commit is contained in:
Matt Nadareski
2018-01-15 01:39:23 -08:00
parent 6e7fe07ee6
commit ae2d0fe989
4 changed files with 49 additions and 9 deletions

View File

@@ -619,6 +619,8 @@ namespace SabreTools.Library.Tools
return new DosCenter(baseDat);
case DatFormat.Listrom:
return new Listrom(baseDat);
case DatFormat.Listxml:
return new Listxml(baseDat);
case DatFormat.Logiqx:
return new Logiqx(baseDat, false);
case DatFormat.LogiqxDepreciated:
@@ -1096,7 +1098,15 @@ namespace SabreTools.Library.Tools
// Get the first two lines to check
StreamReader sr = File.OpenText(filename);
string first = sr.ReadLine().ToLowerInvariant();
while (String.IsNullOrWhiteSpace(first))
{
first = sr.ReadLine();
}
string second = sr.ReadLine().ToLowerInvariant();
while (String.IsNullOrWhiteSpace(second))
{
second = sr.ReadLine();
}
sr.Dispose();
// If we have an XML-based DAT
@@ -1106,6 +1116,12 @@ namespace SabreTools.Library.Tools
{
return DatFormat.Logiqx;
}
else if (second.StartsWith("<!DOCTYPE mame")
|| second.StartsWith("<mame")
|| second.StartsWith("<m1"))
{
return DatFormat.Listxml;
}
else if (second.StartsWith("<!doctype softwarelist"))
{
return DatFormat.SoftwareList;