Make sure things have tabs instead of spaces

This commit is contained in:
Matt Nadareski
2016-04-04 23:11:29 -07:00
parent 5563f4c63b
commit a5c776a792
6 changed files with 22 additions and 22 deletions

View File

@@ -79,7 +79,7 @@ namespace SabreTools
// Check to see if the source is an import-only. If so, tell the user and exit // Check to see if the source is an import-only. If so, tell the user and exit
int id = 0; int id = 0;
if (_sources != "" && Int32.TryParse(_sources, out id) && id <= 14) if (_sources != "" && Int32.TryParse(_sources, out id) && id <= 14)
{ {
_logger.Warning("This source (" + id + ") is import-only so a DAT cannot be created. We apologize for the inconvenience."); _logger.Warning("This source (" + id + ") is import-only so a DAT cannot be created. We apologize for the inconvenience.");
return false; return false;
} }
@@ -272,7 +272,7 @@ namespace SabreTools
sw.Write((_old ? ")" : "\t</machine>\n</datafile>")); sw.Write((_old ? ")" : "\t</machine>\n</datafile>"));
_logger.Log("File written!"); _logger.Log("File written!");
sw.Close(); sw.Close();
fs.Close(); fs.Close();
} }
catch (Exception ex) catch (Exception ex)
@@ -289,7 +289,7 @@ namespace SabreTools
/// </summary> /// </summary>
/// <remarks>To make this even more accurate, files with a more recent "LastUpdated" should be considered the parent if all else is the same.</remarks> /// <remarks>To make this even more accurate, files with a more recent "LastUpdated" should be considered the parent if all else is the same.</remarks>
/// <returns>A List of RomData objects containing all information about the files</returns> /// <returns>A List of RomData objects containing all information about the files</returns>
public List<RomData> ProcessRoms() public List<RomData> ProcessRoms()
{ {
List<RomData> roms = new List<RomData>(); List<RomData> roms = new List<RomData>();

View File

@@ -47,7 +47,7 @@ namespace SabreTools
// Regex File Name Patterns // Regex File Name Patterns
private static string _defaultPattern = @"^(.+?) - (.+?) \((.*) (.*)\)\.dat$"; private static string _defaultPattern = @"^(.+?) - (.+?) \((.*) (.*)\)\.dat$";
private static string _mamePattern = @"^(.*)\.xml$"; private static string _mamePattern = @"^(.*)\.xml$";
private static string _noIntroPattern = @"^(.*?) \((\d{8}-\d{6})_CM\)\.dat$"; private static string _noIntroPattern = @"^(.*?) \((\d{8}-\d{6})_CM\)\.dat$";
private static string _noIntroNumberedPattern = @"(.*? - .*?) \(.*?_CM\).dat"; private static string _noIntroNumberedPattern = @"(.*? - .*?) \(.*?_CM\).dat";
private static string _noIntroSpecialPattern = @"(.*? - .*?) \((\d{8})\)\.dat"; private static string _noIntroSpecialPattern = @"(.*? - .*?) \((\d{8})\)\.dat";
private static string _redumpPattern = @"^(.*?) \((\d{8} \d{2}-\d{2}-\d{2})\)\.dat$"; private static string _redumpPattern = @"^(.*?) \((\d{8} \d{2}-\d{2}-\d{2})\)\.dat$";
@@ -224,7 +224,7 @@ namespace SabreTools
datestring = fileinfo[2].Value; datestring = fileinfo[2].Value;
GroupCollection niDateInfo = Regex.Match(datestring, _noIntroSpecialDatePattern).Groups; GroupCollection niDateInfo = Regex.Match(datestring, _noIntroSpecialDatePattern).Groups;
date = niDateInfo[1].Value + "-" + niDateInfo[2].Value + "-" + niDateInfo[3].Value + " 00:00:00"; date = niDateInfo[1].Value + "-" + niDateInfo[2].Value + "-" + niDateInfo[3].Value + " 00:00:00";
} }
break; break;
case DatType.Redump: case DatType.Redump:
if (!Remapping.Redump.ContainsKey(fileinfo[1].Value)) if (!Remapping.Redump.ContainsKey(fileinfo[1].Value))
@@ -373,7 +373,7 @@ namespace SabreTools
{ {
node = node.NextSibling; node = node.NextSibling;
} }
} }
// Once we find the main body, enter it // Once we find the main body, enter it
if (node != null && (node.Name == "datafile" || node.Name == "softwarelist")) if (node != null && (node.Name == "datafile" || node.Name == "softwarelist"))
@@ -406,15 +406,15 @@ namespace SabreTools
if (node.Name == "software") if (node.Name == "software")
{ {
tempname = node.SelectSingleNode("description").InnerText; tempname = node.SelectSingleNode("description").InnerText;
} }
else else
{ {
// There are rare cases where a malformed XML will not have the required attributes. We can only skip them. // There are rare cases where a malformed XML will not have the required attributes. We can only skip them.
if (node.Attributes.Count == 0) if (node.Attributes.Count == 0)
{ {
_logger.Error(@"A node with malformed XML has been found! _logger.Error(@"A node with malformed XML has been found!
For RV DATs, please make sure that all names and descriptions are quoted. For RV DATs, please make sure that all names and descriptions are quoted.
For XML DATs, make sure that the DAT has all required information."); For XML DATs, make sure that the DAT has all required information.");
node = node.NextSibling; node = node.NextSibling;
continue; continue;
} }
@@ -446,7 +446,7 @@ namespace SabreTools
else if (child.Attributes["size"] != null) else if (child.Attributes["size"] != null)
{ {
size = Int64.Parse(child.Attributes["size"].Value); size = Int64.Parse(child.Attributes["size"].Value);
} }
AddRom( AddRom(
child.Name, child.Name,
@@ -457,7 +457,7 @@ namespace SabreTools
(child.Attributes["crc"] != null ? child.Attributes["crc"].Value.ToLowerInvariant().Trim() : ""), (child.Attributes["crc"] != null ? child.Attributes["crc"].Value.ToLowerInvariant().Trim() : ""),
(child.Attributes["md5"] != null ? child.Attributes["md5"].Value.ToLowerInvariant().Trim() : ""), (child.Attributes["md5"] != null ? child.Attributes["md5"].Value.ToLowerInvariant().Trim() : ""),
(child.Attributes["sha1"] != null ? child.Attributes["sha1"].Value.ToLowerInvariant().Trim() : "") (child.Attributes["sha1"] != null ? child.Attributes["sha1"].Value.ToLowerInvariant().Trim() : "")
); );
} }
// If we find the signs of a software list, traverse the children // If we find the signs of a software list, traverse the children
else if (child.NodeType == XmlNodeType.Element && child.Name == "part" && child.HasChildNodes) else if (child.NodeType == XmlNodeType.Element && child.Name == "part" && child.HasChildNodes)
@@ -605,10 +605,10 @@ SELECT files.id FROM files
WHERE files.name='" + name.Replace("'", "''") + @"' WHERE files.name='" + name.Replace("'", "''") + @"'
AND files.type='" + romtype + @"' AND files.type='" + romtype + @"'
AND files.setid=" + gameid + " " + AND files.setid=" + gameid + " " +
" AND checksums.size=" + size + " AND checksums.size=" + size +
" AND checksums.crc='" + crc + "'" + " AND checksums.crc='" + crc + "'" +
" AND checksums.md5='" + md5 + "'" + " AND checksums.md5='" + md5 + "'" +
" AND checksums.sha1='" + sha1 + "'"; " AND checksums.sha1='" + sha1 + "'";
using (SQLiteConnection dbc = new SQLiteConnection(_connectionString)) using (SQLiteConnection dbc = new SQLiteConnection(_connectionString))
{ {
dbc.Open(); dbc.Open();

View File

@@ -554,7 +554,7 @@ Make a selection:
JOIN sources JOIN sources
ON games.source=sources.id ON games.source=sources.id
WHERE systems.id=" + sldr.GetInt32(0).ToString() + @" WHERE systems.id=" + sldr.GetInt32(0).ToString() + @"
ORDER BY sources.name"; ORDER BY sources.name";
using (SQLiteCommand sslc = new SQLiteCommand(squery, dbc)) using (SQLiteCommand sslc = new SQLiteCommand(squery, dbc))
{ {
@@ -889,7 +889,7 @@ Make a selection:
else else
{ {
logger.Error("Source with id '" + srcid + "' could not be removed."); logger.Error("Source with id '" + srcid + "' could not be removed.");
} }
} }
else else
{ {
@@ -930,7 +930,7 @@ Make a selection:
else else
{ {
logger.Error("System with id '" + sysid + "' could not be removed."); logger.Error("System with id '" + sysid + "' could not be removed.");
} }
} }
else else
{ {

View File

@@ -131,7 +131,7 @@ namespace SabreTools.Helper
// If we find an end bracket that's not associated with anything else, the block is done // If we find an end bracket that's not associated with anything else, the block is done
else if (Regex.IsMatch(line, _endPattern) && block) else if (Regex.IsMatch(line, _endPattern) && block)
{ {
block = false; block = false;
elem = elem.Parent; elem = elem.Parent;
} }
@@ -250,5 +250,5 @@ namespace SabreTools.Helper
return output; return output;
} }
} }
} }

View File

@@ -85,7 +85,7 @@ namespace SabreTools.Helper
} }
try try
{ {
_log.WriteLine("Logging ended " + DateTime.Now); _log.WriteLine("Logging ended " + DateTime.Now);
_log.Close(); _log.Close();
} }

View File

@@ -33,7 +33,7 @@ namespace SabreTools.Helper
{ {
RemappingHelper(remapping); RemappingHelper(remapping);
} }
} }
/// <summary> /// <summary>
/// Create a remapping from XML /// Create a remapping from XML