mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Remove commented code
This commit is contained in:
@@ -184,105 +184,6 @@ namespace SabreTools.Helper
|
||||
|
||||
// Now write out to file
|
||||
return WriteToDat(name, description, version, date, category, author, forceunpack, old, outDir, sortable, logger);
|
||||
|
||||
/*
|
||||
// (currently uses current time, change to "last updated time")
|
||||
logger.Log("Opening file for writing: " + outDir + description + (old ? ".dat" : ".xml"));
|
||||
|
||||
try
|
||||
{
|
||||
FileStream fs = File.Create(outDir + description + (old ? ".dat" : ".xml"));
|
||||
StreamWriter sw = new StreamWriter(fs, Encoding.UTF8);
|
||||
|
||||
string header_old = "clrmamepro (\n" +
|
||||
"\tname \"" + HttpUtility.HtmlEncode(name) + "\"\n" +
|
||||
"\tdescription \"" + HttpUtility.HtmlEncode(description) + "\"\n" +
|
||||
"\tcategory \"" + HttpUtility.HtmlEncode(category) + "\"\n" +
|
||||
"\tversion \"" + HttpUtility.HtmlEncode(version) + "\"\n" +
|
||||
"\tdate \"" + HttpUtility.HtmlEncode(date) + "\"\n" +
|
||||
"\tauthor \"" + HttpUtility.HtmlEncode(author) + "\"\n" +
|
||||
(forceunpack ? "\tforcezipping no\n" : "") +
|
||||
")\n";
|
||||
|
||||
string header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
|
||||
"<!DOCTYPE datafile PUBLIC \"-//Logiqx//DTD ROM Management Datafile//EN\" \"http://www.logiqx.com/Dats/datafile.dtd\">\n\n" +
|
||||
"\t<datafile>\n" +
|
||||
"\t\t<header>\n" +
|
||||
"\t\t\t<name>" + HttpUtility.HtmlEncode(name) + "</name>\n" +
|
||||
"\t\t\t<description>" + HttpUtility.HtmlEncode(description) + "</description>\n" +
|
||||
"\t\t\t<category>" + HttpUtility.HtmlEncode(category) + "</category>\n" +
|
||||
"\t\t\t<version>" + HttpUtility.HtmlEncode(version) + "</version>\n" +
|
||||
"\t\t\t<date>" + HttpUtility.HtmlEncode(date) + "</date>\n" +
|
||||
"\t\t\t<author>" + HttpUtility.HtmlEncode(author) + "</author>\n" +
|
||||
(forceunpack ? "\t\t\t<clrmamepro forcepacking=\"unzip\" />\n" : "") +
|
||||
"\t\t</header>\n";
|
||||
|
||||
// Write the header out
|
||||
sw.Write((old ? header_old : header));
|
||||
|
||||
// Write out each of the machines and roms
|
||||
string lastgame = "";
|
||||
foreach (string key in dict.Keys)
|
||||
{
|
||||
foreach (RomData value in dict[key])
|
||||
{
|
||||
string state = "";
|
||||
if (lastgame != "" && lastgame != value.Game)
|
||||
{
|
||||
state += (old ? ")\n" : "\t</machine>\n");
|
||||
}
|
||||
|
||||
if (lastgame != value.Game)
|
||||
{
|
||||
state += (old ? "game (\n\tname \"" + value.Game + "\"\n" +
|
||||
"\tdescription \"" + value.Game + "\"\n" :
|
||||
"\t<machine name=\"" + HttpUtility.HtmlEncode(value.Game) + "\">\n" +
|
||||
"\t\t<description>" + HttpUtility.HtmlEncode(value.Game) + "</description>\n");
|
||||
}
|
||||
|
||||
if (old)
|
||||
{
|
||||
state += "\t" + value.Type + " ( name \"" + value.Name + "\"" +
|
||||
(value.Size != 0 ? " size " + value.Size : "") +
|
||||
(value.CRC != "" ? " crc " + value.CRC.ToLowerInvariant() : "") +
|
||||
(value.MD5 != "" ? " md5 " + value.MD5.ToLowerInvariant() : "") +
|
||||
(value.SHA1 != "" ? " sha1 " + value.SHA1.ToLowerInvariant() : "") +
|
||||
" )\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
state += "\t\t<" + value.Type + " name=\"" + HttpUtility.HtmlEncode(value.Name) + "\"" +
|
||||
(value.Size != -1 ? " size=\"" + value.Size + "\"" : "") +
|
||||
(value.CRC != "" ? " crc=\"" + value.CRC.ToLowerInvariant() + "\"" : "") +
|
||||
(value.MD5 != "" ? " md5=\"" + value.MD5.ToLowerInvariant() + "\"" : "") +
|
||||
(value.SHA1 != "" ? " sha1=\"" + value.SHA1.ToLowerInvariant() + "\"" : "") +
|
||||
"/>\n";
|
||||
}
|
||||
|
||||
lastgame = value.Game;
|
||||
sw.Write(state);
|
||||
|
||||
// If we're in merged mode, only write the first file in each list
|
||||
if (merge)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sw.Write((old ? ")" : "\t</machine>\n</datafile>"));
|
||||
logger.Log("File written!" + Environment.NewLine);
|
||||
sw.Close();
|
||||
fs.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user