mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ALL} Preliminary hookup of listxml (nw)
This commit is contained in:
@@ -5737,6 +5737,16 @@ namespace SabreTools.Library.DatFiles
|
||||
outfileNames.Add(DatFormat.DOSCenter, CreateOutfileNamesHelper(outDir, ".dc.dat", overwrite));
|
||||
}
|
||||
|
||||
// Logiqx XML
|
||||
if ((DatFormat & DatFormat.Logiqx) != 0)
|
||||
{
|
||||
outfileNames.Add(DatFormat.Logiqx, CreateOutfileNamesHelper(outDir, ".xml", overwrite));
|
||||
}
|
||||
if ((DatFormat & DatFormat.LogiqxDepreciated) != 0)
|
||||
{
|
||||
outfileNames.Add(DatFormat.LogiqxDepreciated, CreateOutfileNamesHelper(outDir, ".xml", overwrite));
|
||||
}
|
||||
|
||||
// MAME Listroms
|
||||
if ((DatFormat & DatFormat.Listrom) != 0
|
||||
&& (DatFormat & DatFormat.AttractMode) == 0)
|
||||
@@ -5749,14 +5759,22 @@ namespace SabreTools.Library.DatFiles
|
||||
outfileNames.Add(DatFormat.Listrom, CreateOutfileNamesHelper(outDir, ".lr.txt", overwrite));
|
||||
}
|
||||
|
||||
// Logiqx XML
|
||||
if ((DatFormat & DatFormat.Logiqx) != 0)
|
||||
// MAME Listxml
|
||||
if (((DatFormat & DatFormat.Listxml) != 0)
|
||||
&& (DatFormat & DatFormat.Logiqx) == 0
|
||||
&& (DatFormat & DatFormat.LogiqxDepreciated) == 0
|
||||
&& (DatFormat & DatFormat.SabreDat) == 0
|
||||
&& (DatFormat & DatFormat.SoftwareList) == 0)
|
||||
{
|
||||
outfileNames.Add(DatFormat.Logiqx, CreateOutfileNamesHelper(outDir, ".xml", overwrite));
|
||||
outfileNames.Add(DatFormat.Listxml, CreateOutfileNamesHelper(outDir, ".xml", overwrite));
|
||||
}
|
||||
if ((DatFormat & DatFormat.LogiqxDepreciated) != 0)
|
||||
if (((DatFormat & DatFormat.Listxml) != 0
|
||||
&& ((DatFormat & DatFormat.Logiqx) != 0
|
||||
|| (DatFormat & DatFormat.LogiqxDepreciated) != 0
|
||||
|| (DatFormat & DatFormat.SabreDat) != 0
|
||||
|| (DatFormat & DatFormat.SoftwareList) != 0)))
|
||||
{
|
||||
outfileNames.Add(DatFormat.LogiqxDepreciated, CreateOutfileNamesHelper(outDir, ".xml", overwrite));
|
||||
outfileNames.Add(DatFormat.Listxml, CreateOutfileNamesHelper(outDir, ".mame.xml", overwrite));
|
||||
}
|
||||
|
||||
// Missfile
|
||||
@@ -5775,6 +5793,7 @@ namespace SabreTools.Library.DatFiles
|
||||
if (((DatFormat & DatFormat.OfflineList) != 0)
|
||||
&& (DatFormat & DatFormat.Logiqx) == 0
|
||||
&& (DatFormat & DatFormat.LogiqxDepreciated) == 0
|
||||
&& (DatFormat & DatFormat.Listxml) == 0
|
||||
&& (DatFormat & DatFormat.SabreDat) == 0
|
||||
&& (DatFormat & DatFormat.SoftwareList) == 0)
|
||||
{
|
||||
@@ -5783,6 +5802,7 @@ namespace SabreTools.Library.DatFiles
|
||||
if (((DatFormat & DatFormat.OfflineList) != 0
|
||||
&& ((DatFormat & DatFormat.Logiqx) != 0
|
||||
|| (DatFormat & DatFormat.LogiqxDepreciated) != 0
|
||||
|| (DatFormat & DatFormat.Listxml) != 0
|
||||
|| (DatFormat & DatFormat.SabreDat) != 0
|
||||
|| (DatFormat & DatFormat.SoftwareList) != 0)))
|
||||
{
|
||||
|
||||
@@ -194,9 +194,10 @@ namespace SabreTools.Library.Data
|
||||
{
|
||||
// XML Formats
|
||||
Logiqx = 0x01,
|
||||
LogiqxDepreciated = Logiqx << 1,
|
||||
SoftwareList = LogiqxDepreciated << 1, // Special internal type for "game" instead of "machine"
|
||||
OfflineList = SoftwareList << 1,
|
||||
LogiqxDepreciated = Logiqx << 1, // Special internal type for "game" instead of "machine"
|
||||
SoftwareList = LogiqxDepreciated << 1,
|
||||
Listxml = SoftwareList << 1,
|
||||
OfflineList = Listxml << 1,
|
||||
SabreDat = OfflineList << 1,
|
||||
|
||||
// Propietary Formats
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -341,6 +341,9 @@ namespace SabreTools
|
||||
case "output-listrom":
|
||||
datHeader.DatFormat |= DatFormat.Listrom;
|
||||
break;
|
||||
case "output-listxml": // TODO: Not added to help at all
|
||||
datHeader.DatFormat |= DatFormat.Listxml;
|
||||
break;
|
||||
case "output-miss":
|
||||
datHeader.DatFormat |= DatFormat.MissFile;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user