mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Move parsing to new class
This commit is contained in:
@@ -705,7 +705,8 @@ CREATE TABLE IF NOT EXISTS dat (
|
||||
|
||||
// Parse the Dat if possible
|
||||
logger.User($"Adding from '{dat.Name}'");
|
||||
DatFile tempdat = DatFile.CreateAndParse(fullpath);
|
||||
DatTool dt = new DatTool();
|
||||
DatFile tempdat = dt.CreateAndParse(fullpath);
|
||||
|
||||
// If the Dat wasn't empty, add the information
|
||||
SqliteCommand slc = null;
|
||||
|
||||
@@ -46,11 +46,14 @@ structure according to the original DAT master directory tree structure.";
|
||||
if (string.IsNullOrWhiteSpace(outdat))
|
||||
outdat = "out";
|
||||
|
||||
// Get the DatTool for parsing
|
||||
DatTool dt = new DatTool();
|
||||
|
||||
// Now that we have the dictionary, we can loop through and output to a new folder for each
|
||||
foreach (string key in foundDats.Keys)
|
||||
{
|
||||
// Get the DAT file associated with the key
|
||||
DatFile datFile = DatFile.CreateAndParse(Path.Combine(_dats, foundDats[key]));
|
||||
DatFile datFile = dt.CreateAndParse(Path.Combine(_dats, foundDats[key]));
|
||||
|
||||
// Set the depot values
|
||||
datFile.Header.InputDepot = new DepotInformation(true, 4);
|
||||
|
||||
@@ -55,14 +55,17 @@ in -old DAT file. Ignores those entries in -old that are not in -new.";
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the DatTool for parsing
|
||||
DatTool dt = new DatTool();
|
||||
|
||||
// Create the encapsulating datfile
|
||||
DatFile datfile = DatFile.Create();
|
||||
datfile.Header.Name = name;
|
||||
datfile.Header.Description = description;
|
||||
datfile.Parse(olddat);
|
||||
dt.ParseInto(datfile, olddat);
|
||||
|
||||
// Diff against the new datfile
|
||||
DatFile intDat = DatFile.CreateAndParse(newdat);
|
||||
DatFile intDat = dt.CreateAndParse(newdat);
|
||||
datfile.DiffAgainst(intDat, false);
|
||||
intDat.Write(outdat);
|
||||
}
|
||||
|
||||
@@ -50,11 +50,14 @@ namespace RombaSharp.Features
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the DatTool for parsing
|
||||
DatTool dt = new DatTool();
|
||||
|
||||
// Create the encapsulating datfile
|
||||
DatFile datfile = DatFile.CreateAndParse(olddat);
|
||||
DatFile datfile = dt.CreateAndParse(olddat);
|
||||
|
||||
// Diff against the new datfile
|
||||
DatFile intDat = DatFile.CreateAndParse(newdat);
|
||||
DatFile intDat = dt.CreateAndParse(newdat);
|
||||
datfile.DiffAgainst(intDat, false);
|
||||
intDat.Write(outdat);
|
||||
}
|
||||
|
||||
@@ -33,11 +33,14 @@ namespace RombaSharp.Features
|
||||
// Create the new output directory if it doesn't exist
|
||||
DirectoryExtensions.Ensure(Path.Combine(Globals.ExeDir, "out"), create: true);
|
||||
|
||||
// Get the DatTool for parsing
|
||||
DatTool dt = new DatTool();
|
||||
|
||||
// Now that we have the dictionary, we can loop through and output to a new folder for each
|
||||
foreach (string key in foundDats.Keys)
|
||||
{
|
||||
// Get the DAT file associated with the key
|
||||
DatFile datFile = DatFile.CreateAndParse(Path.Combine(_dats, foundDats[key]));
|
||||
DatFile datFile = dt.CreateAndParse(Path.Combine(_dats, foundDats[key]));
|
||||
|
||||
// Now loop through and see if all of the hash combinations exist in the database
|
||||
/* ended here */
|
||||
|
||||
Reference in New Issue
Block a user