From a5c776a792f12ba9c07dd21693e6044241179cef Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 4 Apr 2016 23:11:29 -0700 Subject: [PATCH] Make sure things have tabs instead of spaces --- DATabase/Core/Generate.cs | 6 +++--- DATabase/Core/Import.cs | 24 ++++++++++++------------ DATabase/DATabase.cs | 6 +++--- DATabase/Helper/Converters.cs | 4 ++-- DATabase/Helper/Logger.cs | 2 +- DATabase/Helper/Remapping.cs | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/DATabase/Core/Generate.cs b/DATabase/Core/Generate.cs index 5240e03a..56665cd6 100644 --- a/DATabase/Core/Generate.cs +++ b/DATabase/Core/Generate.cs @@ -79,7 +79,7 @@ namespace SabreTools // Check to see if the source is an import-only. If so, tell the user and exit int id = 0; 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."); return false; } @@ -272,7 +272,7 @@ namespace SabreTools sw.Write((_old ? ")" : "\t\n")); _logger.Log("File written!"); - sw.Close(); + sw.Close(); fs.Close(); } catch (Exception ex) @@ -289,7 +289,7 @@ namespace SabreTools /// /// To make this even more accurate, files with a more recent "LastUpdated" should be considered the parent if all else is the same. /// A List of RomData objects containing all information about the files - public List ProcessRoms() + public List ProcessRoms() { List roms = new List(); diff --git a/DATabase/Core/Import.cs b/DATabase/Core/Import.cs index 12a0a5f5..91c7cee5 100644 --- a/DATabase/Core/Import.cs +++ b/DATabase/Core/Import.cs @@ -47,7 +47,7 @@ namespace SabreTools // Regex File Name Patterns private static string _defaultPattern = @"^(.+?) - (.+?) \((.*) (.*)\)\.dat$"; 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 _noIntroSpecialPattern = @"(.*? - .*?) \((\d{8})\)\.dat"; private static string _redumpPattern = @"^(.*?) \((\d{8} \d{2}-\d{2}-\d{2})\)\.dat$"; @@ -224,7 +224,7 @@ namespace SabreTools datestring = fileinfo[2].Value; GroupCollection niDateInfo = Regex.Match(datestring, _noIntroSpecialDatePattern).Groups; date = niDateInfo[1].Value + "-" + niDateInfo[2].Value + "-" + niDateInfo[3].Value + " 00:00:00"; - } + } break; case DatType.Redump: if (!Remapping.Redump.ContainsKey(fileinfo[1].Value)) @@ -373,7 +373,7 @@ namespace SabreTools { node = node.NextSibling; } - } + } // Once we find the main body, enter it if (node != null && (node.Name == "datafile" || node.Name == "softwarelist")) @@ -406,15 +406,15 @@ namespace SabreTools if (node.Name == "software") { tempname = node.SelectSingleNode("description").InnerText; - } + } else { // There are rare cases where a malformed XML will not have the required attributes. We can only skip them. if (node.Attributes.Count == 0) { _logger.Error(@"A node with malformed XML has been found! - 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 RV DATs, please make sure that all names and descriptions are quoted. + For XML DATs, make sure that the DAT has all required information."); node = node.NextSibling; continue; } @@ -446,7 +446,7 @@ namespace SabreTools else if (child.Attributes["size"] != null) { size = Int64.Parse(child.Attributes["size"].Value); - } + } AddRom( child.Name, @@ -457,7 +457,7 @@ namespace SabreTools (child.Attributes["crc"] != null ? child.Attributes["crc"].Value.ToLowerInvariant().Trim() : ""), (child.Attributes["md5"] != null ? child.Attributes["md5"].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 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("'", "''") + @"' AND files.type='" + romtype + @"' AND files.setid=" + gameid + " " + - " AND checksums.size=" + size + - " AND checksums.crc='" + crc + "'" + - " AND checksums.md5='" + md5 + "'" + - " AND checksums.sha1='" + sha1 + "'"; + " AND checksums.size=" + size + + " AND checksums.crc='" + crc + "'" + + " AND checksums.md5='" + md5 + "'" + + " AND checksums.sha1='" + sha1 + "'"; using (SQLiteConnection dbc = new SQLiteConnection(_connectionString)) { dbc.Open(); diff --git a/DATabase/DATabase.cs b/DATabase/DATabase.cs index 22138dab..1d6c446a 100644 --- a/DATabase/DATabase.cs +++ b/DATabase/DATabase.cs @@ -554,7 +554,7 @@ Make a selection: JOIN sources ON games.source=sources.id WHERE systems.id=" + sldr.GetInt32(0).ToString() + @" - ORDER BY sources.name"; + ORDER BY sources.name"; using (SQLiteCommand sslc = new SQLiteCommand(squery, dbc)) { @@ -889,7 +889,7 @@ Make a selection: else { logger.Error("Source with id '" + srcid + "' could not be removed."); - } + } } else { @@ -930,7 +930,7 @@ Make a selection: else { logger.Error("System with id '" + sysid + "' could not be removed."); - } + } } else { diff --git a/DATabase/Helper/Converters.cs b/DATabase/Helper/Converters.cs index 13efaac3..5824c51f 100644 --- a/DATabase/Helper/Converters.cs +++ b/DATabase/Helper/Converters.cs @@ -131,7 +131,7 @@ namespace SabreTools.Helper // If we find an end bracket that's not associated with anything else, the block is done else if (Regex.IsMatch(line, _endPattern) && block) - { + { block = false; elem = elem.Parent; } @@ -250,5 +250,5 @@ namespace SabreTools.Helper return output; } - } + } } diff --git a/DATabase/Helper/Logger.cs b/DATabase/Helper/Logger.cs index adf6b196..a9010bcd 100644 --- a/DATabase/Helper/Logger.cs +++ b/DATabase/Helper/Logger.cs @@ -85,7 +85,7 @@ namespace SabreTools.Helper } try - { + { _log.WriteLine("Logging ended " + DateTime.Now); _log.Close(); } diff --git a/DATabase/Helper/Remapping.cs b/DATabase/Helper/Remapping.cs index c1427da1..9d223456 100644 --- a/DATabase/Helper/Remapping.cs +++ b/DATabase/Helper/Remapping.cs @@ -33,7 +33,7 @@ namespace SabreTools.Helper { RemappingHelper(remapping); } - } + } /// /// Create a remapping from XML