mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
@@ -87,7 +87,7 @@ namespace SabreTools
|
|||||||
dbc.Open();
|
dbc.Open();
|
||||||
StreamWriter sw = new StreamWriter(File.Open("export.csv", FileMode.Create, FileAccess.Write));
|
StreamWriter sw = new StreamWriter(File.Open("export.csv", FileMode.Create, FileAccess.Write));
|
||||||
|
|
||||||
sw.WriteLine("\"ID\",\"Size\",\"CRC\",\"MD5\",\"SHA-1\",\"In Depot\",\"DAT Hash"");
|
sw.WriteLine("\"ID\",\"Size\",\"CRC\",\"MD5\",\"SHA-1\",\"In Depot\",\"DAT Hash\"");
|
||||||
|
|
||||||
string query = "SELECT dats.id, size, crc, md5, sha1, indepot, hash FROM data JOIN dats ON data.id=dats.id";
|
string query = "SELECT dats.id, size, crc, md5, sha1, indepot, hash FROM data JOIN dats ON data.id=dats.id";
|
||||||
SqliteCommand slc = new SqliteCommand(query, dbc);
|
SqliteCommand slc = new SqliteCommand(query, dbc);
|
||||||
@@ -97,13 +97,13 @@ namespace SabreTools
|
|||||||
{
|
{
|
||||||
while (sldr.Read())
|
while (sldr.Read())
|
||||||
{
|
{
|
||||||
string line = """ + sldr.GetInt32(0) + "\","
|
string line = "\"" + sldr.GetInt32(0) + "\","
|
||||||
+ """ + sldr.GetInt64(1) + "\","
|
+ "\"" + sldr.GetInt64(1) + "\","
|
||||||
+ """ + sldr.GetString(2) + "\","
|
+ "\"" + sldr.GetString(2) + "\","
|
||||||
+ """ + sldr.GetString(3) + "\","
|
+ "\"" + sldr.GetString(3) + "\","
|
||||||
+ """ + sldr.GetString(4) + "\","
|
+ "\"" + sldr.GetString(4) + "\","
|
||||||
+ """ + sldr.GetInt32(5) + "\","
|
+ "\"" + sldr.GetInt32(5) + "\","
|
||||||
+ """ + sldr.GetString(6) + """;
|
+ "\"" + sldr.GetString(6) + "\"";
|
||||||
sw.WriteLine(line);
|
sw.WriteLine(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ namespace SabreTools
|
|||||||
baddir = "bad",
|
baddir = "bad",
|
||||||
dats = "dats",
|
dats = "dats",
|
||||||
db = "db",
|
db = "db",
|
||||||
connectionString = String.Empty;
|
connectionString = "";
|
||||||
Dictionary<string, Tuple<long, bool>> depots = new Dictionary<string, Tuple<long, bool>>();
|
Dictionary<string, Tuple<long, bool>> depots = new Dictionary<string, Tuple<long, bool>>();
|
||||||
|
|
||||||
// Get the XML text reader for the configuration file, if possible
|
// Get the XML text reader for the configuration file, if possible
|
||||||
@@ -210,7 +210,7 @@ namespace SabreTools
|
|||||||
XmlReader subreader = xtr.ReadSubtree();
|
XmlReader subreader = xtr.ReadSubtree();
|
||||||
if (subreader != null)
|
if (subreader != null)
|
||||||
{
|
{
|
||||||
string root = String.Empty;
|
string root = "";
|
||||||
long maxsize = -1;
|
long maxsize = -1;
|
||||||
bool online = true;
|
bool online = true;
|
||||||
|
|
||||||
@@ -459,7 +459,7 @@ namespace SabreTools
|
|||||||
|
|
||||||
foreach (string dathash in unneeded)
|
foreach (string dathash in unneeded)
|
||||||
{
|
{
|
||||||
query = "DELETE FROM dats WHERE hash="" + dathash + """;
|
query = "DELETE FROM dats WHERE hash=\"" + dathash + "\"";
|
||||||
slc = new SqliteCommand(query, dbc);
|
slc = new SqliteCommand(query, dbc);
|
||||||
slc.ExecuteNonQuery();
|
slc.ExecuteNonQuery();
|
||||||
slc.Dispose();
|
slc.Dispose();
|
||||||
@@ -472,7 +472,7 @@ namespace SabreTools
|
|||||||
private static void AddDatToDatabase(Rom dat, SqliteConnection dbc)
|
private static void AddDatToDatabase(Rom dat, SqliteConnection dbc)
|
||||||
{
|
{
|
||||||
// Get the dat full path
|
// Get the dat full path
|
||||||
string fullpath = Path.Combine(_dats, (dat.Machine.Name == "dats" ? String.Empty : dat.Machine.Name), dat.Name);
|
string fullpath = Path.Combine(_dats, (dat.Machine.Name == "dats" ? "" : dat.Machine.Name), dat.Name);
|
||||||
|
|
||||||
// Parse the Dat if possible
|
// Parse the Dat if possible
|
||||||
_logger.User("Adding from '" + dat.Name + "'");
|
_logger.User("Adding from '" + dat.Name + "'");
|
||||||
@@ -502,23 +502,23 @@ namespace SabreTools
|
|||||||
|
|
||||||
if (!String.IsNullOrEmpty(rom.CRC))
|
if (!String.IsNullOrEmpty(rom.CRC))
|
||||||
{
|
{
|
||||||
crcquery += " ("" + rom.CRC + "\"),";
|
crcquery += " (\"" + rom.CRC + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.MD5))
|
if (!String.IsNullOrEmpty(rom.MD5))
|
||||||
{
|
{
|
||||||
md5query += " ("" + rom.MD5 + "\"),";
|
md5query += " (\"" + rom.MD5 + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.SHA1))
|
if (!String.IsNullOrEmpty(rom.SHA1))
|
||||||
{
|
{
|
||||||
sha1query += " ("" + rom.SHA1 + "\"),";
|
sha1query += " (\"" + rom.SHA1 + "\"),";
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(rom.CRC))
|
if (!String.IsNullOrEmpty(rom.CRC))
|
||||||
{
|
{
|
||||||
crcsha1query += " ("" + rom.CRC + "\", "" + rom.SHA1 + "\"),";
|
crcsha1query += " (\"" + rom.CRC + "\", \"" + rom.SHA1 + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.MD5))
|
if (!String.IsNullOrEmpty(rom.MD5))
|
||||||
{
|
{
|
||||||
md5sha1query += " ("" + rom.MD5 + "\", "" + rom.SHA1 + "\"),";
|
md5sha1query += " (\"" + rom.MD5 + "\", \"" + rom.SHA1 + "\"),";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -528,15 +528,15 @@ namespace SabreTools
|
|||||||
|
|
||||||
if (!String.IsNullOrEmpty(disk.MD5))
|
if (!String.IsNullOrEmpty(disk.MD5))
|
||||||
{
|
{
|
||||||
md5query += " ("" + disk.MD5 + "\"),";
|
md5query += " (\"" + disk.MD5 + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(disk.SHA1))
|
if (!String.IsNullOrEmpty(disk.SHA1))
|
||||||
{
|
{
|
||||||
sha1query += " ("" + disk.SHA1 + "\"),";
|
sha1query += " (\"" + disk.SHA1 + "\"),";
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(disk.MD5))
|
if (!String.IsNullOrEmpty(disk.MD5))
|
||||||
{
|
{
|
||||||
md5sha1query += " ("" + disk.MD5 + "\", "" + disk.SHA1 + "\"),";
|
md5sha1query += " (\"" + disk.MD5 + "\", \"" + disk.SHA1 + "\"),";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -571,7 +571,7 @@ namespace SabreTools
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string datquery = "INSERT OR IGNORE INTO dat (hash) VALUES ("" + dat.SHA1 + "\")";
|
string datquery = "INSERT OR IGNORE INTO dat (hash) VALUES (\"" + dat.SHA1 + "\")";
|
||||||
slc = new SqliteCommand(datquery, dbc);
|
slc = new SqliteCommand(datquery, dbc);
|
||||||
slc.ExecuteNonQuery();
|
slc.ExecuteNonQuery();
|
||||||
slc.Dispose();
|
slc.Dispose();
|
||||||
@@ -603,7 +603,7 @@ namespace SabreTools
|
|||||||
|
|
||||||
// If we have it, then check for all hashes that are in that depot
|
// If we have it, then check for all hashes that are in that depot
|
||||||
List<string> hashes = new List<string>();
|
List<string> hashes = new List<string>();
|
||||||
string query = "SELECT sha1 FROM sha1 WHERE depot="" + depotname + """;
|
string query = "SELECT sha1 FROM sha1 WHERE depot=\"" + depotname + "\"";
|
||||||
SqliteCommand slc = new SqliteCommand(query, dbc);
|
SqliteCommand slc = new SqliteCommand(query, dbc);
|
||||||
SqliteDataReader sldr = slc.ExecuteReader();
|
SqliteDataReader sldr = slc.ExecuteReader();
|
||||||
if (sldr.HasRows)
|
if (sldr.HasRows)
|
||||||
@@ -643,23 +643,23 @@ namespace SabreTools
|
|||||||
{
|
{
|
||||||
if (!String.IsNullOrEmpty(rom.CRC))
|
if (!String.IsNullOrEmpty(rom.CRC))
|
||||||
{
|
{
|
||||||
crcquery += " ("" + rom.CRC + "\"),";
|
crcquery += " (\"" + rom.CRC + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.MD5))
|
if (!String.IsNullOrEmpty(rom.MD5))
|
||||||
{
|
{
|
||||||
md5query += " ("" + rom.MD5 + "\"),";
|
md5query += " (\"" + rom.MD5 + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.SHA1))
|
if (!String.IsNullOrEmpty(rom.SHA1))
|
||||||
{
|
{
|
||||||
sha1query += " ("" + rom.SHA1 + "\", "" + depotname + "\"),";
|
sha1query += " (\"" + rom.SHA1 + "\", \"" + depotname + "\"),";
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(rom.CRC))
|
if (!String.IsNullOrEmpty(rom.CRC))
|
||||||
{
|
{
|
||||||
crcsha1query += " ("" + rom.CRC + "\", "" + rom.SHA1 + "\"),";
|
crcsha1query += " (\"" + rom.CRC + "\", \"" + rom.SHA1 + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.MD5))
|
if (!String.IsNullOrEmpty(rom.MD5))
|
||||||
{
|
{
|
||||||
md5sha1query += " ("" + rom.MD5 + "\", "" + rom.SHA1 + "\"),";
|
md5sha1query += " (\"" + rom.MD5 + "\", \"" + rom.SHA1 + "\"),";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -703,7 +703,7 @@ JOIN crc
|
|||||||
ON crcsha1.crc=crc.crc
|
ON crcsha1.crc=crc.crc
|
||||||
JOIN md5
|
JOIN md5
|
||||||
ON md5sha1.md5=md5.md5
|
ON md5sha1.md5=md5.md5
|
||||||
WHERE sha1.sha1 IN (String.Empty" + String.Join("\","", hashes) + "\")";
|
WHERE sha1.sha1 IN (""" + String.Join("\",\"", hashes) + "\")";
|
||||||
slc = new SqliteCommand(query, dbc);
|
slc = new SqliteCommand(query, dbc);
|
||||||
slc.ExecuteNonQuery();
|
slc.ExecuteNonQuery();
|
||||||
|
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ namespace SabreTools
|
|||||||
if (onlyNeeded)
|
if (onlyNeeded)
|
||||||
{
|
{
|
||||||
string query = "SELECT * FROM crcsha1 JOIN md5sha1 ON crcsha1.sha1=md5sha1.sha1"
|
string query = "SELECT * FROM crcsha1 JOIN md5sha1 ON crcsha1.sha1=md5sha1.sha1"
|
||||||
+ " WHERE crcsha1.crc="" + rom.CRC + """
|
+ " WHERE crcsha1.crc=\"" + rom.CRC + "\""
|
||||||
+ " OR md5sha1.md5="" + rom.MD5 + """
|
+ " OR md5sha1.md5=\"" + rom.MD5 + "\""
|
||||||
+ " OR md5sha1.sha1="" + rom.SHA1 + """;
|
+ " OR md5sha1.sha1=\"" + rom.SHA1 + "\"";
|
||||||
SqliteCommand slc = new SqliteCommand(query, dbc);
|
SqliteCommand slc = new SqliteCommand(query, dbc);
|
||||||
SqliteDataReader sldr = slc.ExecuteReader();
|
SqliteDataReader sldr = slc.ExecuteReader();
|
||||||
|
|
||||||
@@ -84,23 +84,23 @@ namespace SabreTools
|
|||||||
// Add to the queries
|
// Add to the queries
|
||||||
if (!String.IsNullOrEmpty(rom.CRC))
|
if (!String.IsNullOrEmpty(rom.CRC))
|
||||||
{
|
{
|
||||||
crcquery += " ("" + rom.CRC + "\"),";
|
crcquery += " (\"" + rom.CRC + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.MD5))
|
if (!String.IsNullOrEmpty(rom.MD5))
|
||||||
{
|
{
|
||||||
md5query += " ("" + rom.MD5 + "\"),";
|
md5query += " (\"" + rom.MD5 + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.SHA1))
|
if (!String.IsNullOrEmpty(rom.SHA1))
|
||||||
{
|
{
|
||||||
sha1query += " ("" + rom.SHA1 + "\", "" + _depots.Keys.ToList()[0] + "\"),";
|
sha1query += " (\"" + rom.SHA1 + "\", \"" + _depots.Keys.ToList()[0] + "\"),";
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(rom.CRC))
|
if (!String.IsNullOrEmpty(rom.CRC))
|
||||||
{
|
{
|
||||||
crcsha1query += " ("" + rom.CRC + "\", "" + rom.SHA1 + "\"),";
|
crcsha1query += " (\"" + rom.CRC + "\", \"" + rom.SHA1 + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.MD5))
|
if (!String.IsNullOrEmpty(rom.MD5))
|
||||||
{
|
{
|
||||||
md5sha1query += " ("" + rom.MD5 + "\", "" + rom.SHA1 + "\"),";
|
md5sha1query += " (\"" + rom.MD5 + "\", \"" + rom.SHA1 + "\"),";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,23 +114,23 @@ namespace SabreTools
|
|||||||
// Add to the queries
|
// Add to the queries
|
||||||
if (!String.IsNullOrEmpty(rom.CRC))
|
if (!String.IsNullOrEmpty(rom.CRC))
|
||||||
{
|
{
|
||||||
crcquery += " ("" + rom.CRC + "\"),";
|
crcquery += " (\"" + rom.CRC + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.MD5))
|
if (!String.IsNullOrEmpty(rom.MD5))
|
||||||
{
|
{
|
||||||
md5query += " ("" + rom.MD5 + "\"),";
|
md5query += " (\"" + rom.MD5 + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.SHA1))
|
if (!String.IsNullOrEmpty(rom.SHA1))
|
||||||
{
|
{
|
||||||
sha1query += " ("" + rom.SHA1 + "\", "" + _depots.Keys.ToList()[0] + "\"),";
|
sha1query += " (\"" + rom.SHA1 + "\", \"" + _depots.Keys.ToList()[0] + "\"),";
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(rom.CRC))
|
if (!String.IsNullOrEmpty(rom.CRC))
|
||||||
{
|
{
|
||||||
crcsha1query += " ("" + rom.CRC + "\", "" + rom.SHA1 + "\"),";
|
crcsha1query += " (\"" + rom.CRC + "\", \"" + rom.SHA1 + "\"),";
|
||||||
}
|
}
|
||||||
if (!String.IsNullOrEmpty(rom.MD5))
|
if (!String.IsNullOrEmpty(rom.MD5))
|
||||||
{
|
{
|
||||||
md5sha1query += " ("" + rom.MD5 + "\", "" + rom.SHA1 + "\"),";
|
md5sha1query += " (\"" + rom.MD5 + "\", \"" + rom.SHA1 + "\"),";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ namespace SabreTools
|
|||||||
datdata.PopulateFromDir(input, false /* noMD5 */, false /* noSHA1 */, true /* bare */, false /* archivesAsFiles */,
|
datdata.PopulateFromDir(input, false /* noMD5 */, false /* noSHA1 */, true /* bare */, false /* archivesAsFiles */,
|
||||||
true /* enableGzip */, false /* addBlanks */, false /* addDate */, _tmpdir /* tempDir */, false /* copyFiles */,
|
true /* enableGzip */, false /* addBlanks */, false /* addDate */, _tmpdir /* tempDir */, false /* copyFiles */,
|
||||||
null /* headerToCheckAgainst */, _workers /* maxDegreeOfParallelism */, _logger);
|
null /* headerToCheckAgainst */, _workers /* maxDegreeOfParallelism */, _logger);
|
||||||
datdata.WriteToFile(String.Empty, logger);
|
datdata.WriteToFile("", logger);
|
||||||
}
|
}
|
||||||
logger.Close();
|
logger.Close();
|
||||||
}
|
}
|
||||||
@@ -287,11 +287,11 @@ namespace SabreTools
|
|||||||
List<string> sha1 = new List<string>();
|
List<string> sha1 = new List<string>();
|
||||||
foreach (string input in inputs)
|
foreach (string input in inputs)
|
||||||
{
|
{
|
||||||
string temp = String.Empty;
|
string temp = "";
|
||||||
if (input.Length == Constants.CRCLength)
|
if (input.Length == Constants.CRCLength)
|
||||||
{
|
{
|
||||||
temp = Style.CleanHashData(input, Constants.CRCLength);
|
temp = Style.CleanHashData(input, Constants.CRCLength);
|
||||||
if (temp != String.Empty)
|
if (temp != "")
|
||||||
{
|
{
|
||||||
crc.Add(temp);
|
crc.Add(temp);
|
||||||
}
|
}
|
||||||
@@ -299,7 +299,7 @@ namespace SabreTools
|
|||||||
else if (input.Length == Constants.MD5Length)
|
else if (input.Length == Constants.MD5Length)
|
||||||
{
|
{
|
||||||
temp = Style.CleanHashData(input, Constants.MD5Length);
|
temp = Style.CleanHashData(input, Constants.MD5Length);
|
||||||
if (temp != String.Empty)
|
if (temp != "")
|
||||||
{
|
{
|
||||||
md5.Add(temp);
|
md5.Add(temp);
|
||||||
}
|
}
|
||||||
@@ -307,7 +307,7 @@ namespace SabreTools
|
|||||||
else if (input.Length == Constants.SHA1Length)
|
else if (input.Length == Constants.SHA1Length)
|
||||||
{
|
{
|
||||||
temp = Style.CleanHashData(input, Constants.SHA1Length);
|
temp = Style.CleanHashData(input, Constants.SHA1Length);
|
||||||
if (temp != String.Empty)
|
if (temp != "")
|
||||||
{
|
{
|
||||||
sha1.Add(temp);
|
sha1.Add(temp);
|
||||||
}
|
}
|
||||||
@@ -320,7 +320,7 @@ namespace SabreTools
|
|||||||
// Now, search for each of them and return true or false for each
|
// Now, search for each of them and return true or false for each
|
||||||
foreach (string input in crc)
|
foreach (string input in crc)
|
||||||
{
|
{
|
||||||
string query = "SELECT * FROM crc WHERE crc="" + input + """;
|
string query = "SELECT * FROM crc WHERE crc=\"" + input + "\"";
|
||||||
SqliteCommand slc = new SqliteCommand(query, dbc);
|
SqliteCommand slc = new SqliteCommand(query, dbc);
|
||||||
SqliteDataReader sldr = slc.ExecuteReader();
|
SqliteDataReader sldr = slc.ExecuteReader();
|
||||||
if (sldr.HasRows)
|
if (sldr.HasRows)
|
||||||
@@ -337,7 +337,7 @@ namespace SabreTools
|
|||||||
}
|
}
|
||||||
foreach (string input in md5)
|
foreach (string input in md5)
|
||||||
{
|
{
|
||||||
string query = "SELECT * FROM md5 WHERE md5="" + input + """;
|
string query = "SELECT * FROM md5 WHERE md5=\"" + input + "\"";
|
||||||
SqliteCommand slc = new SqliteCommand(query, dbc);
|
SqliteCommand slc = new SqliteCommand(query, dbc);
|
||||||
SqliteDataReader sldr = slc.ExecuteReader();
|
SqliteDataReader sldr = slc.ExecuteReader();
|
||||||
if (sldr.HasRows)
|
if (sldr.HasRows)
|
||||||
@@ -354,7 +354,7 @@ namespace SabreTools
|
|||||||
}
|
}
|
||||||
foreach (string input in sha1)
|
foreach (string input in sha1)
|
||||||
{
|
{
|
||||||
string query = "SELECT * FROM sha1 WHERE sha1="" + input + """;
|
string query = "SELECT * FROM sha1 WHERE sha1=\"" + input + "\"";
|
||||||
SqliteCommand slc = new SqliteCommand(query, dbc);
|
SqliteCommand slc = new SqliteCommand(query, dbc);
|
||||||
SqliteDataReader sldr = slc.ExecuteReader();
|
SqliteDataReader sldr = slc.ExecuteReader();
|
||||||
if (sldr.HasRows)
|
if (sldr.HasRows)
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ using System.Runtime.InteropServices;
|
|||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("RombaSharp")]
|
[assembly: AssemblyTitle("RombaSharp")]
|
||||||
[assembly: AssemblyDescription(String.Empty)]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration(String.Empty)]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany(String.Empty)]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("RombaSharp")]
|
[assembly: AssemblyProduct("RombaSharp")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||||
[assembly: AssemblyTrademark(String.Empty)]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture(String.Empty)]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
|||||||
@@ -93,8 +93,8 @@ namespace SabreTools
|
|||||||
onlyNeeded = false;
|
onlyNeeded = false;
|
||||||
|
|
||||||
// User inputs
|
// User inputs
|
||||||
string newdat =String.Empty,
|
string newdat ="",
|
||||||
outdat = String.Empty;
|
outdat = "";
|
||||||
List<string> inputs = new List<string>();
|
List<string> inputs = new List<string>();
|
||||||
|
|
||||||
// Determine which switches are enabled (with values if necessary)
|
// Determine which switches are enabled (with values if necessary)
|
||||||
@@ -178,7 +178,7 @@ namespace SabreTools
|
|||||||
outdat = args[i];
|
outdat = args[i];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
string temparg = args[i].Replace(""", String.Empty).Replace("file://", String.Empty);
|
string temparg = args[i].Replace("\"", "").Replace("file://", "");
|
||||||
|
|
||||||
if (temparg.StartsWith("-") && temparg.Contains("="))
|
if (temparg.StartsWith("-") && temparg.Contains("="))
|
||||||
{
|
{
|
||||||
@@ -186,7 +186,7 @@ namespace SabreTools
|
|||||||
string[] split = temparg.Split('=');
|
string[] split = temparg.Split('=');
|
||||||
if (split[1] == null)
|
if (split[1] == null)
|
||||||
{
|
{
|
||||||
split[1] = String.Empty;
|
split[1] = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (split[0])
|
switch (split[0])
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace SabreTools.Helper.Data
|
|||||||
helptext.Add(barrier);
|
helptext.Add(barrier);
|
||||||
helptext.Add("Credits");
|
helptext.Add("Credits");
|
||||||
helptext.Add(barrier);
|
helptext.Add(barrier);
|
||||||
helptext.Add(String.Empty);
|
helptext.Add("");
|
||||||
helptext.Add("Programmer / Lead: Matt Nadareski (darksabre76)");
|
helptext.Add("Programmer / Lead: Matt Nadareski (darksabre76)");
|
||||||
helptext.Add("Additional code: emuLOAD, @tractivo, motoschifo");
|
helptext.Add("Additional code: emuLOAD, @tractivo, motoschifo");
|
||||||
helptext.Add("Testing: emuLOAD, @tractivo, Kludge, Obiwantje, edc");
|
helptext.Add("Testing: emuLOAD, @tractivo, Kludge, Obiwantje, edc");
|
||||||
@@ -86,7 +86,7 @@ namespace SabreTools.Helper.Data
|
|||||||
helptext.Add(Resources.Resources.RombaSharp_Name + " - " + Resources.Resources.RombaSharp_Desc);
|
helptext.Add(Resources.Resources.RombaSharp_Name + " - " + Resources.Resources.RombaSharp_Desc);
|
||||||
helptext.Add(barrier);
|
helptext.Add(barrier);
|
||||||
helptext.Add(Resources.Resources.Usage + ": " + Resources.Resources.RombaSharp_Name + " [option] [filename|dirname] ...");
|
helptext.Add(Resources.Resources.Usage + ": " + Resources.Resources.RombaSharp_Name + " [option] [filename|dirname] ...");
|
||||||
helptext.Add(String.Empty);
|
helptext.Add("");
|
||||||
helptext.Add("Options:");
|
helptext.Add("Options:");
|
||||||
helptext.Add(" -?, -h, --help Show this help");
|
helptext.Add(" -?, -h, --help Show this help");
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ namespace SabreTools.Helper.Data
|
|||||||
helptext.Add(Resources.Resources.SabreTools_Name + " - " + Resources.Resources.SabreTools_Desc);
|
helptext.Add(Resources.Resources.SabreTools_Name + " - " + Resources.Resources.SabreTools_Desc);
|
||||||
helptext.Add(barrier);
|
helptext.Add(barrier);
|
||||||
helptext.Add(Resources.Resources.Usage + ": " + Resources.Resources.SabreTools_Name + " [option] [filename|dirname] ...");
|
helptext.Add(Resources.Resources.Usage + ": " + Resources.Resources.SabreTools_Name + " [option] [filename|dirname] ...");
|
||||||
helptext.Add(String.Empty);
|
helptext.Add("");
|
||||||
helptext.Add("Options:");
|
helptext.Add("Options:");
|
||||||
helptext.Add(" -?, -h, --help Show this help");
|
helptext.Add(" -?, -h, --help Show this help");
|
||||||
helptext.Add(" --script Enable script mode (no clear screen)");
|
helptext.Add(" --script Enable script mode (no clear screen)");
|
||||||
@@ -384,13 +384,13 @@ namespace SabreTools.Helper.Data
|
|||||||
helptext.Add(" -h=, --header= Set a header skipper to use, blank means all");
|
helptext.Add(" -h=, --header= Set a header skipper to use, blank means all");
|
||||||
|
|
||||||
// Additional Notes
|
// Additional Notes
|
||||||
helptext.Add(String.Empty);
|
helptext.Add("");
|
||||||
helptext.Add("Archive scanning levels:");
|
helptext.Add("Archive scanning levels:");
|
||||||
helptext.Add(" 0 Hash archive and contents");
|
helptext.Add(" 0 Hash archive and contents");
|
||||||
helptext.Add(" 1 Only hash contents");
|
helptext.Add(" 1 Only hash contents");
|
||||||
helptext.Add(" 2 Only hash archive");
|
helptext.Add(" 2 Only hash archive");
|
||||||
|
|
||||||
helptext.Add(String.Empty);
|
helptext.Add("");
|
||||||
helptext.Add("Filter parameters game name, rom name, CRC, MD5, SHA-1 can");
|
helptext.Add("Filter parameters game name, rom name, CRC, MD5, SHA-1 can");
|
||||||
helptext.Add("do partial matches using asterisks as follows (case insensitive):");
|
helptext.Add("do partial matches using asterisks as follows (case insensitive):");
|
||||||
helptext.Add(" *00 means ends with '00'");
|
helptext.Add(" *00 means ends with '00'");
|
||||||
@@ -398,11 +398,11 @@ namespace SabreTools.Helper.Data
|
|||||||
helptext.Add(" *00* means contains '00'");
|
helptext.Add(" *00* means contains '00'");
|
||||||
helptext.Add(" 00 means exactly equals '00'");
|
helptext.Add(" 00 means exactly equals '00'");
|
||||||
|
|
||||||
helptext.Add(String.Empty);
|
helptext.Add("");
|
||||||
helptext.Add("Filter parameters for size can use postfixes for inputs:");
|
helptext.Add("Filter parameters for size can use postfixes for inputs:");
|
||||||
helptext.Add(" e.g. 8kb => 8000 or 8kib => 8192");
|
helptext.Add(" e.g. 8kb => 8000 or 8kib => 8192");
|
||||||
|
|
||||||
helptext.Add(String.Empty);
|
helptext.Add("");
|
||||||
helptext.Add("Most of the filter parameters allow for multiple inputs:");
|
helptext.Add("Most of the filter parameters allow for multiple inputs:");
|
||||||
helptext.Add(" e.g. --game-name=foo --game-name=bar");
|
helptext.Add(" e.g. --game-name=foo --game-name=bar");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Archive()
|
public Archive()
|
||||||
{
|
{
|
||||||
_name = String.Empty;
|
_name = "";
|
||||||
_itemType = ItemType.Archive;
|
_itemType = ItemType.Archive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public BiosSet()
|
public BiosSet()
|
||||||
{
|
{
|
||||||
_name = String.Empty;
|
_name = "";
|
||||||
_itemType = ItemType.BiosSet;
|
_itemType = ItemType.BiosSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the correct dictionary based on what is available
|
// Get the correct dictionary based on what is available
|
||||||
string key = String.Empty;
|
string key = "";
|
||||||
if (_itemType == ItemType.Rom && ((Rom)this).CRC != null)
|
if (_itemType == ItemType.Rom && ((Rom)this).CRC != null)
|
||||||
{
|
{
|
||||||
key = ((Rom)this).CRC;
|
key = ((Rom)this).CRC;
|
||||||
@@ -322,7 +322,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the correct dictionary based on what is available
|
// Get the correct dictionary based on what is available
|
||||||
string key = String.Empty;
|
string key = "";
|
||||||
if (_itemType == ItemType.Rom && ((Rom)this).CRC != null)
|
if (_itemType == ItemType.Rom && ((Rom)this).CRC != null)
|
||||||
{
|
{
|
||||||
key = ((Rom)this).CRC;
|
key = ((Rom)this).CRC;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Disk()
|
public Disk()
|
||||||
{
|
{
|
||||||
_name = String.Empty;
|
_name = "";
|
||||||
_itemType = ItemType.Disk;
|
_itemType = ItemType.Disk;
|
||||||
_dupeType = 0x00;
|
_dupeType = 0x00;
|
||||||
_itemStatus = ItemStatus.None;
|
_itemStatus = ItemStatus.None;
|
||||||
|
|||||||
@@ -188,21 +188,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (crc.StartsWith("*") && crc.EndsWith("*"))
|
if (crc.StartsWith("*") && crc.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.CRC.ToLowerInvariant().Contains(crc.ToLowerInvariant().Replace("*", String.Empty)))
|
if (!rom.CRC.ToLowerInvariant().Contains(crc.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (crc.StartsWith("*"))
|
else if (crc.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.CRC.EndsWith(crc.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!rom.CRC.EndsWith(crc.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (crc.EndsWith("*"))
|
else if (crc.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.CRC.StartsWith(crc.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!rom.CRC.StartsWith(crc.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -230,21 +230,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (crc.StartsWith("*") && crc.EndsWith("*"))
|
if (crc.StartsWith("*") && crc.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.CRC.ToLowerInvariant().Contains(crc.ToLowerInvariant().Replace("*", String.Empty)))
|
if (rom.CRC.ToLowerInvariant().Contains(crc.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (crc.StartsWith("*"))
|
else if (crc.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.CRC.EndsWith(crc.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (rom.CRC.EndsWith(crc.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (crc.EndsWith("*"))
|
else if (crc.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.CRC.StartsWith(crc.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (rom.CRC.StartsWith(crc.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -275,21 +275,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (md5.StartsWith("*") && md5.EndsWith("*"))
|
if (md5.StartsWith("*") && md5.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.MD5.ToLowerInvariant().Contains(md5.ToLowerInvariant().Replace("*", String.Empty)))
|
if (!rom.MD5.ToLowerInvariant().Contains(md5.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (md5.StartsWith("*"))
|
else if (md5.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.MD5.EndsWith(md5.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!rom.MD5.EndsWith(md5.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (md5.EndsWith("*"))
|
else if (md5.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.MD5.StartsWith(md5.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!rom.MD5.StartsWith(md5.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -317,21 +317,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (md5.StartsWith("*") && md5.EndsWith("*"))
|
if (md5.StartsWith("*") && md5.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.MD5.ToLowerInvariant().Contains(md5.ToLowerInvariant().Replace("*", String.Empty)))
|
if (rom.MD5.ToLowerInvariant().Contains(md5.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (md5.StartsWith("*"))
|
else if (md5.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.MD5.EndsWith(md5.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (rom.MD5.EndsWith(md5.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (md5.EndsWith("*"))
|
else if (md5.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.MD5.StartsWith(md5.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (rom.MD5.StartsWith(md5.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -362,21 +362,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (sha1.StartsWith("*") && sha1.EndsWith("*"))
|
if (sha1.StartsWith("*") && sha1.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.SHA1.ToLowerInvariant().Contains(sha1.ToLowerInvariant().Replace("*", String.Empty)))
|
if (!rom.SHA1.ToLowerInvariant().Contains(sha1.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sha1.StartsWith("*"))
|
else if (sha1.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.SHA1.EndsWith(sha1.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!rom.SHA1.EndsWith(sha1.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sha1.EndsWith("*"))
|
else if (sha1.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.SHA1.StartsWith(sha1.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!rom.SHA1.StartsWith(sha1.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -404,21 +404,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (sha1.StartsWith("*") && sha1.EndsWith("*"))
|
if (sha1.StartsWith("*") && sha1.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.SHA1.ToLowerInvariant().Contains(sha1.ToLowerInvariant().Replace("*", String.Empty)))
|
if (rom.SHA1.ToLowerInvariant().Contains(sha1.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sha1.StartsWith("*"))
|
else if (sha1.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.SHA1.EndsWith(sha1.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (rom.SHA1.EndsWith(sha1.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sha1.EndsWith("*"))
|
else if (sha1.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.SHA1.StartsWith(sha1.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (rom.SHA1.StartsWith(sha1.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -463,21 +463,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (md5.StartsWith("*") && md5.EndsWith("*"))
|
if (md5.StartsWith("*") && md5.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.MD5.ToLowerInvariant().Contains(md5.ToLowerInvariant().Replace("*", String.Empty)))
|
if (!rom.MD5.ToLowerInvariant().Contains(md5.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (md5.StartsWith("*"))
|
else if (md5.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.MD5.EndsWith(md5.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!rom.MD5.EndsWith(md5.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (md5.EndsWith("*"))
|
else if (md5.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.MD5.StartsWith(md5.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!rom.MD5.StartsWith(md5.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -505,21 +505,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (md5.StartsWith("*") && md5.EndsWith("*"))
|
if (md5.StartsWith("*") && md5.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.MD5.ToLowerInvariant().Contains(md5.ToLowerInvariant().Replace("*", String.Empty)))
|
if (rom.MD5.ToLowerInvariant().Contains(md5.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (md5.StartsWith("*"))
|
else if (md5.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.MD5.EndsWith(md5.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (rom.MD5.EndsWith(md5.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (md5.EndsWith("*"))
|
else if (md5.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.MD5.StartsWith(md5.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (rom.MD5.StartsWith(md5.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -550,21 +550,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (sha1.StartsWith("*") && sha1.EndsWith("*"))
|
if (sha1.StartsWith("*") && sha1.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.SHA1.ToLowerInvariant().Contains(sha1.ToLowerInvariant().Replace("*", String.Empty)))
|
if (!rom.SHA1.ToLowerInvariant().Contains(sha1.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sha1.StartsWith("*"))
|
else if (sha1.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.SHA1.EndsWith(sha1.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!rom.SHA1.EndsWith(sha1.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sha1.EndsWith("*"))
|
else if (sha1.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!rom.SHA1.StartsWith(sha1.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!rom.SHA1.StartsWith(sha1.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -592,21 +592,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (sha1.StartsWith("*") && sha1.EndsWith("*"))
|
if (sha1.StartsWith("*") && sha1.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.SHA1.ToLowerInvariant().Contains(sha1.ToLowerInvariant().Replace("*", String.Empty)))
|
if (rom.SHA1.ToLowerInvariant().Contains(sha1.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sha1.StartsWith("*"))
|
else if (sha1.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.SHA1.EndsWith(sha1.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (rom.SHA1.EndsWith(sha1.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sha1.EndsWith("*"))
|
else if (sha1.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (rom.SHA1.StartsWith(sha1.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (rom.SHA1.StartsWith(sha1.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -636,21 +636,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (name.StartsWith("*") && name.EndsWith("*"))
|
if (name.StartsWith("*") && name.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!item.Machine.Name.ToLowerInvariant().Contains(name.ToLowerInvariant().Replace("*", String.Empty)))
|
if (!item.Machine.Name.ToLowerInvariant().Contains(name.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (name.StartsWith("*"))
|
else if (name.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (!item.Machine.Name.EndsWith(name.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!item.Machine.Name.EndsWith(name.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (name.EndsWith("*"))
|
else if (name.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!item.Machine.Name.StartsWith(name.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!item.Machine.Name.StartsWith(name.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -677,21 +677,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (name.StartsWith("*") && name.EndsWith("*"))
|
if (name.StartsWith("*") && name.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (item.Machine.Name.ToLowerInvariant().Contains(name.ToLowerInvariant().Replace("*", String.Empty)))
|
if (item.Machine.Name.ToLowerInvariant().Contains(name.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (name.StartsWith("*"))
|
else if (name.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (item.Machine.Name.EndsWith(name.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (item.Machine.Name.EndsWith(name.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (name.EndsWith("*"))
|
else if (name.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (item.Machine.Name.StartsWith(name.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (item.Machine.Name.StartsWith(name.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -720,21 +720,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (name.StartsWith("*") && name.EndsWith("*"))
|
if (name.StartsWith("*") && name.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!item.Name.ToLowerInvariant().Contains(name.ToLowerInvariant().Replace("*", String.Empty)))
|
if (!item.Name.ToLowerInvariant().Contains(name.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (name.StartsWith("*"))
|
else if (name.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (!item.Name.EndsWith(name.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!item.Name.EndsWith(name.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (name.EndsWith("*"))
|
else if (name.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (!item.Name.StartsWith(name.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (!item.Name.StartsWith(name.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
@@ -761,21 +761,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (name.StartsWith("*") && name.EndsWith("*"))
|
if (name.StartsWith("*") && name.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (item.Name.ToLowerInvariant().Contains(name.ToLowerInvariant().Replace("*", String.Empty)))
|
if (item.Name.ToLowerInvariant().Contains(name.ToLowerInvariant().Replace("*", "")))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (name.StartsWith("*"))
|
else if (name.StartsWith("*"))
|
||||||
{
|
{
|
||||||
if (item.Name.EndsWith(name.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (item.Name.EndsWith(name.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (name.EndsWith("*"))
|
else if (name.EndsWith("*"))
|
||||||
{
|
{
|
||||||
if (item.Name.StartsWith(name.Replace("*", String.Empty), StringComparison.InvariantCultureIgnoreCase))
|
if (item.Name.StartsWith(name.Replace("*", ""), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,8 +110,8 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Machine()
|
public Machine()
|
||||||
{
|
{
|
||||||
_name = String.Empty;
|
_name = "";
|
||||||
_description = String.Empty;
|
_description = "";
|
||||||
_runnable = true;
|
_runnable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
||||||
long count = 0;
|
long count = 0;
|
||||||
|
|
||||||
logger.User("Organizing " + (mergeroms ? "and merging " : String.Empty) + "roms by CRC");
|
logger.User("Organizing " + (mergeroms ? "and merging " : "") + "roms by CRC");
|
||||||
|
|
||||||
// Process each all of the roms
|
// Process each all of the roms
|
||||||
List<string> keys = Keys.ToList();
|
List<string> keys = Keys.ToList();
|
||||||
@@ -102,7 +102,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
||||||
long count = 0;
|
long count = 0;
|
||||||
|
|
||||||
logger.User("Organizing " + (mergeroms ? "and merging " : String.Empty) + "roms by game");
|
logger.User("Organizing " + (mergeroms ? "and merging " : "") + "roms by game");
|
||||||
|
|
||||||
// Process each all of the roms
|
// Process each all of the roms
|
||||||
List<string> keys = Keys.ToList();
|
List<string> keys = Keys.ToList();
|
||||||
@@ -120,7 +120,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
foreach (DatItem rom in roms)
|
foreach (DatItem rom in roms)
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
string newkey = (norename ? String.Empty
|
string newkey = (norename ? ""
|
||||||
: rom.SystemID.ToString().PadLeft(10, '0')
|
: rom.SystemID.ToString().PadLeft(10, '0')
|
||||||
+ "-"
|
+ "-"
|
||||||
+ rom.SourceID.ToString().PadLeft(10, '0') + "-")
|
+ rom.SourceID.ToString().PadLeft(10, '0') + "-")
|
||||||
@@ -188,7 +188,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
||||||
long count = 0;
|
long count = 0;
|
||||||
|
|
||||||
logger.User("Organizing " + (mergeroms ? "and merging " : String.Empty) + "roms by MD5");
|
logger.User("Organizing " + (mergeroms ? "and merging " : "") + "roms by MD5");
|
||||||
|
|
||||||
// Process each all of the roms
|
// Process each all of the roms
|
||||||
List<string> keys = Keys.ToList();
|
List<string> keys = Keys.ToList();
|
||||||
@@ -259,7 +259,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
||||||
long count = 0;
|
long count = 0;
|
||||||
|
|
||||||
logger.User("Organizing " + (mergeroms ? "and merging " : String.Empty) + "roms by SHA-1");
|
logger.User("Organizing " + (mergeroms ? "and merging " : "") + "roms by SHA-1");
|
||||||
|
|
||||||
// Process each all of the roms
|
// Process each all of the roms
|
||||||
List<string> keys = Keys.ToList();
|
List<string> keys = Keys.ToList();
|
||||||
@@ -330,7 +330,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
||||||
long count = 0;
|
long count = 0;
|
||||||
|
|
||||||
logger.User("Organizing " + (mergeroms ? "and merging " : String.Empty) + "roms by size");
|
logger.User("Organizing " + (mergeroms ? "and merging " : "") + "roms by size");
|
||||||
|
|
||||||
// Process each all of the roms
|
// Process each all of the roms
|
||||||
List<string> keys = Keys.ToList();
|
List<string> keys = Keys.ToList();
|
||||||
@@ -1083,7 +1083,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// <returns>SortedDictionary bucketed by game name</returns>
|
/// <returns>SortedDictionary bucketed by game name</returns>
|
||||||
public static SortedDictionary<string, List<DatItem>> BucketListByGame(List<DatItem> list, bool mergeroms, bool norename, Logger logger, bool output = true)
|
public static SortedDictionary<string, List<DatItem>> BucketListByGame(List<DatItem> list, bool mergeroms, bool norename, Logger logger, bool output = true)
|
||||||
{
|
{
|
||||||
logger.User("Organizing " + (mergeroms ? "and merging " : String.Empty) + "roms for output");
|
logger.User("Organizing " + (mergeroms ? "and merging " : "") + "roms for output");
|
||||||
|
|
||||||
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
SortedDictionary<string, List<DatItem>> sortable = new SortedDictionary<string, List<DatItem>>();
|
||||||
long count = 0;
|
long count = 0;
|
||||||
@@ -1109,7 +1109,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
string newkey = (norename ? String.Empty
|
string newkey = (norename ? ""
|
||||||
: rom.SystemID.ToString().PadLeft(10, '0')
|
: rom.SystemID.ToString().PadLeft(10, '0')
|
||||||
+ "-"
|
+ "-"
|
||||||
+ rom.SourceID.ToString().PadLeft(10, '0') + "-")
|
+ rom.SourceID.ToString().PadLeft(10, '0') + "-")
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
logger.User("Initializing all output DATs");
|
logger.User("Initializing all output DATs");
|
||||||
|
|
||||||
// Default vars for use
|
// Default vars for use
|
||||||
string post = String.Empty;
|
string post = "";
|
||||||
DatFile outerDiffData = new DatFile();
|
DatFile outerDiffData = new DatFile();
|
||||||
DatFile dupeData = new DatFile();
|
DatFile dupeData = new DatFile();
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// <param name="logger">Logging object for console and file output</param>
|
/// <param name="logger">Logging object for console and file output</param>
|
||||||
public void DiffCascade(string outDir, bool inplace, List<string> inputs, List<DatFile> datHeaders, bool skip, Logger logger)
|
public void DiffCascade(string outDir, bool inplace, List<string> inputs, List<DatFile> datHeaders, bool skip, Logger logger)
|
||||||
{
|
{
|
||||||
string post = String.Empty;
|
string post = "";
|
||||||
|
|
||||||
// Create a list of DatData objects representing output files
|
// Create a list of DatData objects representing output files
|
||||||
List<DatFile> outDats = new List<DatFile>();
|
List<DatFile> outDats = new List<DatFile>();
|
||||||
@@ -381,7 +381,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
for (int j = (skip ? 1 : 0); j < inputs.Count; j++)
|
for (int j = (skip ? 1 : 0); j < inputs.Count; j++)
|
||||||
{
|
{
|
||||||
// If we have an output directory set, replace the path
|
// If we have an output directory set, replace the path
|
||||||
string path = String.Empty;
|
string path = "";
|
||||||
if (inplace)
|
if (inplace)
|
||||||
{
|
{
|
||||||
path = Path.GetDirectoryName(inputs[j].Split('¬')[0]);
|
path = Path.GetDirectoryName(inputs[j].Split('¬')[0]);
|
||||||
@@ -425,7 +425,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
string filename = inputs[newrom.SystemID].Split('¬')[0];
|
string filename = inputs[newrom.SystemID].Split('¬')[0];
|
||||||
string rootpath = inputs[newrom.SystemID].Split('¬')[1];
|
string rootpath = inputs[newrom.SystemID].Split('¬')[1];
|
||||||
|
|
||||||
rootpath += (rootpath == String.Empty ? String.Empty : Path.DirectorySeparatorChar.ToString());
|
rootpath += (rootpath == "" ? "" : Path.DirectorySeparatorChar.ToString());
|
||||||
filename = filename.Remove(0, rootpath.Length);
|
filename = filename.Remove(0, rootpath.Length);
|
||||||
newrom.Machine.Name = Path.GetDirectoryName(filename) + Path.DirectorySeparatorChar
|
newrom.Machine.Name = Path.GetDirectoryName(filename) + Path.DirectorySeparatorChar
|
||||||
+ Path.GetFileNameWithoutExtension(filename) + Path.DirectorySeparatorChar
|
+ Path.GetFileNameWithoutExtension(filename) + Path.DirectorySeparatorChar
|
||||||
@@ -470,7 +470,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
inputFileName =>
|
inputFileName =>
|
||||||
{
|
{
|
||||||
// Clean the input string
|
// Clean the input string
|
||||||
if (inputFileName != String.Empty)
|
if (inputFileName != "")
|
||||||
{
|
{
|
||||||
inputFileName = Path.GetFullPath(inputFileName);
|
inputFileName = Path.GetFullPath(inputFileName);
|
||||||
}
|
}
|
||||||
@@ -478,7 +478,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
if (File.Exists(inputFileName))
|
if (File.Exists(inputFileName))
|
||||||
{
|
{
|
||||||
DatFile innerDatdata = new DatFile(this);
|
DatFile innerDatdata = new DatFile(this);
|
||||||
logger.User("Processing "" + Path.GetFileName(inputFileName) + """);
|
logger.User("Processing \"" + Path.GetFileName(inputFileName) + "\"");
|
||||||
innerDatdata.Parse(inputFileName, 0, 0, filter, splitType, trim, single,
|
innerDatdata.Parse(inputFileName, 0, 0, filter, splitType, trim, single,
|
||||||
root, logger, true, clean, softlist,
|
root, logger, true, clean, softlist,
|
||||||
keepext: ((innerDatdata.DatFormat & DatFormat.TSV) != 0 || (innerDatdata.DatFormat & DatFormat.CSV) != 0));
|
keepext: ((innerDatdata.DatFormat & DatFormat.TSV) != 0 || (innerDatdata.DatFormat & DatFormat.CSV) != 0));
|
||||||
@@ -486,7 +486,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
// If we have roms, output them
|
// If we have roms, output them
|
||||||
if (innerDatdata.Count != 0)
|
if (innerDatdata.Count != 0)
|
||||||
{
|
{
|
||||||
innerDatdata.WriteToFile((outDir == String.Empty ? Path.GetDirectoryName(inputFileName) : outDir), logger, overwrite: (outDir != String.Empty));
|
innerDatdata.WriteToFile((outDir == "" ? Path.GetDirectoryName(inputFileName) : outDir), logger, overwrite: (outDir != ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Directory.Exists(inputFileName))
|
else if (Directory.Exists(inputFileName))
|
||||||
@@ -497,7 +497,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism },
|
new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism },
|
||||||
file =>
|
file =>
|
||||||
{
|
{
|
||||||
logger.User("Processing "" + Path.GetFullPath(file).Remove(0, inputFileName.Length) + """);
|
logger.User("Processing \"" + Path.GetFullPath(file).Remove(0, inputFileName.Length) + "\"");
|
||||||
DatFile innerDatdata = new DatFile(this);
|
DatFile innerDatdata = new DatFile(this);
|
||||||
innerDatdata.Parse(file, 0, 0, filter, splitType,
|
innerDatdata.Parse(file, 0, 0, filter, splitType,
|
||||||
trim, single, root, logger, true, clean, softlist,
|
trim, single, root, logger, true, clean, softlist,
|
||||||
@@ -506,7 +506,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
// If we have roms, output them
|
// If we have roms, output them
|
||||||
if (innerDatdata.Count > 0)
|
if (innerDatdata.Count > 0)
|
||||||
{
|
{
|
||||||
innerDatdata.WriteToFile((outDir == String.Empty ? Path.GetDirectoryName(file) : outDir + Path.GetDirectoryName(file).Remove(0, inputFileName.Length - 1)), logger, overwrite: (outDir != String.Empty));
|
innerDatdata.WriteToFile((outDir == "" ? Path.GetDirectoryName(file) : outDir + Path.GetDirectoryName(file).Remove(0, inputFileName.Length - 1)), logger, overwrite: (outDir != ""));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,14 +52,14 @@ namespace SabreTools.Helper.Dats
|
|||||||
// If the name is defined but not the description, set the description from the name
|
// If the name is defined but not the description, set the description from the name
|
||||||
else if (!String.IsNullOrEmpty(Name) && String.IsNullOrEmpty(Description))
|
else if (!String.IsNullOrEmpty(Name) && String.IsNullOrEmpty(Description))
|
||||||
{
|
{
|
||||||
Description = Name + (bare ? String.Empty : " (" + Date + ")");
|
Description = Name + (bare ? "" : " (" + Date + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
// If neither the name or description are defined, set them from the automatic values
|
// If neither the name or description are defined, set them from the automatic values
|
||||||
else if (String.IsNullOrEmpty(Name) && String.IsNullOrEmpty(Description))
|
else if (String.IsNullOrEmpty(Name) && String.IsNullOrEmpty(Description))
|
||||||
{
|
{
|
||||||
Name = basePath.Split(Path.DirectorySeparatorChar).Last();
|
Name = basePath.Split(Path.DirectorySeparatorChar).Last();
|
||||||
Description = Name + (bare ? String.Empty : " (" + Date + ")");
|
Description = Name + (bare ? "" : " (" + Date + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process the input
|
// Process the input
|
||||||
@@ -107,8 +107,8 @@ namespace SabreTools.Helper.Dats
|
|||||||
string fulldir = Path.GetFullPath(dir);
|
string fulldir = Path.GetFullPath(dir);
|
||||||
|
|
||||||
// Set the temporary variables
|
// Set the temporary variables
|
||||||
string gamename = String.Empty;
|
string gamename = "";
|
||||||
string romname = String.Empty;
|
string romname = "";
|
||||||
|
|
||||||
// If we have a SuperDAT, we want anything that's not the base path as the game, and the file as the rom
|
// If we have a SuperDAT, we want anything that's not the base path as the game, and the file as the rom
|
||||||
if (Type == "SuperDAT")
|
if (Type == "SuperDAT")
|
||||||
@@ -249,7 +249,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
// Otherwise, just get the info on the file itself
|
// Otherwise, just get the info on the file itself
|
||||||
else if (File.Exists(newItem))
|
else if (File.Exists(newItem))
|
||||||
{
|
{
|
||||||
PopulateFromDirProcessFile(newItem, String.Empty, newBasePath, noMD5, noSHA1, addDate, headerToCheckAgainst, logger);
|
PopulateFromDirProcessFile(newItem, "", newBasePath, noMD5, noSHA1, addDate, headerToCheckAgainst, logger);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Otherwise, attempt to extract the files to the temporary directory
|
// Otherwise, attempt to extract the files to the temporary directory
|
||||||
@@ -274,7 +274,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
PopulateFromDirProcessFile(entry,
|
PopulateFromDirProcessFile(entry,
|
||||||
Path.Combine((Type == "SuperDAT"
|
Path.Combine((Type == "SuperDAT"
|
||||||
? (Path.GetDirectoryName(Path.GetFullPath(item)) + Path.DirectorySeparatorChar).Remove(0, basePath.Length)
|
? (Path.GetDirectoryName(Path.GetFullPath(item)) + Path.DirectorySeparatorChar).Remove(0, basePath.Length)
|
||||||
: String.Empty),
|
: ""),
|
||||||
Path.GetFileNameWithoutExtension(item)),
|
Path.GetFileNameWithoutExtension(item)),
|
||||||
tempSubDir,
|
tempSubDir,
|
||||||
noMD5,
|
noMD5,
|
||||||
@@ -287,7 +287,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
// Otherwise, just get the info on the file itself
|
// Otherwise, just get the info on the file itself
|
||||||
else if (File.Exists(newItem))
|
else if (File.Exists(newItem))
|
||||||
{
|
{
|
||||||
PopulateFromDirProcessFile(newItem, String.Empty, newBasePath, noMD5, noSHA1, addDate, headerToCheckAgainst, logger);
|
PopulateFromDirProcessFile(newItem, "", newBasePath, noMD5, noSHA1, addDate, headerToCheckAgainst, logger);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,7 +342,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string key = String.Empty;
|
string key = "";
|
||||||
if (datItem.Type == ItemType.Rom)
|
if (datItem.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
key = ((Rom)datItem).Size + "-" + ((Rom)datItem).CRC;
|
key = ((Rom)datItem).Size + "-" + ((Rom)datItem).CRC;
|
||||||
@@ -367,11 +367,11 @@ namespace SabreTools.Helper.Dats
|
|||||||
item = Path.GetFullPath(item);
|
item = Path.GetFullPath(item);
|
||||||
|
|
||||||
// Get the data to be added as game and item names
|
// Get the data to be added as game and item names
|
||||||
string gamename = String.Empty;
|
string gamename = "";
|
||||||
string romname = String.Empty;
|
string romname = "";
|
||||||
|
|
||||||
// If the parent is blank, then we have a non-archive file
|
// If the parent is blank, then we have a non-archive file
|
||||||
if (parent == String.Empty)
|
if (parent == "")
|
||||||
{
|
{
|
||||||
// If we have a SuperDAT, we want anything that's not the base path as the game, and the file as the rom
|
// If we have a SuperDAT, we want anything that's not the base path as the game, and the file as the rom
|
||||||
if (Type == "SuperDAT")
|
if (Type == "SuperDAT")
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// <param name="keepext">True if original extension should be kept, false otherwise (default)</param>
|
/// <param name="keepext">True if original extension should be kept, false otherwise (default)</param>
|
||||||
public void Parse(string filename, int sysid, int srcid, Logger logger, bool keep = false, bool clean = false, bool softlist = false, bool keepext = false)
|
public void Parse(string filename, int sysid, int srcid, Logger logger, bool keep = false, bool clean = false, bool softlist = false, bool keepext = false)
|
||||||
{
|
{
|
||||||
Parse(filename, sysid, srcid, new Filter(), SplitType.None, false, false, String.Empty, logger, keep, clean, softlist, keepext);
|
Parse(filename, sysid, srcid, new Filter(), SplitType.None, false, false, "", logger, keep, clean, softlist, keepext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -229,7 +229,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Now process and add the rom
|
// Now process and add the rom
|
||||||
string key = String.Empty;
|
string key = "";
|
||||||
ParseAddHelper(rom, filter, trim, single, root, clean, logger, out key);
|
ParseAddHelper(rom, filter, trim, single, root, clean, logger, out key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,8 +273,8 @@ namespace SabreTools.Helper.Dats
|
|||||||
StreamReader sr = new StreamReader(File.OpenRead(filename), enc);
|
StreamReader sr = new StreamReader(File.OpenRead(filename), enc);
|
||||||
|
|
||||||
bool block = false, superdat = false;
|
bool block = false, superdat = false;
|
||||||
string blockname = String.Empty, tempgamename = String.Empty, gamedesc = String.Empty, cloneof = String.Empty,
|
string blockname = "", tempgamename = "", gamedesc = "", cloneof = "",
|
||||||
romof = String.Empty, sampleof = String.Empty, year = String.Empty, manufacturer = String.Empty;
|
romof = "", sampleof = "", year = "", manufacturer = "";
|
||||||
while (!sr.EndOfStream)
|
while (!sr.EndOfStream)
|
||||||
{
|
{
|
||||||
string line = sr.ReadLine();
|
string line = sr.ReadLine();
|
||||||
@@ -364,16 +364,16 @@ namespace SabreTools.Helper.Dats
|
|||||||
item.SourceID = srcid;
|
item.SourceID = srcid;
|
||||||
|
|
||||||
// Get the blank key to write to
|
// Get the blank key to write to
|
||||||
string key = String.Empty;
|
string key = "";
|
||||||
|
|
||||||
// If we have a sample, treat it special
|
// If we have a sample, treat it special
|
||||||
if (temptype == ItemType.Sample)
|
if (temptype == ItemType.Sample)
|
||||||
{
|
{
|
||||||
line = line.Trim().Remove(0, 6).Trim().Replace(""", String.Empty); // Remove "sample" from the input string
|
line = line.Trim().Remove(0, 6).Trim().Replace("\"", ""); // Remove "sample" from the input string
|
||||||
item.Name = line;
|
item.Name = line;
|
||||||
|
|
||||||
// Now process and add the sample
|
// Now process and add the sample
|
||||||
key = String.Empty;
|
key = "";
|
||||||
ParseAddHelper(item, filter, trim, single, root, clean, logger, out key);
|
ParseAddHelper(item, filter, trim, single, root, clean, logger, out key);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -421,7 +421,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
else if (gc[i] == "date")
|
else if (gc[i] == "date")
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
((Rom)item).Date = gc[i].Replace(""", String.Empty) + " " + gc[i + 1].Replace(""", String.Empty);
|
((Rom)item).Date = gc[i].Replace("\"", "") + " " + gc[i + 1].Replace("\"", "");
|
||||||
i += 3;
|
i += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -429,12 +429,12 @@ namespace SabreTools.Helper.Dats
|
|||||||
else if (gc[i] == "crc")
|
else if (gc[i] == "crc")
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
((Rom)item).CRC = gc[i].Replace(""", String.Empty).ToLowerInvariant();
|
((Rom)item).CRC = gc[i].Replace("\"", "").ToLowerInvariant();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now process and add the rom
|
// Now process and add the rom
|
||||||
key = String.Empty;
|
key = "";
|
||||||
ParseAddHelper(item, filter, trim, single, root, clean, logger, out key);
|
ParseAddHelper(item, filter, trim, single, root, clean, logger, out key);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -443,11 +443,11 @@ namespace SabreTools.Helper.Dats
|
|||||||
for (int i = 0; i < gc.Length; i++)
|
for (int i = 0; i < gc.Length; i++)
|
||||||
{
|
{
|
||||||
// Look at the current item and use it if possible
|
// Look at the current item and use it if possible
|
||||||
string quoteless = gc[i].Replace(""", String.Empty);
|
string quoteless = gc[i].Replace("\"", "");
|
||||||
switch (quoteless)
|
switch (quoteless)
|
||||||
{
|
{
|
||||||
//If the item is empty, we automatically skip it because it's a fluke
|
//If the item is empty, we automatically skip it because it's a fluke
|
||||||
case String.Empty:
|
case "":
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Special cases for standalone item statuses
|
// Special cases for standalone item statuses
|
||||||
@@ -495,14 +495,14 @@ namespace SabreTools.Helper.Dats
|
|||||||
// Regular attributes
|
// Regular attributes
|
||||||
case "name":
|
case "name":
|
||||||
i++;
|
i++;
|
||||||
quoteless = gc[i].Replace(""", String.Empty);
|
quoteless = gc[i].Replace("\"", "");
|
||||||
item.Name = quoteless;
|
item.Name = quoteless;
|
||||||
break;
|
break;
|
||||||
case "size":
|
case "size":
|
||||||
if (item.Type == ItemType.Rom)
|
if (item.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
quoteless = gc[i].Replace(""", String.Empty);
|
quoteless = gc[i].Replace("\"", "");
|
||||||
long size = -1;
|
long size = -1;
|
||||||
if (Int64.TryParse(quoteless, out size))
|
if (Int64.TryParse(quoteless, out size))
|
||||||
{
|
{
|
||||||
@@ -515,7 +515,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
if (item.Type == ItemType.Rom)
|
if (item.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
quoteless = gc[i].Replace(""", String.Empty);
|
quoteless = gc[i].Replace("\"", "");
|
||||||
((Rom)item).CRC = quoteless.ToLowerInvariant();
|
((Rom)item).CRC = quoteless.ToLowerInvariant();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -523,13 +523,13 @@ namespace SabreTools.Helper.Dats
|
|||||||
if (item.Type == ItemType.Rom)
|
if (item.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
quoteless = gc[i].Replace(""", String.Empty);
|
quoteless = gc[i].Replace("\"", "");
|
||||||
((Rom)item).MD5 = quoteless.ToLowerInvariant();
|
((Rom)item).MD5 = quoteless.ToLowerInvariant();
|
||||||
}
|
}
|
||||||
else if (item.Type == ItemType.Disk)
|
else if (item.Type == ItemType.Disk)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
quoteless = gc[i].Replace(""", String.Empty);
|
quoteless = gc[i].Replace("\"", "");
|
||||||
((Disk)item).MD5 = quoteless.ToLowerInvariant();
|
((Disk)item).MD5 = quoteless.ToLowerInvariant();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -537,20 +537,20 @@ namespace SabreTools.Helper.Dats
|
|||||||
if (item.Type == ItemType.Rom)
|
if (item.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
quoteless = gc[i].Replace(""", String.Empty);
|
quoteless = gc[i].Replace("\"", "");
|
||||||
((Rom)item).SHA1 = quoteless.ToLowerInvariant();
|
((Rom)item).SHA1 = quoteless.ToLowerInvariant();
|
||||||
}
|
}
|
||||||
else if (item.Type == ItemType.Disk)
|
else if (item.Type == ItemType.Disk)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
quoteless = gc[i].Replace(""", String.Empty);
|
quoteless = gc[i].Replace("\"", "");
|
||||||
((Disk)item).SHA1 = quoteless.ToLowerInvariant();
|
((Disk)item).SHA1 = quoteless.ToLowerInvariant();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "status":
|
case "status":
|
||||||
case "flags":
|
case "flags":
|
||||||
i++;
|
i++;
|
||||||
quoteless = gc[i].Replace(""", String.Empty);
|
quoteless = gc[i].Replace("\"", "");
|
||||||
if (quoteless.ToLowerInvariant() == "good")
|
if (quoteless.ToLowerInvariant() == "good")
|
||||||
{
|
{
|
||||||
if (item.Type == ItemType.Rom)
|
if (item.Type == ItemType.Rom)
|
||||||
@@ -600,7 +600,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
if (item.Type == ItemType.Rom)
|
if (item.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
quoteless = gc[i].Replace(""", String.Empty) + " " + gc[i + 1].Replace(""", String.Empty);
|
quoteless = gc[i].Replace("\"", "") + " " + gc[i + 1].Replace("\"", "");
|
||||||
((Rom)item).Date = quoteless;
|
((Rom)item).Date = quoteless;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
@@ -609,7 +609,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now process and add the rom
|
// Now process and add the rom
|
||||||
key = String.Empty;
|
key = "";
|
||||||
ParseAddHelper(item, filter, trim, single, root, clean, logger, out key);
|
ParseAddHelper(item, filter, trim, single, root, clean, logger, out key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -620,7 +620,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
|
|
||||||
if (blockname != "header")
|
if (blockname != "header")
|
||||||
{
|
{
|
||||||
string itemval = gc[2].Value.Replace(""", String.Empty);
|
string itemval = gc[2].Value.Replace("\"", "");
|
||||||
switch (gc[1].Value)
|
switch (gc[1].Value)
|
||||||
{
|
{
|
||||||
case "name":
|
case "name":
|
||||||
@@ -648,7 +648,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string itemval = gc[2].Value.Replace(""", String.Empty);
|
string itemval = gc[2].Value.Replace("\"", "");
|
||||||
|
|
||||||
if (line.Trim().StartsWith("Name:"))
|
if (line.Trim().StartsWith("Name:"))
|
||||||
{
|
{
|
||||||
@@ -768,8 +768,8 @@ namespace SabreTools.Helper.Dats
|
|||||||
else if (Regex.IsMatch(line, Constants.EndPatternCMP) && block)
|
else if (Regex.IsMatch(line, Constants.EndPatternCMP) && block)
|
||||||
{
|
{
|
||||||
block = false;
|
block = false;
|
||||||
blockname = String.Empty; tempgamename = String.Empty; gamedesc = String.Empty; cloneof = String.Empty;
|
blockname = ""; tempgamename = ""; gamedesc = ""; cloneof = "";
|
||||||
romof = String.Empty; sampleof = String.Empty; year = String.Empty; manufacturer = String.Empty;
|
romof = ""; sampleof = ""; year = ""; manufacturer = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -813,7 +813,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
// Prepare all internal variables
|
// Prepare all internal variables
|
||||||
XmlReader subreader, headreader, flagreader;
|
XmlReader subreader, headreader, flagreader;
|
||||||
bool superdat = false, empty = true;
|
bool superdat = false, empty = true;
|
||||||
string key = String.Empty, date = String.Empty;
|
string key = "", date = "";
|
||||||
long size = -1;
|
long size = -1;
|
||||||
ItemStatus its = ItemStatus.None;
|
ItemStatus its = ItemStatus.None;
|
||||||
List<string> parent = new List<string>();
|
List<string> parent = new List<string>();
|
||||||
@@ -970,7 +970,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get all header items (ONLY OVERWRITE IF THERE'S NO DATA)
|
// Get all header items (ONLY OVERWRITE IF THERE'S NO DATA)
|
||||||
string content = String.Empty;
|
string content = "";
|
||||||
switch (headreader.Name.ToLowerInvariant())
|
switch (headreader.Name.ToLowerInvariant())
|
||||||
{
|
{
|
||||||
case "datname":
|
case "datname":
|
||||||
@@ -1015,7 +1015,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get all header items (ONLY OVERWRITE IF THERE'S NO DATA)
|
// Get all header items (ONLY OVERWRITE IF THERE'S NO DATA)
|
||||||
string content = String.Empty;
|
string content = "";
|
||||||
switch (headreader.Name)
|
switch (headreader.Name)
|
||||||
{
|
{
|
||||||
case "name":
|
case "name":
|
||||||
@@ -1236,7 +1236,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
case "machine":
|
case "machine":
|
||||||
case "game":
|
case "game":
|
||||||
case "software":
|
case "software":
|
||||||
string temptype = xtr.Name, publisher = String.Empty, partname = String.Empty, partinterface = String.Empty, areaname = String.Empty;
|
string temptype = xtr.Name, publisher = "", partname = "", partinterface = "", areaname = "";
|
||||||
bool? supported = null;
|
bool? supported = null;
|
||||||
long? areasize = null;
|
long? areasize = null;
|
||||||
List<Tuple<string, string>> infos = new List<Tuple<string, string>>();
|
List<Tuple<string, string>> infos = new List<Tuple<string, string>>();
|
||||||
@@ -1264,9 +1264,9 @@ namespace SabreTools.Helper.Dats
|
|||||||
Name = xtr.GetAttribute("name"),
|
Name = xtr.GetAttribute("name"),
|
||||||
Description = xtr.GetAttribute("name"),
|
Description = xtr.GetAttribute("name"),
|
||||||
|
|
||||||
RomOf = xtr.GetAttribute("romof") ?? String.Empty,
|
RomOf = xtr.GetAttribute("romof") ?? "",
|
||||||
CloneOf = xtr.GetAttribute("cloneof") ?? String.Empty,
|
CloneOf = xtr.GetAttribute("cloneof") ?? "",
|
||||||
SampleOf = xtr.GetAttribute("sampleof") ?? String.Empty,
|
SampleOf = xtr.GetAttribute("sampleof") ?? "",
|
||||||
|
|
||||||
Devices = new List<string>(),
|
Devices = new List<string>(),
|
||||||
MachineType =
|
MachineType =
|
||||||
@@ -1294,7 +1294,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
if (superdat && !keep)
|
if (superdat && !keep)
|
||||||
{
|
{
|
||||||
string tempout = Regex.Match(machine.Name, @".*?\\(.*)").Groups[1].Value;
|
string tempout = Regex.Match(machine.Name, @".*?\\(.*)").Groups[1].Value;
|
||||||
if (tempout != String.Empty)
|
if (tempout != "")
|
||||||
{
|
{
|
||||||
machine.Name = tempout;
|
machine.Name = tempout;
|
||||||
}
|
}
|
||||||
@@ -1306,8 +1306,8 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Special offline list parts
|
// Special offline list parts
|
||||||
string ext = String.Empty;
|
string ext = "";
|
||||||
string releaseNumber = String.Empty;
|
string releaseNumber = "";
|
||||||
|
|
||||||
while (software || !subreader.EOF)
|
while (software || !subreader.EOF)
|
||||||
{
|
{
|
||||||
@@ -1318,13 +1318,13 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
if (subreader.NodeType == XmlNodeType.EndElement && subreader.Name == "part")
|
if (subreader.NodeType == XmlNodeType.EndElement && subreader.Name == "part")
|
||||||
{
|
{
|
||||||
partname = String.Empty;
|
partname = "";
|
||||||
partinterface = String.Empty;
|
partinterface = "";
|
||||||
features = new List<Tuple<string, string>>();
|
features = new List<Tuple<string, string>>();
|
||||||
}
|
}
|
||||||
if (subreader.NodeType == XmlNodeType.EndElement && (subreader.Name == "dataarea" || subreader.Name == "diskarea"))
|
if (subreader.NodeType == XmlNodeType.EndElement && (subreader.Name == "dataarea" || subreader.Name == "diskarea"))
|
||||||
{
|
{
|
||||||
areaname = String.Empty;
|
areaname = "";
|
||||||
areasize = null;
|
areasize = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1351,7 +1351,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
case "romCRC":
|
case "romCRC":
|
||||||
empty = false;
|
empty = false;
|
||||||
|
|
||||||
ext = (subreader.GetAttribute("extension") != null ? subreader.GetAttribute("extension") : String.Empty);
|
ext = (subreader.GetAttribute("extension") != null ? subreader.GetAttribute("extension") : "");
|
||||||
|
|
||||||
DatItem olrom = new Rom
|
DatItem olrom = new Rom
|
||||||
{
|
{
|
||||||
@@ -1418,7 +1418,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
machine.Description = subreader.ReadElementContentAsString();
|
machine.Description = subreader.ReadElementContentAsString();
|
||||||
if (!softlist && temptype == "software")
|
if (!softlist && temptype == "software")
|
||||||
{
|
{
|
||||||
machine.Name = machine.Description.Replace('/', '_').Replace(""", "''");
|
machine.Name = machine.Description.Replace('/', '_').Replace("\"", "''");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "year":
|
case "year":
|
||||||
@@ -1580,13 +1580,13 @@ namespace SabreTools.Helper.Dats
|
|||||||
if (subreader.GetAttribute("flags") == "baddump" || subreader.GetAttribute("status") == "baddump")
|
if (subreader.GetAttribute("flags") == "baddump" || subreader.GetAttribute("status") == "baddump")
|
||||||
{
|
{
|
||||||
logger.Verbose("Bad dump detected: " +
|
logger.Verbose("Bad dump detected: " +
|
||||||
(subreader.GetAttribute("name") != null && subreader.GetAttribute("name") != String.Empty ? """ + xtr.GetAttribute("name") + """ : "ROM NAME NOT FOUND"));
|
(subreader.GetAttribute("name") != null && subreader.GetAttribute("name") != "" ? "\"" + xtr.GetAttribute("name") + "\"" : "ROM NAME NOT FOUND"));
|
||||||
its = ItemStatus.BadDump;
|
its = ItemStatus.BadDump;
|
||||||
}
|
}
|
||||||
if (subreader.GetAttribute("flags") == "nodump" || subreader.GetAttribute("status") == "nodump")
|
if (subreader.GetAttribute("flags") == "nodump" || subreader.GetAttribute("status") == "nodump")
|
||||||
{
|
{
|
||||||
logger.Verbose("Nodump detected: " +
|
logger.Verbose("Nodump detected: " +
|
||||||
(subreader.GetAttribute("name") != null && subreader.GetAttribute("name") != String.Empty ? """ + xtr.GetAttribute("name") + """ : "ROM NAME NOT FOUND"));
|
(subreader.GetAttribute("name") != null && subreader.GetAttribute("name") != "" ? "\"" + xtr.GetAttribute("name") + "\"" : "ROM NAME NOT FOUND"));
|
||||||
its = ItemStatus.Nodump;
|
its = ItemStatus.Nodump;
|
||||||
}
|
}
|
||||||
if (subreader.GetAttribute("flags") == "verified" || subreader.GetAttribute("status") == "verified")
|
if (subreader.GetAttribute("flags") == "verified" || subreader.GetAttribute("status") == "verified")
|
||||||
@@ -1595,7 +1595,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the rom has a Date attached, read it in and then sanitize it
|
// If the rom has a Date attached, read it in and then sanitize it
|
||||||
date = String.Empty;
|
date = "";
|
||||||
if (subreader.GetAttribute("date") != null)
|
if (subreader.GetAttribute("date") != null)
|
||||||
{
|
{
|
||||||
DateTime dateTime = DateTime.Now;
|
DateTime dateTime = DateTime.Now;
|
||||||
@@ -1717,11 +1717,11 @@ namespace SabreTools.Helper.Dats
|
|||||||
superdat = true;
|
superdat = true;
|
||||||
if (keep)
|
if (keep)
|
||||||
{
|
{
|
||||||
Type = (Type == String.Empty ? "SuperDAT" : Type);
|
Type = (Type == "" ? "SuperDAT" : Type);
|
||||||
}
|
}
|
||||||
|
|
||||||
string foldername = (xtr.GetAttribute("name") == null ? String.Empty : xtr.GetAttribute("name"));
|
string foldername = (xtr.GetAttribute("name") == null ? "" : xtr.GetAttribute("name"));
|
||||||
if (foldername != String.Empty)
|
if (foldername != "")
|
||||||
{
|
{
|
||||||
parent.Add(foldername);
|
parent.Add(foldername);
|
||||||
}
|
}
|
||||||
@@ -1764,13 +1764,13 @@ namespace SabreTools.Helper.Dats
|
|||||||
its = ItemStatus.Good;
|
its = ItemStatus.Good;
|
||||||
break;
|
break;
|
||||||
case "baddump":
|
case "baddump":
|
||||||
logger.Verbose("Bad dump detected: " + (xtr.GetAttribute("name") != null && xtr.GetAttribute("name") != String.Empty ?
|
logger.Verbose("Bad dump detected: " + (xtr.GetAttribute("name") != null && xtr.GetAttribute("name") != "" ?
|
||||||
""" + xtr.GetAttribute("name") + """ : "ROM NAME NOT FOUND"));
|
"\"" + xtr.GetAttribute("name") + "\"" : "ROM NAME NOT FOUND"));
|
||||||
its = ItemStatus.BadDump;
|
its = ItemStatus.BadDump;
|
||||||
break;
|
break;
|
||||||
case "nodump":
|
case "nodump":
|
||||||
logger.Verbose("Nodump detected: " + (xtr.GetAttribute("name") != null && xtr.GetAttribute("name") != String.Empty ?
|
logger.Verbose("Nodump detected: " + (xtr.GetAttribute("name") != null && xtr.GetAttribute("name") != "" ?
|
||||||
""" + xtr.GetAttribute("name") + """ : "ROM NAME NOT FOUND"));
|
"\"" + xtr.GetAttribute("name") + "\"" : "ROM NAME NOT FOUND"));
|
||||||
its = ItemStatus.Nodump;
|
its = ItemStatus.Nodump;
|
||||||
break;
|
break;
|
||||||
case "verified":
|
case "verified":
|
||||||
@@ -1785,7 +1785,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the rom has a Date attached, read it in and then sanitize it
|
// If the rom has a Date attached, read it in and then sanitize it
|
||||||
date = String.Empty;
|
date = "";
|
||||||
if (xtr.GetAttribute("date") != null)
|
if (xtr.GetAttribute("date") != null)
|
||||||
{
|
{
|
||||||
date = DateTime.Parse(xtr.GetAttribute("date")).ToString();
|
date = DateTime.Parse(xtr.GetAttribute("date")).ToString();
|
||||||
@@ -1826,7 +1826,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
if (!keep || !superdat)
|
if (!keep || !superdat)
|
||||||
{
|
{
|
||||||
string tempout = Regex.Match(dir.Name, @".*?\\(.*)").Groups[1].Value;
|
string tempout = Regex.Match(dir.Name, @".*?\\(.*)").Groups[1].Value;
|
||||||
if (tempout != String.Empty)
|
if (tempout != "")
|
||||||
{
|
{
|
||||||
dir.Name = tempout;
|
dir.Name = tempout;
|
||||||
}
|
}
|
||||||
@@ -1948,7 +1948,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Now process and add the rom
|
// Now process and add the rom
|
||||||
string key = String.Empty;
|
string key = "";
|
||||||
ParseAddHelper(rom, filter, trim, single, root, clean, logger, out key);
|
ParseAddHelper(rom, filter, trim, single, root, clean, logger, out key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2010,7 +2010,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Now process and add the rom
|
// Now process and add the rom
|
||||||
string key = String.Empty;
|
string key = "";
|
||||||
ParseAddHelper(rom, filter, trim, single, root, clean, logger, out key);
|
ParseAddHelper(rom, filter, trim, single, root, clean, logger, out key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2072,7 +2072,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Now process and add the rom
|
// Now process and add the rom
|
||||||
string key = String.Empty;
|
string key = "";
|
||||||
ParseAddHelper(rom, filter, trim, single, root, clean, logger, out key);
|
ParseAddHelper(rom, filter, trim, single, root, clean, logger, out key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2113,7 +2113,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
Encoding enc = Style.GetEncoding(filename);
|
Encoding enc = Style.GetEncoding(filename);
|
||||||
StreamReader sr = new StreamReader(File.OpenRead(filename), enc);
|
StreamReader sr = new StreamReader(File.OpenRead(filename), enc);
|
||||||
|
|
||||||
string blocktype = String.Empty;
|
string blocktype = "";
|
||||||
while (!sr.EndOfStream)
|
while (!sr.EndOfStream)
|
||||||
{
|
{
|
||||||
string line = sr.ReadLine();
|
string line = sr.ReadLine();
|
||||||
@@ -2204,7 +2204,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
// Some old RC DATs have this behavior
|
// Some old RC DATs have this behavior
|
||||||
if (line.Contains("¬N¬O"))
|
if (line.Contains("¬N¬O"))
|
||||||
{
|
{
|
||||||
line = line.Replace("¬N¬O", String.Empty) + "¬¬";
|
line = line.Replace("¬N¬O", "") + "¬¬";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2248,7 +2248,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Now process and add the rom
|
// Now process and add the rom
|
||||||
string key = String.Empty;
|
string key = "";
|
||||||
ParseAddHelper(rom, filter, trim, single, root, clean, logger, out key);
|
ParseAddHelper(rom, filter, trim, single, root, clean, logger, out key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2268,7 +2268,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// <param name="logger">Logger object for console and/or file output</param>
|
/// <param name="logger">Logger object for console and/or file output</param>
|
||||||
private void ParseAddHelper(DatItem item, Filter filter, bool trim, bool single, string root, bool clean, Logger logger, out string key)
|
private void ParseAddHelper(DatItem item, Filter filter, bool trim, bool single, string root, bool clean, Logger logger, out string key)
|
||||||
{
|
{
|
||||||
key = String.Empty;
|
key = "";
|
||||||
|
|
||||||
// If there's no name in the rom, we log and skip it
|
// If there's no name in the rom, we log and skip it
|
||||||
if (item.Name == null)
|
if (item.Name == null)
|
||||||
@@ -2304,7 +2304,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
// If the file has no size and it's not the above case, skip and log
|
// If the file has no size and it's not the above case, skip and log
|
||||||
else if (itemRom.ItemStatus != ItemStatus.Nodump && (itemRom.Size == 0 || itemRom.Size == -1))
|
else if (itemRom.ItemStatus != ItemStatus.Nodump && (itemRom.Size == 0 || itemRom.Size == -1))
|
||||||
{
|
{
|
||||||
logger.Verbose("Incomplete entry for "" + itemRom.Name + "\" will be output as nodump");
|
logger.Verbose("Incomplete entry for \"" + itemRom.Name + "\" will be output as nodump");
|
||||||
itemRom.ItemStatus = ItemStatus.Nodump;
|
itemRom.ItemStatus = ItemStatus.Nodump;
|
||||||
}
|
}
|
||||||
// If the file has a size but aboslutely no hashes, skip and log
|
// If the file has a size but aboslutely no hashes, skip and log
|
||||||
@@ -2314,7 +2314,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
&& String.IsNullOrEmpty(itemRom.MD5)
|
&& String.IsNullOrEmpty(itemRom.MD5)
|
||||||
&& String.IsNullOrEmpty(itemRom.SHA1))
|
&& String.IsNullOrEmpty(itemRom.SHA1))
|
||||||
{
|
{
|
||||||
logger.Verbose("Incomplete entry for "" + itemRom.Name + "\" will be output as nodump");
|
logger.Verbose("Incomplete entry for \"" + itemRom.Name + "\" will be output as nodump");
|
||||||
itemRom.ItemStatus = ItemStatus.Nodump;
|
itemRom.ItemStatus = ItemStatus.Nodump;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2333,7 +2333,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
&& String.IsNullOrEmpty(itemDisk.MD5)
|
&& String.IsNullOrEmpty(itemDisk.MD5)
|
||||||
&& String.IsNullOrEmpty(itemDisk.SHA1))
|
&& String.IsNullOrEmpty(itemDisk.SHA1))
|
||||||
{
|
{
|
||||||
logger.Verbose("Incomplete entry for "" + itemDisk.Name + "\" will be output as nodump");
|
logger.Verbose("Incomplete entry for \"" + itemDisk.Name + "\" will be output as nodump");
|
||||||
itemDisk.ItemStatus = ItemStatus.Nodump;
|
itemDisk.ItemStatus = ItemStatus.Nodump;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -655,7 +655,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
// Now output the fixdat to the main folder
|
// Now output the fixdat to the main folder
|
||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
matched.WriteToFile(String.Empty, logger, stats: true);
|
matched.WriteToFile("", logger, stats: true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the output directory
|
// Get the output directory
|
||||||
if (outDir != String.Empty)
|
if (outDir != "")
|
||||||
{
|
{
|
||||||
outDir = outDir + Path.GetDirectoryName(this.FileName).Remove(0, basepath.Length - 1);
|
outDir = outDir + Path.GetDirectoryName(this.FileName).Remove(0, basepath.Length - 1);
|
||||||
}
|
}
|
||||||
@@ -287,7 +287,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the output directory
|
// Get the output directory
|
||||||
if (outDir != String.Empty)
|
if (outDir != "")
|
||||||
{
|
{
|
||||||
outDir = outDir + Path.GetDirectoryName(this.FileName).Remove(0, basepath.Length - 1);
|
outDir = outDir + Path.GetDirectoryName(this.FileName).Remove(0, basepath.Length - 1);
|
||||||
}
|
}
|
||||||
@@ -535,7 +535,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the output directory
|
// Get the output directory
|
||||||
if (outDir != String.Empty)
|
if (outDir != "")
|
||||||
{
|
{
|
||||||
outDir = outDir + Path.GetDirectoryName(this.FileName).Remove(0, basepath.Length - 1);
|
outDir = outDir + Path.GetDirectoryName(this.FileName).Remove(0, basepath.Length - 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
logger.User(results);
|
logger.User(results);
|
||||||
|
|
||||||
// Now write it out to file as well
|
// Now write it out to file as well
|
||||||
string line = String.Empty;
|
string line = "";
|
||||||
if (outputs.ContainsKey(StatDatFormat.None))
|
if (outputs.ContainsKey(StatDatFormat.None))
|
||||||
{
|
{
|
||||||
line = @"'" + FileName + @"':
|
line = @"'" + FileName + @"':
|
||||||
@@ -158,22 +158,22 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
if (outputs.ContainsKey(StatDatFormat.CSV))
|
if (outputs.ContainsKey(StatDatFormat.CSV))
|
||||||
{
|
{
|
||||||
line = """ + FileName + "\","
|
line = "\"" + FileName + "\","
|
||||||
+ """ + TotalSize + "\","
|
+ "\"" + TotalSize + "\","
|
||||||
+ """ + (game == -1 ? Count : game) + "\","
|
+ "\"" + (game == -1 ? Count : game) + "\","
|
||||||
+ """ + RomCount + "\","
|
+ "\"" + RomCount + "\","
|
||||||
+ """ + DiskCount + "\","
|
+ "\"" + DiskCount + "\","
|
||||||
+ """ + CRCCount + "\","
|
+ "\"" + CRCCount + "\","
|
||||||
+ """ + MD5Count + "\","
|
+ "\"" + MD5Count + "\","
|
||||||
+ """ + SHA1Count + """;
|
+ "\"" + SHA1Count + "\"";
|
||||||
|
|
||||||
if (baddumpCol)
|
if (baddumpCol)
|
||||||
{
|
{
|
||||||
line += ","" + BaddumpCount + """;
|
line += ",\"" + BaddumpCount + "\"";
|
||||||
}
|
}
|
||||||
if (nodumpCol)
|
if (nodumpCol)
|
||||||
{
|
{
|
||||||
line += ","" + NodumpCount + """;
|
line += ",\"" + NodumpCount + "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
line += "\n";
|
line += "\n";
|
||||||
@@ -206,22 +206,22 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
if (outputs.ContainsKey(StatDatFormat.TSV))
|
if (outputs.ContainsKey(StatDatFormat.TSV))
|
||||||
{
|
{
|
||||||
line = """ + FileName + "\"\t"
|
line = "\"" + FileName + "\"\t"
|
||||||
+ """ + TotalSize + "\"\t"
|
+ "\"" + TotalSize + "\"\t"
|
||||||
+ """ + (game == -1 ? Count : game) + "\"\t"
|
+ "\"" + (game == -1 ? Count : game) + "\"\t"
|
||||||
+ """ + RomCount + "\"\t"
|
+ "\"" + RomCount + "\"\t"
|
||||||
+ """ + DiskCount + "\"\t"
|
+ "\"" + DiskCount + "\"\t"
|
||||||
+ """ + CRCCount + "\"\t"
|
+ "\"" + CRCCount + "\"\t"
|
||||||
+ """ + MD5Count + "\"\t"
|
+ "\"" + MD5Count + "\"\t"
|
||||||
+ """ + SHA1Count + """;
|
+ "\"" + SHA1Count + "\"";
|
||||||
|
|
||||||
if (baddumpCol)
|
if (baddumpCol)
|
||||||
{
|
{
|
||||||
line += "\t"" + BaddumpCount + """;
|
line += "\t\"" + BaddumpCount + "\"";
|
||||||
}
|
}
|
||||||
if (nodumpCol)
|
if (nodumpCol)
|
||||||
{
|
{
|
||||||
line += "\t"" + NodumpCount + """;
|
line += "\t\"" + NodumpCount + "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
line += "\n";
|
line += "\n";
|
||||||
@@ -530,8 +530,8 @@ Please check the log folder if the stats scrolled offscreen", false);
|
|||||||
}
|
}
|
||||||
if (outputs.ContainsKey(StatDatFormat.CSV))
|
if (outputs.ContainsKey(StatDatFormat.CSV))
|
||||||
{
|
{
|
||||||
outputs[StatDatFormat.CSV].Write("\"File Name\",\"Total Size\",\"Games\",\"Roms\",\"Disks\",\"# with CRC\",\"# with MD5\",\"# with SHA-1""
|
outputs[StatDatFormat.CSV].Write("\"File Name\",\"Total Size\",\"Games\",\"Roms\",\"Disks\",\"# with CRC\",\"# with MD5\",\"# with SHA-1\""
|
||||||
+ (baddumpCol ? ",\"BadDumps"" : String.Empty) + (nodumpCol ? ",\"Nodumps"" : String.Empty) + "\n");
|
+ (baddumpCol ? ",\"BadDumps\"" : "") + (nodumpCol ? ",\"Nodumps\"" : "") + "\n");
|
||||||
}
|
}
|
||||||
if (outputs.ContainsKey(StatDatFormat.HTML))
|
if (outputs.ContainsKey(StatDatFormat.HTML))
|
||||||
{
|
{
|
||||||
@@ -553,13 +553,13 @@ Please check the log folder if the stats scrolled offscreen", false);
|
|||||||
</header>
|
</header>
|
||||||
<body>
|
<body>
|
||||||
<h2>DAT Statistics Report (" + DateTime.Now.ToShortDateString() + @")</h2>
|
<h2>DAT Statistics Report (" + DateTime.Now.ToShortDateString() + @")</h2>
|
||||||
<table border=String.Empty1String.Empty cellpadding=String.Empty5String.Empty cellspacing=String.Empty0String.Empty>
|
<table border=""1"" cellpadding=""5"" cellspacing=""0"">
|
||||||
");
|
");
|
||||||
}
|
}
|
||||||
if (outputs.ContainsKey(StatDatFormat.TSV))
|
if (outputs.ContainsKey(StatDatFormat.TSV))
|
||||||
{
|
{
|
||||||
outputs[StatDatFormat.TSV].Write("\"File Name\"\t\"Total Size\"\t\"Games\"\t\"Roms\"\t\"Disks\"\t\"# with CRC\"\t\"# with MD5\"\t\"# with SHA-1""
|
outputs[StatDatFormat.TSV].Write("\"File Name\"\t\"Total Size\"\t\"Games\"\t\"Roms\"\t\"Disks\"\t\"# with CRC\"\t\"# with MD5\"\t\"# with SHA-1\""
|
||||||
+ (baddumpCol ? "\t\"BadDumps"" : String.Empty) + (nodumpCol ? "\t\"Nodumps"" : String.Empty) + "\n");
|
+ (baddumpCol ? "\t\"BadDumps\"" : "") + (nodumpCol ? "\t\"Nodumps\"" : "") + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now write the mid header for those who need it
|
// Now write the mid header for those who need it
|
||||||
@@ -585,9 +585,9 @@ Please check the log folder if the stats scrolled offscreen", false);
|
|||||||
}
|
}
|
||||||
if (outputs.ContainsKey(StatDatFormat.HTML))
|
if (outputs.ContainsKey(StatDatFormat.HTML))
|
||||||
{
|
{
|
||||||
outputs[StatDatFormat.HTML].Write(@" <tr bgcolor=String.EmptygrayString.Empty><th>File Name</th><th align=String.EmptyrightString.Empty>Total Size</th><th align=String.EmptyrightString.Empty>Games</th><th align=String.EmptyrightString.Empty>Roms</th>"
|
outputs[StatDatFormat.HTML].Write(@" <tr bgcolor=""gray""><th>File Name</th><th align=""right"">Total Size</th><th align=""right"">Games</th><th align=""right"">Roms</th>"
|
||||||
+ @"<th align=String.EmptyrightString.Empty>Disks</th><th align=String.EmptyrightString.Empty># with CRC</th><th align=String.EmptyrightString.Empty># with MD5</th><th align=String.EmptyrightString.Empty># with SHA-1</th>"
|
+ @"<th align=""right"">Disks</th><th align=""right""># with CRC</th><th align=""right""># with MD5</th><th align=""right""># with SHA-1</th>"
|
||||||
+ (baddumpCol ? "<th class=\".right\">Baddumps</th>" : String.Empty) + (nodumpCol ? "<th class=\".right\">Nodumps</th>" : String.Empty) + "</tr>\n");
|
+ (baddumpCol ? "<th class=\".right\">Baddumps</th>" : "") + (nodumpCol ? "<th class=\".right\">Nodumps</th>" : "") + "</tr>\n");
|
||||||
}
|
}
|
||||||
if (outputs.ContainsKey(StatDatFormat.TSV))
|
if (outputs.ContainsKey(StatDatFormat.TSV))
|
||||||
{
|
{
|
||||||
@@ -614,7 +614,7 @@ Please check the log folder if the stats scrolled offscreen", false);
|
|||||||
}
|
}
|
||||||
if (outputs.ContainsKey(StatDatFormat.HTML))
|
if (outputs.ContainsKey(StatDatFormat.HTML))
|
||||||
{
|
{
|
||||||
outputs[StatDatFormat.HTML].Write("<tr><td colspan=""
|
outputs[StatDatFormat.HTML].Write("<tr><td colspan=\""
|
||||||
+ (baddumpCol && nodumpCol
|
+ (baddumpCol && nodumpCol
|
||||||
? "11"
|
? "11"
|
||||||
: (baddumpCol ^ nodumpCol
|
: (baddumpCol ^ nodumpCol
|
||||||
@@ -648,7 +648,7 @@ Please check the log folder if the stats scrolled offscreen", false);
|
|||||||
}
|
}
|
||||||
if (outputs.ContainsKey(StatDatFormat.HTML))
|
if (outputs.ContainsKey(StatDatFormat.HTML))
|
||||||
{
|
{
|
||||||
outputs[StatDatFormat.HTML].Write("<tr border=\"0\"><td colspan=""
|
outputs[StatDatFormat.HTML].Write("<tr border=\"0\"><td colspan=\""
|
||||||
+ (baddumpCol && nodumpCol
|
+ (baddumpCol && nodumpCol
|
||||||
? "11"
|
? "11"
|
||||||
: (baddumpCol ^ nodumpCol
|
: (baddumpCol ^ nodumpCol
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If output directory is empty, use the current folder
|
// If output directory is empty, use the current folder
|
||||||
if (outDir.Trim() == String.Empty)
|
if (outDir.Trim() == "")
|
||||||
{
|
{
|
||||||
logger.Verbose("No output directory defined, defaulting to curent folder");
|
logger.Verbose("No output directory defined, defaulting to curent folder");
|
||||||
outDir = Environment.CurrentDirectory;
|
outDir = Environment.CurrentDirectory;
|
||||||
@@ -233,7 +233,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string header = String.Empty;
|
string header = "";
|
||||||
switch (datFormat)
|
switch (datFormat)
|
||||||
{
|
{
|
||||||
case DatFormat.AttractMode:
|
case DatFormat.AttractMode:
|
||||||
@@ -243,18 +243,18 @@ namespace SabreTools.Helper.Dats
|
|||||||
header = "clrmamepro (\n" +
|
header = "clrmamepro (\n" +
|
||||||
"\tname \"" + Name + "\"\n" +
|
"\tname \"" + Name + "\"\n" +
|
||||||
"\tdescription \"" + Description + "\"\n" +
|
"\tdescription \"" + Description + "\"\n" +
|
||||||
(!String.IsNullOrEmpty(Category) ? "\tcategory \"" + Category + "\"\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Category) ? "\tcategory \"" + Category + "\"\n" : "") +
|
||||||
"\tversion \"" + Version + "\"\n" +
|
"\tversion \"" + Version + "\"\n" +
|
||||||
(!String.IsNullOrEmpty(Date) ? "\tdate \"" + Date + "\"\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Date) ? "\tdate \"" + Date + "\"\n" : "") +
|
||||||
"\tauthor \"" + Author + "\"\n" +
|
"\tauthor \"" + Author + "\"\n" +
|
||||||
(!String.IsNullOrEmpty(Email) ? "\temail \"" + Email + "\"\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Email) ? "\temail \"" + Email + "\"\n" : "") +
|
||||||
(!String.IsNullOrEmpty(Homepage) ? "\thomepage \"" + Homepage + "\"\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Homepage) ? "\thomepage \"" + Homepage + "\"\n" : "") +
|
||||||
(!String.IsNullOrEmpty(Url) ? "\turl \"" + Url + "\"\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Url) ? "\turl \"" + Url + "\"\n" : "") +
|
||||||
(!String.IsNullOrEmpty(Comment) ? "\tcomment \"" + Comment + "\"\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Comment) ? "\tcomment \"" + Comment + "\"\n" : "") +
|
||||||
(ForcePacking == ForcePacking.Unzip ? "\tforcezipping no\n" : String.Empty) +
|
(ForcePacking == ForcePacking.Unzip ? "\tforcezipping no\n" : "") +
|
||||||
(ForcePacking == ForcePacking.Zip ? "\tforcezipping yes\n" : String.Empty) +
|
(ForcePacking == ForcePacking.Zip ? "\tforcezipping yes\n" : "") +
|
||||||
(ForceMerging == ForceMerging.Full ? "\tforcemerging full\n" : String.Empty) +
|
(ForceMerging == ForceMerging.Full ? "\tforcemerging full\n" : "") +
|
||||||
(ForceMerging == ForceMerging.Split ? "\tforcemerging split\n" : String.Empty) +
|
(ForceMerging == ForceMerging.Split ? "\tforcemerging split\n" : "") +
|
||||||
")\n";
|
")\n";
|
||||||
break;
|
break;
|
||||||
case DatFormat.CSV:
|
case DatFormat.CSV:
|
||||||
@@ -279,27 +279,27 @@ namespace SabreTools.Helper.Dats
|
|||||||
"\t<header>\n" +
|
"\t<header>\n" +
|
||||||
"\t\t<name>" + HttpUtility.HtmlEncode(Name) + "</name>\n" +
|
"\t\t<name>" + HttpUtility.HtmlEncode(Name) + "</name>\n" +
|
||||||
"\t\t<description>" + HttpUtility.HtmlEncode(Description) + "</description>\n" +
|
"\t\t<description>" + HttpUtility.HtmlEncode(Description) + "</description>\n" +
|
||||||
(!String.IsNullOrEmpty(RootDir) ? "\t\t<rootdir>" + HttpUtility.HtmlEncode(RootDir) + "</rootdir>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(RootDir) ? "\t\t<rootdir>" + HttpUtility.HtmlEncode(RootDir) + "</rootdir>\n" : "") +
|
||||||
(!String.IsNullOrEmpty(Category) ? "\t\t<category>" + HttpUtility.HtmlEncode(Category) + "</category>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Category) ? "\t\t<category>" + HttpUtility.HtmlEncode(Category) + "</category>\n" : "") +
|
||||||
"\t\t<version>" + HttpUtility.HtmlEncode(Version) + "</version>\n" +
|
"\t\t<version>" + HttpUtility.HtmlEncode(Version) + "</version>\n" +
|
||||||
(!String.IsNullOrEmpty(Date) ? "\t\t<date>" + HttpUtility.HtmlEncode(Date) + "</date>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Date) ? "\t\t<date>" + HttpUtility.HtmlEncode(Date) + "</date>\n" : "") +
|
||||||
"\t\t<author>" + HttpUtility.HtmlEncode(Author) + "</author>\n" +
|
"\t\t<author>" + HttpUtility.HtmlEncode(Author) + "</author>\n" +
|
||||||
(!String.IsNullOrEmpty(Email) ? "\t\t<email>" + HttpUtility.HtmlEncode(Email) + "</email>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Email) ? "\t\t<email>" + HttpUtility.HtmlEncode(Email) + "</email>\n" : "") +
|
||||||
(!String.IsNullOrEmpty(Homepage) ? "\t\t<homepage>" + HttpUtility.HtmlEncode(Homepage) + "</homepage>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Homepage) ? "\t\t<homepage>" + HttpUtility.HtmlEncode(Homepage) + "</homepage>\n" : "") +
|
||||||
(!String.IsNullOrEmpty(Url) ? "\t\t<url>" + HttpUtility.HtmlEncode(Url) + "</url>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Url) ? "\t\t<url>" + HttpUtility.HtmlEncode(Url) + "</url>\n" : "") +
|
||||||
(!String.IsNullOrEmpty(Comment) ? "\t\t<comment>" + HttpUtility.HtmlEncode(Comment) + "</comment>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Comment) ? "\t\t<comment>" + HttpUtility.HtmlEncode(Comment) + "</comment>\n" : "") +
|
||||||
(!String.IsNullOrEmpty(Type) ? "\t\t<type>" + HttpUtility.HtmlEncode(Type) + "</type>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Type) ? "\t\t<type>" + HttpUtility.HtmlEncode(Type) + "</type>\n" : "") +
|
||||||
(ForcePacking != ForcePacking.None || ForceMerging != ForceMerging.None || ForceNodump != ForceNodump.None ?
|
(ForcePacking != ForcePacking.None || ForceMerging != ForceMerging.None || ForceNodump != ForceNodump.None ?
|
||||||
"\t\t<clrmamepro" +
|
"\t\t<clrmamepro" +
|
||||||
(ForcePacking == ForcePacking.Unzip ? " forcepacking=\"unzip\"" : String.Empty) +
|
(ForcePacking == ForcePacking.Unzip ? " forcepacking=\"unzip\"" : "") +
|
||||||
(ForcePacking == ForcePacking.Zip ? " forcepacking=\"zip\"" : String.Empty) +
|
(ForcePacking == ForcePacking.Zip ? " forcepacking=\"zip\"" : "") +
|
||||||
(ForceMerging == ForceMerging.Full ? " forcemerging=\"full\"" : String.Empty) +
|
(ForceMerging == ForceMerging.Full ? " forcemerging=\"full\"" : "") +
|
||||||
(ForceMerging == ForceMerging.Split ? " forcemerging=\"split\"" : String.Empty) +
|
(ForceMerging == ForceMerging.Split ? " forcemerging=\"split\"" : "") +
|
||||||
(ForceNodump == ForceNodump.Ignore ? " forceitemStatus=\"ignore\"" : String.Empty) +
|
(ForceNodump == ForceNodump.Ignore ? " forceitemStatus=\"ignore\"" : "") +
|
||||||
(ForceNodump == ForceNodump.Obsolete ? " forceitemStatus=\"obsolete\"" : String.Empty) +
|
(ForceNodump == ForceNodump.Obsolete ? " forceitemStatus=\"obsolete\"" : "") +
|
||||||
(ForceNodump == ForceNodump.Required ? " forceitemStatus=\"required\"" : String.Empty) +
|
(ForceNodump == ForceNodump.Required ? " forceitemStatus=\"required\"" : "") +
|
||||||
" />\n"
|
" />\n"
|
||||||
: String.Empty) +
|
: "") +
|
||||||
"\t</header>\n";
|
"\t</header>\n";
|
||||||
break;
|
break;
|
||||||
case DatFormat.TSV:
|
case DatFormat.TSV:
|
||||||
@@ -371,24 +371,24 @@ namespace SabreTools.Helper.Dats
|
|||||||
"\t<header>\n" +
|
"\t<header>\n" +
|
||||||
"\t\t<name>" + HttpUtility.HtmlEncode(Name) + "</name>\n" +
|
"\t\t<name>" + HttpUtility.HtmlEncode(Name) + "</name>\n" +
|
||||||
"\t\t<description>" + HttpUtility.HtmlEncode(Description) + "</description>\n" +
|
"\t\t<description>" + HttpUtility.HtmlEncode(Description) + "</description>\n" +
|
||||||
(!String.IsNullOrEmpty(RootDir) ? "\t\t<rootdir>" + HttpUtility.HtmlEncode(RootDir) + "</rootdir>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(RootDir) ? "\t\t<rootdir>" + HttpUtility.HtmlEncode(RootDir) + "</rootdir>\n" : "") +
|
||||||
(!String.IsNullOrEmpty(Category) ? "\t\t<category>" + HttpUtility.HtmlEncode(Category) + "</category>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Category) ? "\t\t<category>" + HttpUtility.HtmlEncode(Category) + "</category>\n" : "") +
|
||||||
"\t\t<version>" + HttpUtility.HtmlEncode(Version) + "</version>\n" +
|
"\t\t<version>" + HttpUtility.HtmlEncode(Version) + "</version>\n" +
|
||||||
(!String.IsNullOrEmpty(Date) ? "\t\t<date>" + HttpUtility.HtmlEncode(Date) + "</date>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Date) ? "\t\t<date>" + HttpUtility.HtmlEncode(Date) + "</date>\n" : "") +
|
||||||
"\t\t<author>" + HttpUtility.HtmlEncode(Author) + "</author>\n" +
|
"\t\t<author>" + HttpUtility.HtmlEncode(Author) + "</author>\n" +
|
||||||
(!String.IsNullOrEmpty(Comment) ? "\t\t<comment>" + HttpUtility.HtmlEncode(Comment) + "</comment>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Comment) ? "\t\t<comment>" + HttpUtility.HtmlEncode(Comment) + "</comment>\n" : "") +
|
||||||
(!String.IsNullOrEmpty(Type) || ForcePacking != ForcePacking.None || ForceMerging != ForceMerging.None || ForceNodump != ForceNodump.None ?
|
(!String.IsNullOrEmpty(Type) || ForcePacking != ForcePacking.None || ForceMerging != ForceMerging.None || ForceNodump != ForceNodump.None ?
|
||||||
"\t\t<flags>\n" +
|
"\t\t<flags>\n" +
|
||||||
(!String.IsNullOrEmpty(Type) ? "\t\t\t<flag name=\"type\" value=\"" + HttpUtility.HtmlEncode(Type) + "\"/>\n" : String.Empty) +
|
(!String.IsNullOrEmpty(Type) ? "\t\t\t<flag name=\"type\" value=\"" + HttpUtility.HtmlEncode(Type) + "\"/>\n" : "") +
|
||||||
(ForcePacking == ForcePacking.Unzip ? "\t\t\t<flag name=\"forcepacking\" value=\"unzip\"/>\n" : String.Empty) +
|
(ForcePacking == ForcePacking.Unzip ? "\t\t\t<flag name=\"forcepacking\" value=\"unzip\"/>\n" : "") +
|
||||||
(ForcePacking == ForcePacking.Zip ? "\t\t\t<flag name=\"forcepacking\" value=\"zip\"/>\n" : String.Empty) +
|
(ForcePacking == ForcePacking.Zip ? "\t\t\t<flag name=\"forcepacking\" value=\"zip\"/>\n" : "") +
|
||||||
(ForceMerging == ForceMerging.Full ? "\t\t\t<flag name=\"forcemerging\" value=\"full\"/>\n" : String.Empty) +
|
(ForceMerging == ForceMerging.Full ? "\t\t\t<flag name=\"forcemerging\" value=\"full\"/>\n" : "") +
|
||||||
(ForceMerging == ForceMerging.Split ? "\t\t\t<flag name=\"forcemerging\" value=\"split\"/>\n" : String.Empty) +
|
(ForceMerging == ForceMerging.Split ? "\t\t\t<flag name=\"forcemerging\" value=\"split\"/>\n" : "") +
|
||||||
(ForceNodump == ForceNodump.Ignore ? "\t\t\t<flag name=\"forceitemStatus\" value=\"ignore\"/>\n" : String.Empty) +
|
(ForceNodump == ForceNodump.Ignore ? "\t\t\t<flag name=\"forceitemStatus\" value=\"ignore\"/>\n" : "") +
|
||||||
(ForceNodump == ForceNodump.Obsolete ? "\t\t\t<flag name=\"forceitemStatus\" value=\"obsolete\"/>\n" : String.Empty) +
|
(ForceNodump == ForceNodump.Obsolete ? "\t\t\t<flag name=\"forceitemStatus\" value=\"obsolete\"/>\n" : "") +
|
||||||
(ForceNodump == ForceNodump.Required ? "\t\t\t<flag name=\"forceitemStatus\" value=\"required\"/>\n" : String.Empty) +
|
(ForceNodump == ForceNodump.Required ? "\t\t\t<flag name=\"forceitemStatus\" value=\"required\"/>\n" : "") +
|
||||||
"\t\t</flags>\n"
|
"\t\t</flags>\n"
|
||||||
: String.Empty) +
|
: "") +
|
||||||
"\t</header>\n" +
|
"\t</header>\n" +
|
||||||
"\t<data>\n";
|
"\t<data>\n";
|
||||||
break;
|
break;
|
||||||
@@ -397,13 +397,13 @@ namespace SabreTools.Helper.Dats
|
|||||||
"<!DOCTYPE softwarelist SYSTEM \"softwarelist.dtd\">\n\n" +
|
"<!DOCTYPE softwarelist SYSTEM \"softwarelist.dtd\">\n\n" +
|
||||||
"<softwarelist name=\"" + HttpUtility.HtmlEncode(Name) + "\"" +
|
"<softwarelist name=\"" + HttpUtility.HtmlEncode(Name) + "\"" +
|
||||||
" description=\"" + HttpUtility.HtmlEncode(Description) + "\"" +
|
" description=\"" + HttpUtility.HtmlEncode(Description) + "\"" +
|
||||||
(ForcePacking == ForcePacking.Unzip ? " forcepacking=\"unzip\"" : String.Empty) +
|
(ForcePacking == ForcePacking.Unzip ? " forcepacking=\"unzip\"" : "") +
|
||||||
(ForcePacking == ForcePacking.Zip ? " forcepacking=\"zip\"" : String.Empty) +
|
(ForcePacking == ForcePacking.Zip ? " forcepacking=\"zip\"" : "") +
|
||||||
(ForceMerging == ForceMerging.Full ? " forcemerging=\"full\"" : String.Empty) +
|
(ForceMerging == ForceMerging.Full ? " forcemerging=\"full\"" : "") +
|
||||||
(ForceMerging == ForceMerging.Split ? " forcemerging=\"split\"" : String.Empty) +
|
(ForceMerging == ForceMerging.Split ? " forcemerging=\"split\"" : "") +
|
||||||
(ForceNodump == ForceNodump.Ignore ? " forceitemStatus=\"ignore\"" : String.Empty) +
|
(ForceNodump == ForceNodump.Ignore ? " forceitemStatus=\"ignore\"" : "") +
|
||||||
(ForceNodump == ForceNodump.Obsolete ? " forceitemStatus=\"obsolete\"" : String.Empty) +
|
(ForceNodump == ForceNodump.Obsolete ? " forceitemStatus=\"obsolete\"" : "") +
|
||||||
(ForceNodump == ForceNodump.Required ? " forceitemStatus=\"required\"" : String.Empty) +
|
(ForceNodump == ForceNodump.Required ? " forceitemStatus=\"required\"" : "") +
|
||||||
">\n\n";
|
">\n\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -443,7 +443,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
rom.Machine.Name = rom.Machine.Name.Substring(1);
|
rom.Machine.Name = rom.Machine.Name.Substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
string state = String.Empty;
|
string state = "";
|
||||||
switch (datFormat)
|
switch (datFormat)
|
||||||
{
|
{
|
||||||
case DatFormat.AttractMode:
|
case DatFormat.AttractMode:
|
||||||
@@ -467,40 +467,40 @@ namespace SabreTools.Helper.Dats
|
|||||||
break;
|
break;
|
||||||
case DatFormat.ClrMamePro:
|
case DatFormat.ClrMamePro:
|
||||||
state += "game (\n\tname \"" + rom.Machine.Name + "\"\n" +
|
state += "game (\n\tname \"" + rom.Machine.Name + "\"\n" +
|
||||||
(ExcludeOf ? String.Empty :
|
(ExcludeOf ? "" :
|
||||||
(String.IsNullOrEmpty(rom.Machine.RomOf) ? String.Empty : "\tromof \"" + rom.Machine.RomOf + "\"\n") +
|
(String.IsNullOrEmpty(rom.Machine.RomOf) ? "" : "\tromof \"" + rom.Machine.RomOf + "\"\n") +
|
||||||
(String.IsNullOrEmpty(rom.Machine.CloneOf) ? String.Empty : "\tcloneof \"" + rom.Machine.CloneOf + "\"\n") +
|
(String.IsNullOrEmpty(rom.Machine.CloneOf) ? "" : "\tcloneof \"" + rom.Machine.CloneOf + "\"\n") +
|
||||||
(String.IsNullOrEmpty(rom.Machine.SampleOf) ? String.Empty : "\tsampleof \"" + rom.Machine.SampleOf + "\"\n")
|
(String.IsNullOrEmpty(rom.Machine.SampleOf) ? "" : "\tsampleof \"" + rom.Machine.SampleOf + "\"\n")
|
||||||
) +
|
) +
|
||||||
"\tdescription \"" + (String.IsNullOrEmpty(rom.Machine.Description) ? rom.Machine.Name : rom.Machine.Description) + "\"\n" +
|
"\tdescription \"" + (String.IsNullOrEmpty(rom.Machine.Description) ? rom.Machine.Name : rom.Machine.Description) + "\"\n" +
|
||||||
(String.IsNullOrEmpty(rom.Machine.Year) ? String.Empty : "\tyear " + rom.Machine.Year + "\n") +
|
(String.IsNullOrEmpty(rom.Machine.Year) ? "" : "\tyear " + rom.Machine.Year + "\n") +
|
||||||
(String.IsNullOrEmpty(rom.Machine.Manufacturer) ? String.Empty : "\tmanufacturer \"" + rom.Machine.Manufacturer + "\"\n");
|
(String.IsNullOrEmpty(rom.Machine.Manufacturer) ? "" : "\tmanufacturer \"" + rom.Machine.Manufacturer + "\"\n");
|
||||||
break;
|
break;
|
||||||
case DatFormat.DOSCenter:
|
case DatFormat.DOSCenter:
|
||||||
state += "game (\n\tname \"" + rom.Machine.Name + ".zip\"\n";
|
state += "game (\n\tname \"" + rom.Machine.Name + ".zip\"\n";
|
||||||
break;
|
break;
|
||||||
case DatFormat.Logiqx:
|
case DatFormat.Logiqx:
|
||||||
state += "\t<machine name=\"" + HttpUtility.HtmlEncode(rom.Machine.Name) + "\"" +
|
state += "\t<machine name=\"" + HttpUtility.HtmlEncode(rom.Machine.Name) + "\"" +
|
||||||
(ExcludeOf ? String.Empty :
|
(ExcludeOf ? "" :
|
||||||
(rom.Machine.MachineType == MachineType.Bios ? " isbios=\"yes\"" : String.Empty) +
|
(rom.Machine.MachineType == MachineType.Bios ? " isbios=\"yes\"" : "") +
|
||||||
(rom.Machine.MachineType == MachineType.Device ? " isdevice=\"yes\"" : String.Empty) +
|
(rom.Machine.MachineType == MachineType.Device ? " isdevice=\"yes\"" : "") +
|
||||||
(rom.Machine.MachineType == MachineType.Mechanical ? " ismechanical=\"yes\"" : String.Empty) +
|
(rom.Machine.MachineType == MachineType.Mechanical ? " ismechanical=\"yes\"" : "") +
|
||||||
(rom.Machine.Runnable ? " runnable=\"yes\"" : String.Empty) +
|
(rom.Machine.Runnable ? " runnable=\"yes\"" : "") +
|
||||||
(String.IsNullOrEmpty(rom.Machine.CloneOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.CloneOf.ToLowerInvariant())
|
(String.IsNullOrEmpty(rom.Machine.CloneOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.CloneOf.ToLowerInvariant())
|
||||||
? String.Empty
|
? ""
|
||||||
: " cloneof=\"" + HttpUtility.HtmlEncode(rom.Machine.CloneOf) + "\"") +
|
: " cloneof=\"" + HttpUtility.HtmlEncode(rom.Machine.CloneOf) + "\"") +
|
||||||
(String.IsNullOrEmpty(rom.Machine.RomOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.RomOf.ToLowerInvariant())
|
(String.IsNullOrEmpty(rom.Machine.RomOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.RomOf.ToLowerInvariant())
|
||||||
? String.Empty
|
? ""
|
||||||
: " romof=\"" + HttpUtility.HtmlEncode(rom.Machine.RomOf) + "\"") +
|
: " romof=\"" + HttpUtility.HtmlEncode(rom.Machine.RomOf) + "\"") +
|
||||||
(String.IsNullOrEmpty(rom.Machine.SampleOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.SampleOf.ToLowerInvariant())
|
(String.IsNullOrEmpty(rom.Machine.SampleOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.SampleOf.ToLowerInvariant())
|
||||||
? String.Empty
|
? ""
|
||||||
: " sampleof=\"" + HttpUtility.HtmlEncode(rom.Machine.SampleOf) + "\"")
|
: " sampleof=\"" + HttpUtility.HtmlEncode(rom.Machine.SampleOf) + "\"")
|
||||||
) +
|
) +
|
||||||
">\n" +
|
">\n" +
|
||||||
(String.IsNullOrEmpty(rom.Machine.Comment) ? String.Empty : "\t\t<comment>" + HttpUtility.HtmlEncode(rom.Machine.Comment) + "</comment>\n") +
|
(String.IsNullOrEmpty(rom.Machine.Comment) ? "" : "\t\t<comment>" + HttpUtility.HtmlEncode(rom.Machine.Comment) + "</comment>\n") +
|
||||||
"\t\t<description>" + HttpUtility.HtmlEncode((String.IsNullOrEmpty(rom.Machine.Description) ? rom.Machine.Name : rom.Machine.Description)) + "</description>\n" +
|
"\t\t<description>" + HttpUtility.HtmlEncode((String.IsNullOrEmpty(rom.Machine.Description) ? rom.Machine.Name : rom.Machine.Description)) + "</description>\n" +
|
||||||
(String.IsNullOrEmpty(rom.Machine.Year) ? String.Empty : "\t\t<year>" + HttpUtility.HtmlEncode(rom.Machine.Year) + "</year>\n") +
|
(String.IsNullOrEmpty(rom.Machine.Year) ? "" : "\t\t<year>" + HttpUtility.HtmlEncode(rom.Machine.Year) + "</year>\n") +
|
||||||
(String.IsNullOrEmpty(rom.Machine.Manufacturer) ? String.Empty : "\t\t<manufacturer>" + HttpUtility.HtmlEncode(rom.Machine.Manufacturer) + "</manufacturer>\n");
|
(String.IsNullOrEmpty(rom.Machine.Manufacturer) ? "" : "\t\t<manufacturer>" + HttpUtility.HtmlEncode(rom.Machine.Manufacturer) + "</manufacturer>\n");
|
||||||
break;
|
break;
|
||||||
case DatFormat.SabreDat:
|
case DatFormat.SabreDat:
|
||||||
for (int i = (last == -1 ? 0 : last); i < newsplit.Count; i++)
|
for (int i = (last == -1 ? 0 : last); i < newsplit.Count; i++)
|
||||||
@@ -516,21 +516,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
break;
|
break;
|
||||||
case DatFormat.SoftwareList:
|
case DatFormat.SoftwareList:
|
||||||
state += "\t<software name=\"" + HttpUtility.HtmlEncode(rom.Machine.Name) + "\""
|
state += "\t<software name=\"" + HttpUtility.HtmlEncode(rom.Machine.Name) + "\""
|
||||||
+ (rom.Supported != null ? " supported=\"" + (rom.Supported == true ? "yes" : "no") + "\"" : String.Empty) +
|
+ (rom.Supported != null ? " supported=\"" + (rom.Supported == true ? "yes" : "no") + "\"" : "") +
|
||||||
(ExcludeOf ? String.Empty :
|
(ExcludeOf ? "" :
|
||||||
(String.IsNullOrEmpty(rom.Machine.CloneOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.CloneOf.ToLowerInvariant())
|
(String.IsNullOrEmpty(rom.Machine.CloneOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.CloneOf.ToLowerInvariant())
|
||||||
? String.Empty
|
? ""
|
||||||
: " cloneof=\"" + HttpUtility.HtmlEncode(rom.Machine.CloneOf) + "\"") +
|
: " cloneof=\"" + HttpUtility.HtmlEncode(rom.Machine.CloneOf) + "\"") +
|
||||||
(String.IsNullOrEmpty(rom.Machine.RomOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.RomOf.ToLowerInvariant())
|
(String.IsNullOrEmpty(rom.Machine.RomOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.RomOf.ToLowerInvariant())
|
||||||
? String.Empty
|
? ""
|
||||||
: " romof=\"" + HttpUtility.HtmlEncode(rom.Machine.RomOf) + "\"") +
|
: " romof=\"" + HttpUtility.HtmlEncode(rom.Machine.RomOf) + "\"") +
|
||||||
(String.IsNullOrEmpty(rom.Machine.SampleOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.SampleOf.ToLowerInvariant())
|
(String.IsNullOrEmpty(rom.Machine.SampleOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.SampleOf.ToLowerInvariant())
|
||||||
? String.Empty
|
? ""
|
||||||
: " sampleof=\"" + HttpUtility.HtmlEncode(rom.Machine.SampleOf) + "\"")
|
: " sampleof=\"" + HttpUtility.HtmlEncode(rom.Machine.SampleOf) + "\"")
|
||||||
) + ">\n"
|
) + ">\n"
|
||||||
+ "\t\t<description>" + HttpUtility.HtmlEncode(rom.Machine.Description) + "</description>\n"
|
+ "\t\t<description>" + HttpUtility.HtmlEncode(rom.Machine.Description) + "</description>\n"
|
||||||
+ (rom.Machine.Year != null ? "\t\t<year>" + HttpUtility.HtmlEncode(rom.Machine.Year) + "</year>\n" : String.Empty)
|
+ (rom.Machine.Year != null ? "\t\t<year>" + HttpUtility.HtmlEncode(rom.Machine.Year) + "</year>\n" : "")
|
||||||
+ (rom.Publisher != null ? "\t\t<publisher>" + HttpUtility.HtmlEncode(rom.Publisher) + "</publisher>\n" : String.Empty);
|
+ (rom.Publisher != null ? "\t\t<publisher>" + HttpUtility.HtmlEncode(rom.Publisher) + "</publisher>\n" : "");
|
||||||
|
|
||||||
foreach (Tuple<string, string> kvp in rom.Infos)
|
foreach (Tuple<string, string> kvp in rom.Infos)
|
||||||
{
|
{
|
||||||
@@ -570,13 +570,13 @@ namespace SabreTools.Helper.Dats
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string state = String.Empty;
|
string state = "";
|
||||||
|
|
||||||
switch (datFormat)
|
switch (datFormat)
|
||||||
{
|
{
|
||||||
case DatFormat.ClrMamePro:
|
case DatFormat.ClrMamePro:
|
||||||
case DatFormat.DOSCenter:
|
case DatFormat.DOSCenter:
|
||||||
state += (String.IsNullOrEmpty(rom.Machine.SampleOf) ? String.Empty : "\tsampleof \"" + rom.Machine.SampleOf + "\"\n") + ")\n";
|
state += (String.IsNullOrEmpty(rom.Machine.SampleOf) ? "" : "\tsampleof \"" + rom.Machine.SampleOf + "\"\n") + ")\n";
|
||||||
break;
|
break;
|
||||||
case DatFormat.Logiqx:
|
case DatFormat.Logiqx:
|
||||||
state += "\t</machine>\n";
|
state += "\t</machine>\n";
|
||||||
@@ -654,7 +654,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string state = String.Empty, name = String.Empty, pre = String.Empty, post = String.Empty;
|
string state = "", name = "", pre = "", post = "";
|
||||||
switch (datFormat)
|
switch (datFormat)
|
||||||
{
|
{
|
||||||
case DatFormat.ClrMamePro:
|
case DatFormat.ClrMamePro:
|
||||||
@@ -666,37 +666,37 @@ namespace SabreTools.Helper.Dats
|
|||||||
break;
|
break;
|
||||||
case ItemType.BiosSet:
|
case ItemType.BiosSet:
|
||||||
state += "\tbiosset ( name\"" + rom.Name + "\""
|
state += "\tbiosset ( name\"" + rom.Name + "\""
|
||||||
+ (!String.IsNullOrEmpty(((BiosSet)rom).Description) ? " description \"" + ((BiosSet)rom).Description + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((BiosSet)rom).Description) ? " description \"" + ((BiosSet)rom).Description + "\"" : "")
|
||||||
+ (((BiosSet)rom).Default != null
|
+ (((BiosSet)rom).Default != null
|
||||||
? "default " + ((BiosSet)rom).Default.ToString().ToLowerInvariant()
|
? "default " + ((BiosSet)rom).Default.ToString().ToLowerInvariant()
|
||||||
: String.Empty)
|
: "")
|
||||||
+ " )\n";
|
+ " )\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Disk:
|
case ItemType.Disk:
|
||||||
state += "\tdisk ( name \"" + rom.Name + "\""
|
state += "\tdisk ( name \"" + rom.Name + "\""
|
||||||
+ (!String.IsNullOrEmpty(((Disk)rom).MD5) ? " md5 " + ((Disk)rom).MD5.ToLowerInvariant() : String.Empty)
|
+ (!String.IsNullOrEmpty(((Disk)rom).MD5) ? " md5 " + ((Disk)rom).MD5.ToLowerInvariant() : "")
|
||||||
+ (!String.IsNullOrEmpty(((Disk)rom).SHA1) ? " sha1 " + ((Disk)rom).SHA1.ToLowerInvariant() : String.Empty)
|
+ (!String.IsNullOrEmpty(((Disk)rom).SHA1) ? " sha1 " + ((Disk)rom).SHA1.ToLowerInvariant() : "")
|
||||||
+ (((Disk)rom).ItemStatus != ItemStatus.None ? " flags " + ((Disk)rom).ItemStatus.ToString().ToLowerInvariant() : String.Empty)
|
+ (((Disk)rom).ItemStatus != ItemStatus.None ? " flags " + ((Disk)rom).ItemStatus.ToString().ToLowerInvariant() : "")
|
||||||
+ " )\n";
|
+ " )\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Release:
|
case ItemType.Release:
|
||||||
state += "\trelease ( name\"" + rom.Name + "\""
|
state += "\trelease ( name\"" + rom.Name + "\""
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Region) ? " region \"" + ((Release)rom).Region + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Region) ? " region \"" + ((Release)rom).Region + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Language) ? " language \"" + ((Release)rom).Language + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Language) ? " language \"" + ((Release)rom).Language + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Date) ? " date \"" + ((Release)rom).Date + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Date) ? " date \"" + ((Release)rom).Date + "\"" : "")
|
||||||
+ (((Release)rom).Default != null
|
+ (((Release)rom).Default != null
|
||||||
? "default " + ((Release)rom).Default.ToString().ToLowerInvariant()
|
? "default " + ((Release)rom).Default.ToString().ToLowerInvariant()
|
||||||
: String.Empty)
|
: "")
|
||||||
+ " )\n";
|
+ " )\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Rom:
|
case ItemType.Rom:
|
||||||
state += "\trom ( name \"" + rom.Name + "\""
|
state += "\trom ( name \"" + rom.Name + "\""
|
||||||
+ (((Rom)rom).Size != -1 ? " size " + ((Rom)rom).Size : String.Empty)
|
+ (((Rom)rom).Size != -1 ? " size " + ((Rom)rom).Size : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).CRC) ? " crc " + ((Rom)rom).CRC.ToLowerInvariant() : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).CRC) ? " crc " + ((Rom)rom).CRC.ToLowerInvariant() : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).MD5) ? " md5 " + ((Rom)rom).MD5.ToLowerInvariant() : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).MD5) ? " md5 " + ((Rom)rom).MD5.ToLowerInvariant() : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).SHA1) ? " sha1 " + ((Rom)rom).SHA1.ToLowerInvariant() : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).SHA1) ? " sha1 " + ((Rom)rom).SHA1.ToLowerInvariant() : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).Date) ? " date \"" + ((Rom)rom).Date + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).Date) ? " date \"" + ((Rom)rom).Date + "\"" : "")
|
||||||
+ (((Rom)rom).ItemStatus != ItemStatus.None ? " flags " + ((Rom)rom).ItemStatus.ToString().ToLowerInvariant() : String.Empty)
|
+ (((Rom)rom).ItemStatus != ItemStatus.None ? " flags " + ((Rom)rom).ItemStatus.ToString().ToLowerInvariant() : "")
|
||||||
+ " )\n";
|
+ " )\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Sample:
|
case ItemType.Sample:
|
||||||
@@ -713,8 +713,8 @@ namespace SabreTools.Helper.Dats
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre = Prefix + (Quotes ? "\"" : String.Empty);
|
pre = Prefix + (Quotes ? "\"" : "");
|
||||||
post = (Quotes ? "\"" : String.Empty) + Postfix;
|
post = (Quotes ? "\"" : "") + Postfix;
|
||||||
|
|
||||||
if (rom.Type == ItemType.Rom)
|
if (rom.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
@@ -796,9 +796,9 @@ namespace SabreTools.Helper.Dats
|
|||||||
break;
|
break;
|
||||||
case ItemType.Rom:
|
case ItemType.Rom:
|
||||||
state += "\tfile ( name " + ((Rom)rom).Name
|
state += "\tfile ( name " + ((Rom)rom).Name
|
||||||
+ (((Rom)rom).Size != -1 ? " size " + ((Rom)rom).Size : String.Empty)
|
+ (((Rom)rom).Size != -1 ? " size " + ((Rom)rom).Size : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).Date) ? " date " + ((Rom)rom).Date : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).Date) ? " date " + ((Rom)rom).Date : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).CRC) ? " crc " + ((Rom)rom).CRC.ToLowerInvariant() : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).CRC) ? " crc " + ((Rom)rom).CRC.ToLowerInvariant() : "")
|
||||||
+ " )\n";
|
+ " )\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -812,37 +812,37 @@ namespace SabreTools.Helper.Dats
|
|||||||
break;
|
break;
|
||||||
case ItemType.BiosSet:
|
case ItemType.BiosSet:
|
||||||
state += "\t\t<biosset name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
state += "\t\t<biosset name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (!String.IsNullOrEmpty(((BiosSet)rom).Description) ? " description=\"" + HttpUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((BiosSet)rom).Description) ? " description=\"" + HttpUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : "")
|
||||||
+ (((BiosSet)rom).Default != null
|
+ (((BiosSet)rom).Default != null
|
||||||
? ((BiosSet)rom).Default.ToString().ToLowerInvariant()
|
? ((BiosSet)rom).Default.ToString().ToLowerInvariant()
|
||||||
: String.Empty)
|
: "")
|
||||||
+ "/>\n";
|
+ "/>\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Disk:
|
case ItemType.Disk:
|
||||||
state += "\t\t<disk name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
state += "\t\t<disk name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (!String.IsNullOrEmpty(((Disk)rom).MD5) ? " md5=\"" + ((Disk)rom).MD5.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Disk)rom).MD5) ? " md5=\"" + ((Disk)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Disk)rom).SHA1) ? " sha1=\"" + ((Disk)rom).SHA1.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Disk)rom).SHA1) ? " sha1=\"" + ((Disk)rom).SHA1.ToLowerInvariant() + "\"" : "")
|
||||||
+ (((Disk)rom).ItemStatus != ItemStatus.None ? " status=\"" + ((Disk)rom).ItemStatus.ToString().ToLowerInvariant() + "\"" : String.Empty)
|
+ (((Disk)rom).ItemStatus != ItemStatus.None ? " status=\"" + ((Disk)rom).ItemStatus.ToString().ToLowerInvariant() + "\"" : "")
|
||||||
+ "/>\n";
|
+ "/>\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Release:
|
case ItemType.Release:
|
||||||
state += "\t\t<release name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
state += "\t\t<release name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Region) ? " region=\"" + HttpUtility.HtmlEncode(((Release)rom).Region) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Region) ? " region=\"" + HttpUtility.HtmlEncode(((Release)rom).Region) + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Language) ? " language=\"" + HttpUtility.HtmlEncode(((Release)rom).Language) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Language) ? " language=\"" + HttpUtility.HtmlEncode(((Release)rom).Language) + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Date) ? " date=\"" + HttpUtility.HtmlEncode(((Release)rom).Date) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Date) ? " date=\"" + HttpUtility.HtmlEncode(((Release)rom).Date) + "\"" : "")
|
||||||
+ (((Release)rom).Default != null
|
+ (((Release)rom).Default != null
|
||||||
? ((Release)rom).Default.ToString().ToLowerInvariant()
|
? ((Release)rom).Default.ToString().ToLowerInvariant()
|
||||||
: String.Empty)
|
: "")
|
||||||
+ "/>\n";
|
+ "/>\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Rom:
|
case ItemType.Rom:
|
||||||
state += "\t\t<rom name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
state += "\t\t<rom name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (((Rom)rom).Size != -1 ? " size=\"" + ((Rom)rom).Size + "\"" : String.Empty)
|
+ (((Rom)rom).Size != -1 ? " size=\"" + ((Rom)rom).Size + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).CRC) ? " crc=\"" + ((Rom)rom).CRC.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).CRC) ? " crc=\"" + ((Rom)rom).CRC.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).MD5) ? " md5=\"" + ((Rom)rom).MD5.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).MD5) ? " md5=\"" + ((Rom)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).SHA1) ? " sha1=\"" + ((Rom)rom).SHA1.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).SHA1) ? " sha1=\"" + ((Rom)rom).SHA1.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).Date) ? " date=\"" + ((Rom)rom).Date + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).Date) ? " date=\"" + ((Rom)rom).Date + "\"" : "")
|
||||||
+ (((Rom)rom).ItemStatus != ItemStatus.None ? " status=\"" + ((Rom)rom).ItemStatus.ToString().ToLowerInvariant() + "\"" : String.Empty)
|
+ (((Rom)rom).ItemStatus != ItemStatus.None ? " status=\"" + ((Rom)rom).ItemStatus.ToString().ToLowerInvariant() + "\"" : "")
|
||||||
+ "/>\n";
|
+ "/>\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Sample:
|
case ItemType.Sample:
|
||||||
@@ -858,8 +858,8 @@ namespace SabreTools.Helper.Dats
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre = Prefix + (Quotes ? "\"" : String.Empty);
|
pre = Prefix + (Quotes ? "\"" : "");
|
||||||
post = (Quotes ? "\"" : String.Empty) + Postfix;
|
post = (Quotes ? "\"" : "") + Postfix;
|
||||||
|
|
||||||
if (rom.Type == ItemType.Rom)
|
if (rom.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
@@ -900,7 +900,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
if (rom.Type == ItemType.Rom)
|
if (rom.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
// We can only write out if there's a SHA-1
|
// We can only write out if there's a SHA-1
|
||||||
if (((Rom)rom).SHA1 != String.Empty)
|
if (((Rom)rom).SHA1 != "")
|
||||||
{
|
{
|
||||||
name = ((Rom)rom).SHA1.Substring(0, 2)
|
name = ((Rom)rom).SHA1.Substring(0, 2)
|
||||||
+ "/" + ((Rom)rom).SHA1.Substring(2, 2)
|
+ "/" + ((Rom)rom).SHA1.Substring(2, 2)
|
||||||
@@ -913,7 +913,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
else if (rom.Type == ItemType.Disk)
|
else if (rom.Type == ItemType.Disk)
|
||||||
{
|
{
|
||||||
// We can only write out if there's a SHA-1
|
// We can only write out if there's a SHA-1
|
||||||
if (((Disk)rom).SHA1 != String.Empty)
|
if (((Disk)rom).SHA1 != "")
|
||||||
{
|
{
|
||||||
name = ((Disk)rom).SHA1.Substring(0, 2)
|
name = ((Disk)rom).SHA1.Substring(0, 2)
|
||||||
+ "/" + ((Disk)rom).SHA1.Substring(2, 2)
|
+ "/" + ((Disk)rom).SHA1.Substring(2, 2)
|
||||||
@@ -927,18 +927,18 @@ namespace SabreTools.Helper.Dats
|
|||||||
|
|
||||||
// Otherwise, use any flags
|
// Otherwise, use any flags
|
||||||
name = (UseGame ? rom.Machine.Name : rom.Name);
|
name = (UseGame ? rom.Machine.Name : rom.Name);
|
||||||
if (RepExt != String.Empty || RemExt)
|
if (RepExt != "" || RemExt)
|
||||||
{
|
{
|
||||||
if (RemExt)
|
if (RemExt)
|
||||||
{
|
{
|
||||||
RepExt = String.Empty;
|
RepExt = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
string dir = Path.GetDirectoryName(name);
|
string dir = Path.GetDirectoryName(name);
|
||||||
dir = (dir.StartsWith(Path.DirectorySeparatorChar.ToString()) ? dir.Remove(0, 1) : dir);
|
dir = (dir.StartsWith(Path.DirectorySeparatorChar.ToString()) ? dir.Remove(0, 1) : dir);
|
||||||
name = Path.Combine(dir, Path.GetFileNameWithoutExtension(name) + RepExt);
|
name = Path.Combine(dir, Path.GetFileNameWithoutExtension(name) + RepExt);
|
||||||
}
|
}
|
||||||
if (AddExt != String.Empty)
|
if (AddExt != "")
|
||||||
{
|
{
|
||||||
name += AddExt;
|
name += AddExt;
|
||||||
}
|
}
|
||||||
@@ -1008,44 +1008,44 @@ namespace SabreTools.Helper.Dats
|
|||||||
case DatFormat.RedumpMD5:
|
case DatFormat.RedumpMD5:
|
||||||
if (rom.Type == ItemType.Rom)
|
if (rom.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
state += ((Rom)rom).MD5 + " *" + (GameName ? rom.Machine.Name + Path.DirectorySeparatorChar : String.Empty) + rom.Name + "\n";
|
state += ((Rom)rom).MD5 + " *" + (GameName ? rom.Machine.Name + Path.DirectorySeparatorChar : "") + rom.Name + "\n";
|
||||||
}
|
}
|
||||||
else if (rom.Type == ItemType.Disk)
|
else if (rom.Type == ItemType.Disk)
|
||||||
{
|
{
|
||||||
state += ((Disk)rom).MD5 + " *" + (GameName ? rom.Machine.Name + Path.DirectorySeparatorChar : String.Empty) + rom.Name + "\n";
|
state += ((Disk)rom).MD5 + " *" + (GameName ? rom.Machine.Name + Path.DirectorySeparatorChar : "") + rom.Name + "\n";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DatFormat.RedumpSFV:
|
case DatFormat.RedumpSFV:
|
||||||
if (rom.Type == ItemType.Rom)
|
if (rom.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
state += (GameName ? rom.Machine.Name + Path.DirectorySeparatorChar : String.Empty) + rom.Name + " " + ((Rom)rom).CRC + "\n";
|
state += (GameName ? rom.Machine.Name + Path.DirectorySeparatorChar : "") + rom.Name + " " + ((Rom)rom).CRC + "\n";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DatFormat.RedumpSHA1:
|
case DatFormat.RedumpSHA1:
|
||||||
if (rom.Type == ItemType.Rom)
|
if (rom.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
state += ((Rom)rom).SHA1 + " *" + (GameName ? rom.Machine.Name + Path.DirectorySeparatorChar : String.Empty) + rom.Name + "\n";
|
state += ((Rom)rom).SHA1 + " *" + (GameName ? rom.Machine.Name + Path.DirectorySeparatorChar : "") + rom.Name + "\n";
|
||||||
}
|
}
|
||||||
else if (rom.Type == ItemType.Disk)
|
else if (rom.Type == ItemType.Disk)
|
||||||
{
|
{
|
||||||
state += ((Disk)rom).SHA1 + " *" + (GameName ? rom.Machine.Name + Path.DirectorySeparatorChar : String.Empty) + rom.Name + "\n";
|
state += ((Disk)rom).SHA1 + " *" + (GameName ? rom.Machine.Name + Path.DirectorySeparatorChar : "") + rom.Name + "\n";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DatFormat.RomCenter:
|
case DatFormat.RomCenter:
|
||||||
if (rom.Type == ItemType.Rom)
|
if (rom.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
state += "¬" + (String.IsNullOrEmpty(rom.Machine.CloneOf) ? String.Empty : HttpUtility.HtmlEncode(rom.Machine.CloneOf)) +
|
state += "¬" + (String.IsNullOrEmpty(rom.Machine.CloneOf) ? "" : HttpUtility.HtmlEncode(rom.Machine.CloneOf)) +
|
||||||
"¬" + (String.IsNullOrEmpty(rom.Machine.CloneOf) ? String.Empty : HttpUtility.HtmlEncode(rom.Machine.CloneOf)) +
|
"¬" + (String.IsNullOrEmpty(rom.Machine.CloneOf) ? "" : HttpUtility.HtmlEncode(rom.Machine.CloneOf)) +
|
||||||
"¬" + HttpUtility.HtmlEncode(rom.Machine.Name) +
|
"¬" + HttpUtility.HtmlEncode(rom.Machine.Name) +
|
||||||
"¬" + HttpUtility.HtmlEncode((String.IsNullOrEmpty(rom.Machine.Description) ? rom.Machine.Name : rom.Machine.Description)) +
|
"¬" + HttpUtility.HtmlEncode((String.IsNullOrEmpty(rom.Machine.Description) ? rom.Machine.Name : rom.Machine.Description)) +
|
||||||
"¬" + HttpUtility.HtmlEncode(rom.Name) +
|
"¬" + HttpUtility.HtmlEncode(rom.Name) +
|
||||||
"¬" + ((Rom)rom).CRC.ToLowerInvariant() +
|
"¬" + ((Rom)rom).CRC.ToLowerInvariant() +
|
||||||
"¬" + (((Rom)rom).Size != -1 ? ((Rom)rom).Size.ToString() : String.Empty) + "¬¬¬\n";
|
"¬" + (((Rom)rom).Size != -1 ? ((Rom)rom).Size.ToString() : "") + "¬¬¬\n";
|
||||||
}
|
}
|
||||||
else if (rom.Type == ItemType.Disk)
|
else if (rom.Type == ItemType.Disk)
|
||||||
{
|
{
|
||||||
state += "¬" + (String.IsNullOrEmpty(rom.Machine.CloneOf) ? String.Empty : HttpUtility.HtmlEncode(rom.Machine.CloneOf)) +
|
state += "¬" + (String.IsNullOrEmpty(rom.Machine.CloneOf) ? "" : HttpUtility.HtmlEncode(rom.Machine.CloneOf)) +
|
||||||
"¬" + (String.IsNullOrEmpty(rom.Machine.CloneOf) ? String.Empty : HttpUtility.HtmlEncode(rom.Machine.CloneOf)) +
|
"¬" + (String.IsNullOrEmpty(rom.Machine.CloneOf) ? "" : HttpUtility.HtmlEncode(rom.Machine.CloneOf)) +
|
||||||
"¬" + HttpUtility.HtmlEncode(rom.Machine.Name) +
|
"¬" + HttpUtility.HtmlEncode(rom.Machine.Name) +
|
||||||
"¬" + HttpUtility.HtmlEncode((String.IsNullOrEmpty(rom.Machine.Description) ? rom.Machine.Name : rom.Machine.Description)) +
|
"¬" + HttpUtility.HtmlEncode((String.IsNullOrEmpty(rom.Machine.Description) ? rom.Machine.Name : rom.Machine.Description)) +
|
||||||
"¬" + HttpUtility.HtmlEncode(rom.Name) +
|
"¬" + HttpUtility.HtmlEncode(rom.Name) +
|
||||||
@@ -1054,7 +1054,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case DatFormat.SabreDat:
|
case DatFormat.SabreDat:
|
||||||
string prefix = String.Empty;
|
string prefix = "";
|
||||||
for (int i = 0; i < depth; i++)
|
for (int i = 0; i < depth; i++)
|
||||||
{
|
{
|
||||||
prefix += "\t";
|
prefix += "\t";
|
||||||
@@ -1069,16 +1069,16 @@ namespace SabreTools.Helper.Dats
|
|||||||
break;
|
break;
|
||||||
case ItemType.BiosSet:
|
case ItemType.BiosSet:
|
||||||
state += "<file type=\"biosset\" name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
state += "<file type=\"biosset\" name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (!String.IsNullOrEmpty(((BiosSet)rom).Description) ? " description=\"" + HttpUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((BiosSet)rom).Description) ? " description=\"" + HttpUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : "")
|
||||||
+ (((BiosSet)rom).Default != null
|
+ (((BiosSet)rom).Default != null
|
||||||
? ((BiosSet)rom).Default.ToString().ToLowerInvariant()
|
? ((BiosSet)rom).Default.ToString().ToLowerInvariant()
|
||||||
: String.Empty)
|
: "")
|
||||||
+ "/>\n";
|
+ "/>\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Disk:
|
case ItemType.Disk:
|
||||||
state += "<file type=\"disk\" name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
state += "<file type=\"disk\" name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (!String.IsNullOrEmpty(((Disk)rom).MD5) ? " md5=\"" + ((Disk)rom).MD5.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Disk)rom).MD5) ? " md5=\"" + ((Disk)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Disk)rom).SHA1) ? " sha1=\"" + ((Disk)rom).SHA1.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Disk)rom).SHA1) ? " sha1=\"" + ((Disk)rom).SHA1.ToLowerInvariant() + "\"" : "")
|
||||||
+ (((Disk)rom).ItemStatus != ItemStatus.None ? prefix + "/>\n" + prefix + "\t<flags>\n" +
|
+ (((Disk)rom).ItemStatus != ItemStatus.None ? prefix + "/>\n" + prefix + "\t<flags>\n" +
|
||||||
prefix + "\t\t<flag name=\"status\" value=\"" + ((Disk)rom).ItemStatus.ToString().ToLowerInvariant() + "\"/>\n" +
|
prefix + "\t\t<flag name=\"status\" value=\"" + ((Disk)rom).ItemStatus.ToString().ToLowerInvariant() + "\"/>\n" +
|
||||||
prefix + "\t</flags>\n" +
|
prefix + "\t</flags>\n" +
|
||||||
@@ -1086,21 +1086,21 @@ namespace SabreTools.Helper.Dats
|
|||||||
break;
|
break;
|
||||||
case ItemType.Release:
|
case ItemType.Release:
|
||||||
state += "<file type=\"release\" name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
state += "<file type=\"release\" name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Region) ? " region=\"" + HttpUtility.HtmlEncode(((Release)rom).Region) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Region) ? " region=\"" + HttpUtility.HtmlEncode(((Release)rom).Region) + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Language) ? " language=\"" + HttpUtility.HtmlEncode(((Release)rom).Language) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Language) ? " language=\"" + HttpUtility.HtmlEncode(((Release)rom).Language) + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Date) ? " date=\"" + HttpUtility.HtmlEncode(((Release)rom).Date) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Date) ? " date=\"" + HttpUtility.HtmlEncode(((Release)rom).Date) + "\"" : "")
|
||||||
+ (((Release)rom).Default != null
|
+ (((Release)rom).Default != null
|
||||||
? ((Release)rom).Default.ToString().ToLowerInvariant()
|
? ((Release)rom).Default.ToString().ToLowerInvariant()
|
||||||
: String.Empty)
|
: "")
|
||||||
+ "/>\n";
|
+ "/>\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Rom:
|
case ItemType.Rom:
|
||||||
state += "<file type=\"rom\" name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
state += "<file type=\"rom\" name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (((Rom)rom).Size != -1 ? " size=\"" + ((Rom)rom).Size + "\"" : String.Empty)
|
+ (((Rom)rom).Size != -1 ? " size=\"" + ((Rom)rom).Size + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).CRC) ? " crc=\"" + ((Rom)rom).CRC.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).CRC) ? " crc=\"" + ((Rom)rom).CRC.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).MD5) ? " md5=\"" + ((Rom)rom).MD5.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).MD5) ? " md5=\"" + ((Rom)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).SHA1) ? " sha1=\"" + ((Rom)rom).SHA1.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).SHA1) ? " sha1=\"" + ((Rom)rom).SHA1.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).Date) ? " date=\"" + ((Rom)rom).Date + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).Date) ? " date=\"" + ((Rom)rom).Date + "\"" : "")
|
||||||
+ (((Rom)rom).ItemStatus != ItemStatus.None ? prefix + "/>\n" + prefix + "\t<flags>\n" +
|
+ (((Rom)rom).ItemStatus != ItemStatus.None ? prefix + "/>\n" + prefix + "\t<flags>\n" +
|
||||||
prefix + "\t\t<flag name=\"status\" value=\"" + ((Rom)rom).ItemStatus.ToString().ToLowerInvariant() + "\"/>\n" +
|
prefix + "\t\t<flag name=\"status\" value=\"" + ((Rom)rom).ItemStatus.ToString().ToLowerInvariant() + "\"/>\n" +
|
||||||
prefix + "\t</flags>\n" +
|
prefix + "\t</flags>\n" +
|
||||||
@@ -1124,61 +1124,61 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
case ItemType.Archive:
|
case ItemType.Archive:
|
||||||
state += "\t\t\t<dataarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "archive" : rom.AreaName) + "\""
|
state += "\t\t\t<dataarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "archive" : rom.AreaName) + "\""
|
||||||
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : String.Empty) + ">\n"
|
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : "") + ">\n"
|
||||||
+ "\t\t\t\t<archive name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
+ "\t\t\t\t<archive name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ "/>\n"
|
+ "/>\n"
|
||||||
+ "\t\t\t</dataarea>\n";
|
+ "\t\t\t</dataarea>\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.BiosSet:
|
case ItemType.BiosSet:
|
||||||
state += "\t\t\t<dataarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "biosset" : rom.AreaName) + "\""
|
state += "\t\t\t<dataarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "biosset" : rom.AreaName) + "\""
|
||||||
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : String.Empty) + ">\n"
|
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : "") + ">\n"
|
||||||
+ "\t\t\t\t<biosset name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
+ "\t\t\t\t<biosset name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (!String.IsNullOrEmpty(((BiosSet)rom).Description) ? " description=\"" + HttpUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((BiosSet)rom).Description) ? " description=\"" + HttpUtility.HtmlEncode(((BiosSet)rom).Description) + "\"" : "")
|
||||||
+ (((BiosSet)rom).Default != null
|
+ (((BiosSet)rom).Default != null
|
||||||
? ((BiosSet)rom).Default.ToString().ToLowerInvariant()
|
? ((BiosSet)rom).Default.ToString().ToLowerInvariant()
|
||||||
: String.Empty)
|
: "")
|
||||||
+ "/>\n"
|
+ "/>\n"
|
||||||
+ "\t\t\t</dataarea>\n";
|
+ "\t\t\t</dataarea>\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Disk:
|
case ItemType.Disk:
|
||||||
state += "\t\t\t<diskarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "cdrom" : rom.AreaName) + "\""
|
state += "\t\t\t<diskarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "cdrom" : rom.AreaName) + "\""
|
||||||
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : String.Empty) + ">\n"
|
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : "") + ">\n"
|
||||||
+ "\t\t\t\t<disk name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
+ "\t\t\t\t<disk name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (!String.IsNullOrEmpty(((Disk)rom).MD5) ? " md5=\"" + ((Disk)rom).MD5.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Disk)rom).MD5) ? " md5=\"" + ((Disk)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Disk)rom).SHA1) ? " sha1=\"" + ((Disk)rom).SHA1.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Disk)rom).SHA1) ? " sha1=\"" + ((Disk)rom).SHA1.ToLowerInvariant() + "\"" : "")
|
||||||
+ (((Disk)rom).ItemStatus != ItemStatus.None ? " status=\"" + ((Disk)rom).ItemStatus.ToString().ToLowerInvariant() + "\"" : String.Empty)
|
+ (((Disk)rom).ItemStatus != ItemStatus.None ? " status=\"" + ((Disk)rom).ItemStatus.ToString().ToLowerInvariant() + "\"" : "")
|
||||||
+ "/>\n"
|
+ "/>\n"
|
||||||
+ "\t\t\t</diskarea>\n";
|
+ "\t\t\t</diskarea>\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Release:
|
case ItemType.Release:
|
||||||
state += "\t\t\t<dataarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "release" : rom.AreaName) + "\""
|
state += "\t\t\t<dataarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "release" : rom.AreaName) + "\""
|
||||||
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : String.Empty) + ">\n"
|
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : "") + ">\n"
|
||||||
+ "\t\t\t\t<release name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
+ "\t\t\t\t<release name\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Region) ? " region=\"" + HttpUtility.HtmlEncode(((Release)rom).Region) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Region) ? " region=\"" + HttpUtility.HtmlEncode(((Release)rom).Region) + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Language) ? " language=\"" + HttpUtility.HtmlEncode(((Release)rom).Language) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Language) ? " language=\"" + HttpUtility.HtmlEncode(((Release)rom).Language) + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Release)rom).Date) ? " date=\"" + HttpUtility.HtmlEncode(((Release)rom).Date) + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Release)rom).Date) ? " date=\"" + HttpUtility.HtmlEncode(((Release)rom).Date) + "\"" : "")
|
||||||
+ (((Release)rom).Default != null
|
+ (((Release)rom).Default != null
|
||||||
? ((Release)rom).Default.ToString().ToLowerInvariant()
|
? ((Release)rom).Default.ToString().ToLowerInvariant()
|
||||||
: String.Empty)
|
: "")
|
||||||
+ "/>\n"
|
+ "/>\n"
|
||||||
+ "\t\t\t</dataarea>\n";
|
+ "\t\t\t</dataarea>\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Rom:
|
case ItemType.Rom:
|
||||||
state += "\t\t\t<dataarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "rom" : rom.AreaName) + "\""
|
state += "\t\t\t<dataarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "rom" : rom.AreaName) + "\""
|
||||||
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : String.Empty) + ">\n"
|
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : "") + ">\n"
|
||||||
+ "\t\t\t\t<rom name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
+ "\t\t\t\t<rom name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ (((Rom)rom).Size != -1 ? " size=\"" + ((Rom)rom).Size + "\"" : String.Empty)
|
+ (((Rom)rom).Size != -1 ? " size=\"" + ((Rom)rom).Size + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).CRC) ? " crc=\"" + ((Rom)rom).CRC.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).CRC) ? " crc=\"" + ((Rom)rom).CRC.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).MD5) ? " md5=\"" + ((Rom)rom).MD5.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).MD5) ? " md5=\"" + ((Rom)rom).MD5.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).SHA1) ? " sha1=\"" + ((Rom)rom).SHA1.ToLowerInvariant() + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).SHA1) ? " sha1=\"" + ((Rom)rom).SHA1.ToLowerInvariant() + "\"" : "")
|
||||||
+ (!String.IsNullOrEmpty(((Rom)rom).Date) ? " date=\"" + ((Rom)rom).Date + "\"" : String.Empty)
|
+ (!String.IsNullOrEmpty(((Rom)rom).Date) ? " date=\"" + ((Rom)rom).Date + "\"" : "")
|
||||||
+ (((Rom)rom).ItemStatus != ItemStatus.None ? " status=\"" + ((Rom)rom).ItemStatus.ToString().ToLowerInvariant() + "\"" : String.Empty)
|
+ (((Rom)rom).ItemStatus != ItemStatus.None ? " status=\"" + ((Rom)rom).ItemStatus.ToString().ToLowerInvariant() + "\"" : "")
|
||||||
+ "/>\n"
|
+ "/>\n"
|
||||||
+ "\t\t\t</dataarea>\n";
|
+ "\t\t\t</dataarea>\n";
|
||||||
break;
|
break;
|
||||||
case ItemType.Sample:
|
case ItemType.Sample:
|
||||||
state += "\t\t\t<dataarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "sample" : rom.AreaName) + "\""
|
state += "\t\t\t<dataarea name=\"" + (String.IsNullOrEmpty(rom.AreaName) ? "sample" : rom.AreaName) + "\""
|
||||||
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : String.Empty) + ">\n"
|
+ (rom.AreaSize != null ? " size=\"" + rom.AreaSize + "\"" : "") + ">\n"
|
||||||
+ "\t\t\t\t<sample type=\"sample\" name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
+ "\t\t\t\t<sample type=\"sample\" name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\""
|
||||||
+ "/>\n"
|
+ "/>\n"
|
||||||
+ "\t\t\t</dataarea>\n";
|
+ "\t\t\t</dataarea>\n";
|
||||||
@@ -1194,8 +1194,8 @@ namespace SabreTools.Helper.Dats
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre = Prefix + (Quotes ? "\"" : String.Empty);
|
pre = Prefix + (Quotes ? "\"" : "");
|
||||||
post = (Quotes ? "\"" : String.Empty) + Postfix;
|
post = (Quotes ? "\"" : "") + Postfix;
|
||||||
|
|
||||||
if (rom.Type == ItemType.Rom)
|
if (rom.Type == ItemType.Rom)
|
||||||
{
|
{
|
||||||
@@ -1291,7 +1291,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string footer = String.Empty;
|
string footer = "";
|
||||||
|
|
||||||
// If we have roms, output the full footer
|
// If we have roms, output the full footer
|
||||||
if (Count > 0)
|
if (Count > 0)
|
||||||
|
|||||||
@@ -47,11 +47,11 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Release()
|
public Release()
|
||||||
{
|
{
|
||||||
_name = String.Empty;
|
_name = "";
|
||||||
_itemType = ItemType.Release;
|
_itemType = ItemType.Release;
|
||||||
_region = String.Empty;
|
_region = "";
|
||||||
_language = String.Empty;
|
_language = "";
|
||||||
_date = String.Empty;
|
_date = "";
|
||||||
_default = null;
|
_default = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Rom()
|
public Rom()
|
||||||
{
|
{
|
||||||
_name = String.Empty;
|
_name = "";
|
||||||
_itemType = ItemType.Rom;
|
_itemType = ItemType.Rom;
|
||||||
_dupeType = 0x00;
|
_dupeType = 0x00;
|
||||||
_itemStatus = ItemStatus.None;
|
_itemStatus = ItemStatus.None;
|
||||||
_date = String.Empty;
|
_date = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Sample()
|
public Sample()
|
||||||
{
|
{
|
||||||
_name = String.Empty;
|
_name = "";
|
||||||
_itemType = ItemType.Sample;
|
_itemType = ItemType.Sample;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,14 +42,14 @@ namespace NaturalSort
|
|||||||
string[] x1, y1;
|
string[] x1, y1;
|
||||||
if (!table.TryGetValue(x, out x1))
|
if (!table.TryGetValue(x, out x1))
|
||||||
{
|
{
|
||||||
//x1 = Regex.Split(x.Replace(" ", String.Empty), "([0-9]+)");
|
//x1 = Regex.Split(x.Replace(" ", ""), "([0-9]+)");
|
||||||
x1 = Regex.Split(x, "([0-9]+)").Where(s => s != String.Empty).ToArray();
|
x1 = Regex.Split(x, "([0-9]+)").Where(s => s != "").ToArray();
|
||||||
table.Add(x, x1);
|
table.Add(x, x1);
|
||||||
}
|
}
|
||||||
if (!table.TryGetValue(y, out y1))
|
if (!table.TryGetValue(y, out y1))
|
||||||
{
|
{
|
||||||
//y1 = Regex.Split(y.Replace(" ", String.Empty), "([0-9]+)");
|
//y1 = Regex.Split(y.Replace(" ", ""), "([0-9]+)");
|
||||||
y1 = Regex.Split(y, "([0-9]+)").Where(s => s != String.Empty).ToArray();
|
y1 = Regex.Split(y, "([0-9]+)").Where(s => s != "").ToArray();
|
||||||
table.Add(y, y1);
|
table.Add(y, y1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,14 +42,14 @@ namespace NaturalSort
|
|||||||
string[] x1, y1;
|
string[] x1, y1;
|
||||||
if (!table.TryGetValue(x, out x1))
|
if (!table.TryGetValue(x, out x1))
|
||||||
{
|
{
|
||||||
//x1 = Regex.Split(x.Replace(" ", String.Empty), "([0-9]+)");
|
//x1 = Regex.Split(x.Replace(" ", ""), "([0-9]+)");
|
||||||
x1 = Regex.Split(x, "([0-9]+)").Where(s => s != String.Empty).ToArray();
|
x1 = Regex.Split(x, "([0-9]+)").Where(s => s != "").ToArray();
|
||||||
table.Add(x, x1);
|
table.Add(x, x1);
|
||||||
}
|
}
|
||||||
if (!table.TryGetValue(y, out y1))
|
if (!table.TryGetValue(y, out y1))
|
||||||
{
|
{
|
||||||
//y1 = Regex.Split(y.Replace(" ", String.Empty), "([0-9]+)");
|
//y1 = Regex.Split(y.Replace(" ", ""), "([0-9]+)");
|
||||||
y1 = Regex.Split(y, "([0-9]+)").Where(s => s != String.Empty).ToArray();
|
y1 = Regex.Split(y, "([0-9]+)").Where(s => s != "").ToArray();
|
||||||
table.Add(y, y1);
|
table.Add(y, y1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace ROMVault2.SupportedFiles.Zip
|
|||||||
|
|
||||||
public string ZipFilename
|
public string ZipFilename
|
||||||
{
|
{
|
||||||
get { return (_zipFileInfo != null ? _zipFileInfo.FullName : String.Empty); }
|
get { return (_zipFileInfo != null ? _zipFileInfo.FullName : ""); }
|
||||||
}
|
}
|
||||||
public long TimeStamp
|
public long TimeStamp
|
||||||
{
|
{
|
||||||
@@ -944,7 +944,7 @@ namespace ROMVault2.SupportedFiles.Zip
|
|||||||
switch (zr)
|
switch (zr)
|
||||||
{
|
{
|
||||||
case ZipReturn.ZipGood:
|
case ZipReturn.ZipGood:
|
||||||
ret = String.Empty;
|
ret = "";
|
||||||
break;
|
break;
|
||||||
case ZipReturn.ZipFileCountError:
|
case ZipReturn.ZipFileCountError:
|
||||||
ret = "The number of file in the Zip does not mach the number of files in the Zips Centeral Directory";
|
ret = "The number of file in the Zip does not mach the number of files in the Zips Centeral Directory";
|
||||||
|
|||||||
4
SabreTools.Helper/External/Zlib/Deflate.cs
vendored
4
SabreTools.Helper/External/Zlib/Deflate.cs
vendored
@@ -153,14 +153,14 @@ namespace Ionic.Zlib
|
|||||||
{
|
{
|
||||||
"need dictionary",
|
"need dictionary",
|
||||||
"stream end",
|
"stream end",
|
||||||
String.Empty,
|
"",
|
||||||
"file error",
|
"file error",
|
||||||
"stream error",
|
"stream error",
|
||||||
"data error",
|
"data error",
|
||||||
"insufficient memory",
|
"insufficient memory",
|
||||||
"buffer error",
|
"buffer error",
|
||||||
"incompatible version",
|
"incompatible version",
|
||||||
String.Empty
|
""
|
||||||
};
|
};
|
||||||
|
|
||||||
// preset dictionary flag in zlib header
|
// preset dictionary flag in zlib header
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ namespace SabreTools.Helper
|
|||||||
// USER and ERROR writes to console
|
// USER and ERROR writes to console
|
||||||
if (loglevel == LogLevel.USER || loglevel == LogLevel.ERROR)
|
if (loglevel == LogLevel.USER || loglevel == LogLevel.ERROR)
|
||||||
{
|
{
|
||||||
Console.WriteLine((loglevel == LogLevel.ERROR && appendPrefix ? loglevel.ToString() + " " : String.Empty) + output);
|
Console.WriteLine((loglevel == LogLevel.ERROR && appendPrefix ? loglevel.ToString() + " " : "") + output);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're writing to file, use the existing stream
|
// If we're writing to file, use the existing stream
|
||||||
@@ -169,7 +169,7 @@ namespace SabreTools.Helper
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_log.WriteLine((appendPrefix ? loglevel.ToString() + " - " + DateTime.Now + " - " : String.Empty ) + output);
|
_log.WriteLine((appendPrefix ? loglevel.ToString() + " - " + DateTime.Now + " - " : "" ) + output);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns=String.Empty xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns=String.Empty xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns=String.Empty xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns=String.Empty xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
|
|||||||
@@ -55,11 +55,11 @@ namespace SabreTools.Helper.Skippers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Skipper()
|
public Skipper()
|
||||||
{
|
{
|
||||||
Name = String.Empty;
|
Name = "";
|
||||||
Author = String.Empty;
|
Author = "";
|
||||||
Version = String.Empty;
|
Version = "";
|
||||||
Rules = new List<SkipperRule>();
|
Rules = new List<SkipperRule>();
|
||||||
SourceFile = String.Empty;
|
SourceFile = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public static string ExtractItem(string input, string entryName, string tempDir, Logger logger)
|
public static string ExtractItem(string input, string entryName, string tempDir, Logger logger)
|
||||||
{
|
{
|
||||||
string realEntry = String.Empty;
|
string realEntry = "";
|
||||||
Stream ms = ExtractStream(input, entryName, out realEntry, logger);
|
Stream ms = ExtractStream(input, entryName, out realEntry, logger);
|
||||||
|
|
||||||
// If we got out a null or empty entry, then we don't have a stream
|
// If we got out a null or empty entry, then we don't have a stream
|
||||||
@@ -265,7 +265,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
public static Stream ExtractStream(string input, string entryName, out string realEntry, Logger logger)
|
public static Stream ExtractStream(string input, string entryName, out string realEntry, Logger logger)
|
||||||
{
|
{
|
||||||
// Set the real entry name
|
// Set the real entry name
|
||||||
realEntry = String.Empty;
|
realEntry = "";
|
||||||
|
|
||||||
// Get a writable stream to return
|
// Get a writable stream to return
|
||||||
Stream st = new MemoryStream();
|
Stream st = new MemoryStream();
|
||||||
@@ -433,7 +433,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
{
|
{
|
||||||
logger.Verbose("Found archive of type: " + at);
|
logger.Verbose("Found archive of type: " + at);
|
||||||
long size = 0;
|
long size = 0;
|
||||||
string crc = String.Empty;
|
string crc = "";
|
||||||
|
|
||||||
switch (at)
|
switch (at)
|
||||||
{
|
{
|
||||||
@@ -445,14 +445,14 @@ namespace SabreTools.Helper.Tools
|
|||||||
{
|
{
|
||||||
logger.Verbose("Entry found: '" + entry.Key + "': "
|
logger.Verbose("Entry found: '" + entry.Key + "': "
|
||||||
+ (size == 0 ? entry.Size : size) + ", "
|
+ (size == 0 ? entry.Size : size) + ", "
|
||||||
+ (crc == String.Empty ? entry.Crc.ToString("X").ToLowerInvariant() : crc));
|
+ (crc == "" ? entry.Crc.ToString("X").ToLowerInvariant() : crc));
|
||||||
|
|
||||||
roms.Add(new Rom
|
roms.Add(new Rom
|
||||||
{
|
{
|
||||||
Type = ItemType.Rom,
|
Type = ItemType.Rom,
|
||||||
Name = entry.Key,
|
Name = entry.Key,
|
||||||
Size = (size == 0 ? entry.Size : size),
|
Size = (size == 0 ? entry.Size : size),
|
||||||
CRC = (crc == String.Empty ? entry.Crc.ToString("X").ToLowerInvariant() : crc),
|
CRC = (crc == "" ? entry.Crc.ToString("X").ToLowerInvariant() : crc),
|
||||||
|
|
||||||
Machine = new Machine
|
Machine = new Machine
|
||||||
{
|
{
|
||||||
@@ -481,14 +481,14 @@ namespace SabreTools.Helper.Tools
|
|||||||
{
|
{
|
||||||
logger.Verbose("Entry found: '" + entry.Key + "': "
|
logger.Verbose("Entry found: '" + entry.Key + "': "
|
||||||
+ (size == 0 ? entry.Size : size) + ", "
|
+ (size == 0 ? entry.Size : size) + ", "
|
||||||
+ (crc == String.Empty ? entry.Crc.ToString("X").ToLowerInvariant() : crc));
|
+ (crc == "" ? entry.Crc.ToString("X").ToLowerInvariant() : crc));
|
||||||
|
|
||||||
roms.Add(new Rom
|
roms.Add(new Rom
|
||||||
{
|
{
|
||||||
Type = ItemType.Rom,
|
Type = ItemType.Rom,
|
||||||
Name = entry.Key,
|
Name = entry.Key,
|
||||||
Size = (size == 0 ? entry.Size : size),
|
Size = (size == 0 ? entry.Size : size),
|
||||||
CRC = (crc == String.Empty ? entry.Crc.ToString("X").ToLowerInvariant() : crc),
|
CRC = (crc == "" ? entry.Crc.ToString("X").ToLowerInvariant() : crc),
|
||||||
|
|
||||||
Machine = new Machine
|
Machine = new Machine
|
||||||
{
|
{
|
||||||
@@ -507,14 +507,14 @@ namespace SabreTools.Helper.Tools
|
|||||||
{
|
{
|
||||||
logger.Verbose("Entry found: '" + entry.Key + "': "
|
logger.Verbose("Entry found: '" + entry.Key + "': "
|
||||||
+ (size == 0 ? entry.Size : size) + ", "
|
+ (size == 0 ? entry.Size : size) + ", "
|
||||||
+ (crc == String.Empty ? entry.Crc.ToString("X").ToLowerInvariant() : crc));
|
+ (crc == "" ? entry.Crc.ToString("X").ToLowerInvariant() : crc));
|
||||||
|
|
||||||
roms.Add(new Rom
|
roms.Add(new Rom
|
||||||
{
|
{
|
||||||
Type = ItemType.Rom,
|
Type = ItemType.Rom,
|
||||||
Name = entry.Key,
|
Name = entry.Key,
|
||||||
Size = (size == 0 ? entry.Size : size),
|
Size = (size == 0 ? entry.Size : size),
|
||||||
CRC = (crc == String.Empty ? entry.Crc.ToString("X").ToLowerInvariant() : crc),
|
CRC = (crc == "" ? entry.Crc.ToString("X").ToLowerInvariant() : crc),
|
||||||
|
|
||||||
Machine = new Machine
|
Machine = new Machine
|
||||||
{
|
{
|
||||||
@@ -1119,7 +1119,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the output archive name from the first rebuild rom
|
// Get the output archive name from the first rebuild rom
|
||||||
string archiveFileName = Path.Combine(outDir, Style.RemovePathUnsafeCharacters(roms[0].Machine.Name) + (roms[0].Machine.Name.EndsWith(".tar") ? String.Empty : ".tar"));
|
string archiveFileName = Path.Combine(outDir, Style.RemovePathUnsafeCharacters(roms[0].Machine.Name) + (roms[0].Machine.Name.EndsWith(".tar") ? "" : ".tar"));
|
||||||
|
|
||||||
// Set internal variables
|
// Set internal variables
|
||||||
Stream tarstream = new MemoryStream();
|
Stream tarstream = new MemoryStream();
|
||||||
@@ -1445,7 +1445,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the output archive name from the first rebuild rom
|
// Get the output archive name from the first rebuild rom
|
||||||
string archiveFileName = Path.Combine(outDir, Style.RemovePathUnsafeCharacters(roms[0].Machine.Name) + (roms[0].Machine.Name.EndsWith(".zip") ? String.Empty : ".zip"));
|
string archiveFileName = Path.Combine(outDir, Style.RemovePathUnsafeCharacters(roms[0].Machine.Name) + (roms[0].Machine.Name.EndsWith(".zip") ? "" : ".zip"));
|
||||||
|
|
||||||
// Set internal variables
|
// Set internal variables
|
||||||
Stream writeStream = null;
|
Stream writeStream = null;
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Read the input file, if possible
|
// Read the input file, if possible
|
||||||
logger.Verbose("Attempting to read file to get format: "" + filename + """);
|
logger.Verbose("Attempting to read file to get format: \"" + filename + "\"");
|
||||||
|
|
||||||
// Check if file exists
|
// Check if file exists
|
||||||
if (!File.Exists(filename))
|
if (!File.Exists(filename))
|
||||||
@@ -224,7 +224,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
|
|
||||||
// Add unique data from the file
|
// Add unique data from the file
|
||||||
rom.Name = Path.GetFileName(input);
|
rom.Name = Path.GetFileName(input);
|
||||||
rom.Date = (date ? new FileInfo(input).LastWriteTime.ToString("yyyy/MM/dd HH:mm:ss") : String.Empty);
|
rom.Date = (date ? new FileInfo(input).LastWriteTime.ToString("yyyy/MM/dd HH:mm:ss") : "");
|
||||||
|
|
||||||
return rom;
|
return rom;
|
||||||
}
|
}
|
||||||
@@ -315,7 +315,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
public static bool DetectSkipperAndTransform(string file, string outDir, Logger logger)
|
public static bool DetectSkipperAndTransform(string file, string outDir, Logger logger)
|
||||||
{
|
{
|
||||||
// Create the output directory if it doesn't exist
|
// Create the output directory if it doesn't exist
|
||||||
if (outDir != String.Empty && !Directory.Exists(outDir))
|
if (outDir != "" && !Directory.Exists(outDir))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(outDir);
|
Directory.CreateDirectory(outDir);
|
||||||
}
|
}
|
||||||
@@ -323,7 +323,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
logger.User("\nGetting skipper information for '" + file + "'");
|
logger.User("\nGetting skipper information for '" + file + "'");
|
||||||
|
|
||||||
// Get the skipper rule that matches the file, if any
|
// Get the skipper rule that matches the file, if any
|
||||||
SkipperRule rule = Skipper.GetMatchingRule(file, String.Empty, logger);
|
SkipperRule rule = Skipper.GetMatchingRule(file, "", logger);
|
||||||
|
|
||||||
// If we have an empty rule, return false
|
// If we have an empty rule, return false
|
||||||
if (rule.Tests == null || rule.Tests.Count == 0 || rule.Operation != HeaderSkipOperation.None)
|
if (rule.Tests == null || rule.Tests.Count == 0 || rule.Operation != HeaderSkipOperation.None)
|
||||||
@@ -346,7 +346,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
br.Dispose();
|
br.Dispose();
|
||||||
|
|
||||||
// Apply the rule to the file
|
// Apply the rule to the file
|
||||||
string newfile = (outDir == String.Empty ? Path.GetFullPath(file) + ".new" : Path.Combine(outDir, Path.GetFileName(file)));
|
string newfile = (outDir == "" ? Path.GetFullPath(file) + ".new" : Path.Combine(outDir, Path.GetFileName(file)));
|
||||||
rule.TransformFile(file, newfile, logger);
|
rule.TransformFile(file, newfile, logger);
|
||||||
|
|
||||||
// If the output file doesn't exist, return false
|
// If the output file doesn't exist, return false
|
||||||
@@ -385,7 +385,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
outputs.Add(Path.GetFullPath(file) + (appendparent ? "¬" + Path.GetFullPath(input) : String.Empty));
|
outputs.Add(Path.GetFullPath(file) + (appendparent ? "¬" + Path.GetFullPath(input) : ""));
|
||||||
}
|
}
|
||||||
catch (PathTooLongException)
|
catch (PathTooLongException)
|
||||||
{
|
{
|
||||||
@@ -401,7 +401,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
outputs.Add(Path.GetFullPath(input) + (appendparent ? "¬" + Path.GetFullPath(input) : String.Empty));
|
outputs.Add(Path.GetFullPath(input) + (appendparent ? "¬" + Path.GetFullPath(input) : ""));
|
||||||
}
|
}
|
||||||
catch (PathTooLongException)
|
catch (PathTooLongException)
|
||||||
{
|
{
|
||||||
@@ -437,7 +437,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
/// <returns>The XmlTextReader representing the (possibly converted) file, null otherwise</returns>
|
/// <returns>The XmlTextReader representing the (possibly converted) file, null otherwise</returns>
|
||||||
public static XmlReader GetXmlTextReader(string filename, Logger logger)
|
public static XmlReader GetXmlTextReader(string filename, Logger logger)
|
||||||
{
|
{
|
||||||
logger.Verbose("Attempting to read file: "" + filename + """);
|
logger.Verbose("Attempting to read file: \"" + filename + "\"");
|
||||||
|
|
||||||
// Check if file exists
|
// Check if file exists
|
||||||
if (!File.Exists(filename))
|
if (!File.Exists(filename))
|
||||||
@@ -494,7 +494,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
public static bool RestoreHeader(string file, string outDir, Logger logger)
|
public static bool RestoreHeader(string file, string outDir, Logger logger)
|
||||||
{
|
{
|
||||||
// Create the output directory if it doesn't exist
|
// Create the output directory if it doesn't exist
|
||||||
if (outDir != String.Empty && !Directory.Exists(outDir))
|
if (outDir != "" && !Directory.Exists(outDir))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(outDir);
|
Directory.CreateDirectory(outDir);
|
||||||
}
|
}
|
||||||
@@ -515,9 +515,9 @@ namespace SabreTools.Helper.Tools
|
|||||||
for (int i = 0; i < headers.Count; i++)
|
for (int i = 0; i < headers.Count; i++)
|
||||||
{
|
{
|
||||||
logger.User("Creating reheadered file: " +
|
logger.User("Creating reheadered file: " +
|
||||||
(outDir == String.Empty ? Path.GetFullPath(file) + ".new" : Path.Combine(outDir, Path.GetFileName(file))) + i);
|
(outDir == "" ? Path.GetFullPath(file) + ".new" : Path.Combine(outDir, Path.GetFileName(file))) + i);
|
||||||
AppendBytesToFile(file,
|
AppendBytesToFile(file,
|
||||||
(outDir == String.Empty ? Path.GetFullPath(file) + ".new" : Path.Combine(outDir, Path.GetFileName(file))) + i, headers[i], string.Empty);
|
(outDir == "" ? Path.GetFullPath(file) + ".new" : Path.Combine(outDir, Path.GetFileName(file))) + i, headers[i], string.Empty);
|
||||||
logger.User("Reheadered file created!");
|
logger.User("Reheadered file created!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -587,12 +587,12 @@ namespace SabreTools.Helper.Tools
|
|||||||
if (!noMD5)
|
if (!noMD5)
|
||||||
{
|
{
|
||||||
md5.TransformFinalBlock(buffer, 0, 0);
|
md5.TransformFinalBlock(buffer, 0, 0);
|
||||||
rom.MD5 = BitConverter.ToString(md5.Hash).Replace("-", String.Empty).ToLowerInvariant();
|
rom.MD5 = BitConverter.ToString(md5.Hash).Replace("-", "").ToLowerInvariant();
|
||||||
}
|
}
|
||||||
if (!noSHA1)
|
if (!noSHA1)
|
||||||
{
|
{
|
||||||
sha1.TransformFinalBlock(buffer, 0, 0);
|
sha1.TransformFinalBlock(buffer, 0, 0);
|
||||||
rom.SHA1 = BitConverter.ToString(sha1.Hash).Replace("-", String.Empty).ToLowerInvariant();
|
rom.SHA1 = BitConverter.ToString(sha1.Hash).Replace("-", "").ToLowerInvariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dispose of the hashers
|
// Dispose of the hashers
|
||||||
|
|||||||
@@ -67,16 +67,16 @@ namespace SabreTools.Helper.Tools
|
|||||||
public static string CleanHashData(string hash, int padding)
|
public static string CleanHashData(string hash, int padding)
|
||||||
{
|
{
|
||||||
// First get the hash to the correct length
|
// First get the hash to the correct length
|
||||||
hash = (String.IsNullOrEmpty(hash) ? String.Empty : hash.Trim());
|
hash = (String.IsNullOrEmpty(hash) ? "" : hash.Trim());
|
||||||
hash = (hash.StartsWith("0x") ? hash.Remove(0, 2) : hash);
|
hash = (hash.StartsWith("0x") ? hash.Remove(0, 2) : hash);
|
||||||
hash = (hash == "-" ? String.Empty : hash);
|
hash = (hash == "-" ? "" : hash);
|
||||||
hash = (String.IsNullOrEmpty(hash) ? String.Empty : hash.PadLeft(padding, '0'));
|
hash = (String.IsNullOrEmpty(hash) ? "" : hash.PadLeft(padding, '0'));
|
||||||
hash = hash.ToLowerInvariant();
|
hash = hash.ToLowerInvariant();
|
||||||
|
|
||||||
// Then make sure that it has the correct characters
|
// Then make sure that it has the correct characters
|
||||||
if (!Regex.IsMatch(hash, "[0-9a-f]{" + padding + "}"))
|
if (!Regex.IsMatch(hash, "[0-9a-f]{" + padding + "}"))
|
||||||
{
|
{
|
||||||
hash = String.Empty;
|
hash = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return hash;
|
return hash;
|
||||||
@@ -418,15 +418,15 @@ namespace SabreTools.Helper.Tools
|
|||||||
{
|
{
|
||||||
// Preprocess the string
|
// Preprocess the string
|
||||||
s = s.Trim();
|
s = s.Trim();
|
||||||
s = Regex.Replace(s, @"^\S* \(", String.Empty); // Remove item identifier and opening brace
|
s = Regex.Replace(s, @"^\S* \(", ""); // Remove item identifier and opening brace
|
||||||
s = Regex.Replace(s, @"\)\S*#.*$", String.Empty); // Remove trailing comments
|
s = Regex.Replace(s, @"\)\S*#.*$", ""); // Remove trailing comments
|
||||||
s = s.TrimEnd(')'); // Remove closing brace
|
s = s.TrimEnd(')'); // Remove closing brace
|
||||||
s = s.Trim(); // Remove leading and trailing whitespace
|
s = s.Trim(); // Remove leading and trailing whitespace
|
||||||
|
|
||||||
// Now we get each string, divided up as cleanly as possible
|
// Now we get each string, divided up as cleanly as possible
|
||||||
string[] matches = Regex
|
string[] matches = Regex
|
||||||
//.Matches(s, @"([^\s]*String.Empty[^String.Empty]+String.Empty[^\s]*)|[^String.Empty]?\w+[^String.Empty]?")
|
//.Matches(s, @"([^\s]*""[^""]+""[^\s]*)|[^""]?\w+[^""]?")
|
||||||
.Matches(s, @"[^\sString.Empty]+|String.Empty[^String.Empty]*String.Empty")
|
.Matches(s, @"[^\s""]+|""[^""]*""")
|
||||||
.Cast<Match>()
|
.Cast<Match>()
|
||||||
.Select(m => m.Groups[0].Value)
|
.Select(m => m.Groups[0].Value)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
@@ -448,7 +448,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
{
|
{
|
||||||
if (s == null)
|
if (s == null)
|
||||||
{
|
{
|
||||||
return String.Empty;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.Contains("/"))
|
if (s.Contains("/"))
|
||||||
@@ -462,7 +462,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
return String.Join("\\", tempkey.Take(tempkey.Length - 1));
|
return String.Join("\\", tempkey.Take(tempkey.Length - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
return String.Empty;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -475,7 +475,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
{
|
{
|
||||||
if (s == null)
|
if (s == null)
|
||||||
{
|
{
|
||||||
return String.Empty;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.Contains("/"))
|
if (s.Contains("/"))
|
||||||
@@ -575,14 +575,14 @@ namespace SabreTools.Helper.Tools
|
|||||||
{ "Й", "J" }, { "К", "K" }, { "Л", "L" }, { "М", "M" }, { "Н", "N" },
|
{ "Й", "J" }, { "К", "K" }, { "Л", "L" }, { "М", "M" }, { "Н", "N" },
|
||||||
{ "О", "O" }, { "П", "P" }, { "Р", "R" }, { "С", "S" }, { "Т", "T" },
|
{ "О", "O" }, { "П", "P" }, { "Р", "R" }, { "С", "S" }, { "Т", "T" },
|
||||||
{ "У", "U" }, { "Ф", "f" }, { "Х", "Kh" }, { "Ц", "Ts" }, { "Ч", "Ch" },
|
{ "У", "U" }, { "Ф", "f" }, { "Х", "Kh" }, { "Ц", "Ts" }, { "Ч", "Ch" },
|
||||||
{ "Ш", "Sh" }, { "Щ", "Sch" }, { "Ъ", String.Empty }, { "Ы", "y" }, { "Ь", String.Empty },
|
{ "Ш", "Sh" }, { "Щ", "Sch" }, { "Ъ", "" }, { "Ы", "y" }, { "Ь", "" },
|
||||||
{ "Э", "e" }, { "Ю", "yu" }, { "Я", "ya" }, { "а", "a" }, { "б", "b" },
|
{ "Э", "e" }, { "Ю", "yu" }, { "Я", "ya" }, { "а", "a" }, { "б", "b" },
|
||||||
{ "в", "v" }, { "г", "g" }, { "д", "d" }, { "е", "e" }, { "ё", "yo" },
|
{ "в", "v" }, { "г", "g" }, { "д", "d" }, { "е", "e" }, { "ё", "yo" },
|
||||||
{ "ж", "zh" }, { "з", "z" }, { "и", "i" }, { "й", "j" }, { "к", "k" },
|
{ "ж", "zh" }, { "з", "z" }, { "и", "i" }, { "й", "j" }, { "к", "k" },
|
||||||
{ "л", "l" }, { "м", "m" }, { "н", "n" }, { "о", "o" }, { "п", "p" },
|
{ "л", "l" }, { "м", "m" }, { "н", "n" }, { "о", "o" }, { "п", "p" },
|
||||||
{ "р", "r" }, { "с", "s" }, { "т", "t" }, { "у", "u" }, { "ф", "f" },
|
{ "р", "r" }, { "с", "s" }, { "т", "t" }, { "у", "u" }, { "ф", "f" },
|
||||||
{ "х", "kh" }, { "ц", "ts" }, { "ч", "ch" }, { "ш", "sh" }, { "щ", "sch" },
|
{ "х", "kh" }, { "ц", "ts" }, { "ч", "ch" }, { "ш", "sh" }, { "щ", "sch" },
|
||||||
{ "ъ", String.Empty }, { "ы", "y" }, { "ь", String.Empty }, { "э", "e" }, { "ю", "yu" },
|
{ "ъ", "" }, { "ы", "y" }, { "ь", "" }, { "э", "e" }, { "ю", "yu" },
|
||||||
{ "я", "ya" },
|
{ "я", "ya" },
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -715,7 +715,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
{
|
{
|
||||||
if (hexString.Contains("-"))
|
if (hexString.Contains("-"))
|
||||||
{
|
{
|
||||||
hexString = hexString.Replace("-", String.Empty);
|
hexString = hexString.Replace("-", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
@@ -734,7 +734,7 @@ namespace SabreTools.Helper.Tools
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static string ConvertAsciiToHex(string asciiString)
|
public static string ConvertAsciiToHex(string asciiString)
|
||||||
{
|
{
|
||||||
string hexOutput = String.Empty;
|
string hexOutput = "";
|
||||||
foreach (char _eachChar in asciiString.ToCharArray())
|
foreach (char _eachChar in asciiString.ToCharArray())
|
||||||
{
|
{
|
||||||
// Get the integral value of the character.
|
// Get the integral value of the character.
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ namespace SabreTools
|
|||||||
DatFormat = (datFormat == 0 ? DatFormat.Logiqx : datFormat),
|
DatFormat = (datFormat == 0 ? DatFormat.Logiqx : datFormat),
|
||||||
Romba = romba,
|
Romba = romba,
|
||||||
ExcludeOf = excludeOf,
|
ExcludeOf = excludeOf,
|
||||||
Type = (superdat ? "SuperDAT" : String.Empty),
|
Type = (superdat ? "SuperDAT" : ""),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Clean the temp directory
|
// Clean the temp directory
|
||||||
@@ -707,34 +707,34 @@ namespace SabreTools
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Normalize the extensions
|
// Normalize the extensions
|
||||||
addext = (addext == String.Empty || addext.StartsWith(".") ? addext : "." + addext);
|
addext = (addext == "" || addext.StartsWith(".") ? addext : "." + addext);
|
||||||
repext = (repext == String.Empty || repext.StartsWith(".") ? repext : "." + repext);
|
repext = (repext == "" || repext.StartsWith(".") ? repext : "." + repext);
|
||||||
|
|
||||||
// If we're in merge or diff mode and the names aren't set, set defaults
|
// If we're in merge or diff mode and the names aren't set, set defaults
|
||||||
if (merge || diffMode != 0)
|
if (merge || diffMode != 0)
|
||||||
{
|
{
|
||||||
// Get the values that will be used
|
// Get the values that will be used
|
||||||
if (date == String.Empty)
|
if (date == "")
|
||||||
{
|
{
|
||||||
date = DateTime.Now.ToString("yyyy-MM-dd");
|
date = DateTime.Now.ToString("yyyy-MM-dd");
|
||||||
}
|
}
|
||||||
if (name == String.Empty)
|
if (name == "")
|
||||||
{
|
{
|
||||||
name = (diffMode != 0 ? "DiffDAT" : "MergeDAT") + (superdat ? "-SuperDAT" : String.Empty) + (dedup ? "-deduped" : String.Empty);
|
name = (diffMode != 0 ? "DiffDAT" : "MergeDAT") + (superdat ? "-SuperDAT" : "") + (dedup ? "-deduped" : "");
|
||||||
}
|
}
|
||||||
if (description == String.Empty)
|
if (description == "")
|
||||||
{
|
{
|
||||||
description = (diffMode != 0 ? "DiffDAT" : "MergeDAT") + (superdat ? "-SuperDAT" : String.Empty) + (dedup ? " - deduped" : String.Empty);
|
description = (diffMode != 0 ? "DiffDAT" : "MergeDAT") + (superdat ? "-SuperDAT" : "") + (dedup ? " - deduped" : "");
|
||||||
if (!bare)
|
if (!bare)
|
||||||
{
|
{
|
||||||
description += " (" + date + ")";
|
description += " (" + date + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (category == String.Empty && diffMode != 0)
|
if (category == "" && diffMode != 0)
|
||||||
{
|
{
|
||||||
category = "DiffDAT";
|
category = "DiffDAT";
|
||||||
}
|
}
|
||||||
if (author == String.Empty)
|
if (author == "")
|
||||||
{
|
{
|
||||||
author = "SabreTools";
|
author = "SabreTools";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ using System.Runtime.InteropServices;
|
|||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("SabreTools")]
|
[assembly: AssemblyTitle("SabreTools")]
|
||||||
[assembly: AssemblyDescription("DAT manipulation toolset")]
|
[assembly: AssemblyDescription("DAT manipulation toolset")]
|
||||||
[assembly: AssemblyConfiguration(String.Empty)]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany(String.Empty)]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("SabreTools")]
|
[assembly: AssemblyProduct("SabreTools")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||||
[assembly: AssemblyTrademark(String.Empty)]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture(String.Empty)]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ namespace SabreTools
|
|||||||
long sgt = -1,
|
long sgt = -1,
|
||||||
slt = -1,
|
slt = -1,
|
||||||
seq = -1;
|
seq = -1;
|
||||||
string addext = String.Empty,
|
string addext = "",
|
||||||
author = null,
|
author = null,
|
||||||
category = null,
|
category = null,
|
||||||
comment = null,
|
comment = null,
|
||||||
@@ -126,19 +126,19 @@ namespace SabreTools
|
|||||||
exta = null,
|
exta = null,
|
||||||
extb = null,
|
extb = null,
|
||||||
filename = null,
|
filename = null,
|
||||||
forcemerge = String.Empty,
|
forcemerge = "",
|
||||||
forcend = String.Empty,
|
forcend = "",
|
||||||
forcepack = String.Empty,
|
forcepack = "",
|
||||||
header = null,
|
header = null,
|
||||||
homepage = null,
|
homepage = null,
|
||||||
name = null,
|
name = null,
|
||||||
outDir = String.Empty,
|
outDir = "",
|
||||||
postfix = String.Empty,
|
postfix = "",
|
||||||
prefix = String.Empty,
|
prefix = "",
|
||||||
repext = String.Empty,
|
repext = "",
|
||||||
root = String.Empty,
|
root = "",
|
||||||
rootdir = null,
|
rootdir = null,
|
||||||
tempDir = String.Empty,
|
tempDir = "",
|
||||||
url = null,
|
url = null,
|
||||||
version = null;
|
version = null;
|
||||||
List<string> crc = new List<string>();
|
List<string> crc = new List<string>();
|
||||||
@@ -722,7 +722,7 @@ namespace SabreTools
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
string temparg = args[i].Replace("\"", String.Empty).Replace("file://", String.Empty);
|
string temparg = args[i].Replace("\"", "").Replace("file://", "");
|
||||||
|
|
||||||
if (temparg.StartsWith("-") && temparg.Contains("="))
|
if (temparg.StartsWith("-") && temparg.Contains("="))
|
||||||
{
|
{
|
||||||
@@ -730,7 +730,7 @@ namespace SabreTools
|
|||||||
string[] split = temparg.Split('=');
|
string[] split = temparg.Split('=');
|
||||||
if (split[1] == null)
|
if (split[1] == null)
|
||||||
{
|
{
|
||||||
split[1] = String.Empty;
|
split[1] = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (split[0])
|
switch (split[0])
|
||||||
|
|||||||
Reference in New Issue
Block a user