No roms means a reduced footer, if any

This commit is contained in:
Matt Nadareski
2016-05-24 22:55:49 -07:00
parent ed1430831a
commit bd6bda72e5

View File

@@ -476,6 +476,10 @@ namespace SabreTools.Helper
try
{
string footer = "";
// If we have roms, output the full footer
if (datdata.Roms.Count > 0)
{
switch (datdata.OutputFormat)
{
case OutputFormat.ClrMamePro:
@@ -497,6 +501,19 @@ namespace SabreTools.Helper
footer = "\t</machine>\n</datafile>";
break;
}
}
// Otherwise, output the abbreviated form
else
{
switch (datdata.OutputFormat)
{
case OutputFormat.SabreDat:
case OutputFormat.Xml:
footer = "</datafile>";
break;
}
}
// Write the footer out
sw.Write(footer);