[ALL] Mappings and pathing updates

This commit is contained in:
Matt Nadareski
2016-06-16 22:17:58 -07:00
parent 31c5292c8e
commit 1b9feb8ea4
11 changed files with 368 additions and 43 deletions

View File

@@ -332,8 +332,9 @@ namespace SabreTools
foreach (string entry in Directory.EnumerateFiles(tempdir, "*", SearchOption.AllDirectories))
{
lastparent = ProcessFile(Path.GetFullPath(entry), sw, Path.GetFullPath(tempdir),
(Path.GetDirectoryName(Path.GetFullPath(item)) + Path.DirectorySeparatorChar).Remove(0, _basePath.Length) +
Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(item), _datdata, lastparent);
Path.Combine((Path.GetDirectoryName(Path.GetFullPath(item)) + Path.DirectorySeparatorChar).Remove(0, _basePath.Length) +
Path.GetFileNameWithoutExtension(item)
), _datdata, lastparent);
}
// Clear the temp directory

View File

@@ -85,8 +85,8 @@ namespace SabreTools
return false;
}
path += Path.DirectorySeparatorChar + system.Trim();
name = system.Trim();
path = Path.Combine(path, name);
}
else
{

View File

@@ -110,7 +110,7 @@ namespace SabreTools
_logger.User("Processing DATs for system: '" + kv.Key + "'");
// Set the folder to iterate through based on the DAT root
string folder = _datroot + Path.DirectorySeparatorChar + kv.Key.Trim();
string folder = Path.Combine(_datroot, kv.Key.Trim());
// Audit all files in the folder
foreach (string file in Directory.EnumerateFiles(folder, "*", SearchOption.AllDirectories))

View File

@@ -482,8 +482,7 @@ namespace SabreTools
rootpath += (rootpath == "" ? "" : Path.DirectorySeparatorChar.ToString());
filename = filename.Remove(0, rootpath.Length);
newrom.Game = Path.GetDirectoryName(filename) + Path.DirectorySeparatorChar.ToString() +
Path.GetFileNameWithoutExtension(filename) + Path.DirectorySeparatorChar + newrom.Game;
newrom.Game = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename), newrom.Game);
newroms.Add(newrom);
}
userData.Roms[key] = newroms;

View File

@@ -14,7 +14,6 @@ namespace SabreTools
/// </summary>
private static void Setup()
{
Remapping.CreateRemappings();
Build.Start("DATabase");
// Perform initial database and folder setup
@@ -40,7 +39,7 @@ namespace SabreTools
while (sldr.Read())
{
int systemid = sldr.GetInt32(0);
string system = _datroot + Path.DirectorySeparatorChar + sldr.GetString(1) + " - " + sldr.GetString(2);
string system = Path.Combine(_datroot, sldr.GetString(1) + " - " + sldr.GetString(2));
system = system.Trim();
if (!Directory.Exists(system))