mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFiles/, DatItem, ArchiveTools, FileTools] Notes and tweaks
This commit is contained in:
@@ -231,7 +231,7 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Write out Game start using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteStartGame(StreamWriter sw, DatItem rom)
|
||||
{
|
||||
|
||||
@@ -706,7 +706,7 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, rom, ignoreblanks);
|
||||
WriteDatItem(sw, rom, ignoreblanks);
|
||||
|
||||
// Set the new data to compare against
|
||||
lastgame = rom.MachineName;
|
||||
@@ -774,7 +774,7 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Write out Game start using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteStartGame(StreamWriter sw, DatItem rom)
|
||||
{
|
||||
@@ -812,7 +812,7 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Write out Game end using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteEndGame(StreamWriter sw, DatItem rom)
|
||||
{
|
||||
@@ -833,14 +833,14 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// Write out DatItem using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="datFile">DatFile to write out from</param>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="ignoreblanks">True if blank roms should be skipped on output, false otherwise (default)</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteRomData(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
private bool WriteDatItem(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks
|
||||
|
||||
@@ -4211,8 +4211,8 @@ namespace SabreTools.Library.DatFiles
|
||||
if (shouldExternalProcess)
|
||||
{
|
||||
// TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually
|
||||
Rom rom = FileTools.GetFileInfo(file, omitFromScan: (quickScan ? Hash.SecureHashes : Hash.DeepHashes), header: headerToCheckAgainst);
|
||||
usedExternally = RebuildIndividualFile(rom, file, outDir, tempSubDir, date, inverse, outputFormat,
|
||||
Rom fileinfo = FileTools.GetFileInfo(file, omitFromScan: (quickScan ? Hash.SecureHashes : Hash.DeepHashes), header: headerToCheckAgainst);
|
||||
usedExternally = RebuildIndividualFile(fileinfo, file, outDir, tempSubDir, date, inverse, outputFormat,
|
||||
romba, updateDat, null /* isZip */, headerToCheckAgainst);
|
||||
}
|
||||
|
||||
@@ -4242,8 +4242,8 @@ namespace SabreTools.Library.DatFiles
|
||||
if (entries == null && File.Exists(file))
|
||||
{
|
||||
// TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually
|
||||
Rom rom = FileTools.GetFileInfo(file, omitFromScan: (quickScan ? Hash.SecureHashes : Hash.DeepHashes));
|
||||
usedExternally = RebuildIndividualFile(rom, file, outDir, tempSubDir, date, inverse, outputFormat,
|
||||
Rom fileinfo = FileTools.GetFileInfo(file, omitFromScan: (quickScan ? Hash.SecureHashes : Hash.DeepHashes));
|
||||
usedExternally = RebuildIndividualFile(fileinfo, file, outDir, tempSubDir, date, inverse, outputFormat,
|
||||
romba, updateDat, null /* isZip */, headerToCheckAgainst);
|
||||
}
|
||||
// Otherwise, loop through the entries and try to match
|
||||
@@ -4270,7 +4270,7 @@ namespace SabreTools.Library.DatFiles
|
||||
/// <summary>
|
||||
/// Find duplicates and rebuild individual files to output
|
||||
/// </summary>
|
||||
/// <param name="rom">Information for the current file to rebuild from</param>
|
||||
/// <param name="datItem">Information for the current file to rebuild from</param>
|
||||
/// <param name="file">Name of the file to process</param>
|
||||
/// <param name="outDir">Output directory to use to build to</param>
|
||||
/// <param name="tempDir">Temporary directory for archive extraction</param>
|
||||
@@ -4282,20 +4282,23 @@ namespace SabreTools.Library.DatFiles
|
||||
/// <param name="isZip">True if the input file is an archive, false if the file is TGZ, null otherwise</param>
|
||||
/// <param name="headerToCheckAgainst">Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise</param>
|
||||
/// <returns>True if the file was able to be rebuilt, false otherwise</returns>
|
||||
private bool RebuildIndividualFile(Rom rom, string file, string outDir, string tempDir, bool date,
|
||||
private bool RebuildIndividualFile(DatItem datItem, string file, string outDir, string tempDir, bool date,
|
||||
bool inverse, OutputFormat outputFormat, bool romba, bool updateDat, bool? isZip, string headerToCheckAgainst)
|
||||
{
|
||||
// TODO: Don't assume this is a Rom once Disk parsing is created
|
||||
Rom rom = (Rom)datItem;
|
||||
|
||||
// Set the output value
|
||||
bool rebuilt = false;
|
||||
|
||||
// Find if the file has duplicates in the DAT
|
||||
bool hasDuplicates = rom.HasDuplicates(this);
|
||||
bool hasDuplicates = datItem.HasDuplicates(this);
|
||||
|
||||
// If it has duplicates and we're not filtering, rebuild it
|
||||
if (hasDuplicates && !inverse)
|
||||
{
|
||||
// Get the list of duplicates to rebuild to
|
||||
List<DatItem> dupes = rom.GetDuplicates(this, remove: updateDat);
|
||||
List<DatItem> dupes = datItem.GetDuplicates(this, remove: updateDat);
|
||||
|
||||
// If we don't have any duplicates, continue
|
||||
if (dupes.Count == 0)
|
||||
@@ -4340,7 +4343,7 @@ namespace SabreTools.Library.DatFiles
|
||||
if (isZip != null)
|
||||
{
|
||||
string realName = null;
|
||||
(fileStream, realName) = ArchiveTools.ExtractStream(file, rom.Name);
|
||||
(fileStream, realName) = ArchiveTools.ExtractStream(file, datItem.Name);
|
||||
}
|
||||
// Otherwise, just open the filestream
|
||||
else
|
||||
@@ -4357,7 +4360,7 @@ namespace SabreTools.Library.DatFiles
|
||||
// Seek to the beginning of the stream
|
||||
fileStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
Globals.Logger.User("Matches found for '{0}', rebuilding accordingly...", Style.GetFileName(rom.Name));
|
||||
Globals.Logger.User("Matches found for '{0}', rebuilding accordingly...", Style.GetFileName(datItem.Name));
|
||||
rebuilt = true;
|
||||
|
||||
// Now loop through the list and rebuild accordingly
|
||||
@@ -4436,7 +4439,7 @@ namespace SabreTools.Library.DatFiles
|
||||
if (isZip != null)
|
||||
{
|
||||
string realName = null;
|
||||
(fileStream, realName) = ArchiveTools.ExtractStream(file, rom.Name);
|
||||
(fileStream, realName) = ArchiveTools.ExtractStream(file, datItem.Name);
|
||||
}
|
||||
// Otherwise, just open the filestream
|
||||
else
|
||||
@@ -4462,7 +4465,7 @@ namespace SabreTools.Library.DatFiles
|
||||
item.MachineDescription = machinename;
|
||||
}
|
||||
|
||||
Globals.Logger.User("No matches found for '{0}', rebuilding accordingly from inverse flag...", Style.GetFileName(rom.Name));
|
||||
Globals.Logger.User("No matches found for '{0}', rebuilding accordingly from inverse flag...", Style.GetFileName(datItem.Name));
|
||||
|
||||
// Now rebuild to the output file
|
||||
switch (outputFormat)
|
||||
@@ -4537,7 +4540,7 @@ namespace SabreTools.Library.DatFiles
|
||||
if (isZip != null)
|
||||
{
|
||||
string realName = null;
|
||||
(fileStream, realName) = ArchiveTools.ExtractStream(file, rom.Name);
|
||||
(fileStream, realName) = ArchiveTools.ExtractStream(file, datItem.Name);
|
||||
}
|
||||
// Otherwise, just open the filestream
|
||||
else
|
||||
@@ -4579,15 +4582,15 @@ namespace SabreTools.Library.DatFiles
|
||||
return rebuilt;
|
||||
}
|
||||
|
||||
Globals.Logger.User("Headerless matches found for '{0}', rebuilding accordingly...", Style.GetFileName(rom.Name));
|
||||
Globals.Logger.User("Headerless matches found for '{0}', rebuilding accordingly...", Style.GetFileName(datItem.Name));
|
||||
rebuilt = true;
|
||||
|
||||
// Now loop through the list and rebuild accordingly
|
||||
foreach (Rom item in dupes)
|
||||
{
|
||||
// Create a headered item to use as well
|
||||
rom.CopyMachineInformation(item);
|
||||
rom.Name += "_" + rom.CRC;
|
||||
datItem.CopyMachineInformation(item);
|
||||
datItem.Name += "_" + rom.CRC;
|
||||
|
||||
// If either copy succeeds, then we want to set rebuilt to true
|
||||
bool eitherSuccess = false;
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, rom, ignoreblanks);
|
||||
WriteDatItem(sw, rom, ignoreblanks);
|
||||
|
||||
// Set the new data to compare against
|
||||
lastgame = rom.MachineName;
|
||||
@@ -202,7 +202,7 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Write out Game start using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteStartGame(StreamWriter sw, DatItem rom)
|
||||
{
|
||||
@@ -232,7 +232,7 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Write out Game end using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteEndGame(StreamWriter sw, DatItem rom)
|
||||
{
|
||||
@@ -253,13 +253,13 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// Write out DatItem using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="ignoreblanks">True if blank roms should be skipped on output, false otherwise (default)</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteRomData(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
private bool WriteDatItem(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData( sw, hash, rom, ignoreblanks);
|
||||
WriteDatItem( sw, hash, rom, ignoreblanks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,14 +182,14 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// Write out DatItem using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="hash">Hash that should be written out</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="ignoreblanks">True if blank roms should be skipped on output, false otherwise (default)</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteRomData(StreamWriter sw, Hash hash, DatItem rom, bool ignoreblanks = false)
|
||||
private bool WriteDatItem(StreamWriter sw, Hash hash, DatItem rom, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks
|
||||
|
||||
@@ -318,7 +318,7 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, rom, ignoreblanks);
|
||||
WriteDatItem(sw, rom, ignoreblanks);
|
||||
|
||||
// Set the new data to compare against
|
||||
lastgame = rom.MachineName;
|
||||
@@ -342,7 +342,7 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Write out Game start using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteStartGame(StreamWriter sw, DatItem rom)
|
||||
{
|
||||
@@ -393,13 +393,13 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// Write out DatItem using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="ignoreblanks">True if blank roms should be skipped on output, false otherwise (default)</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteRomData(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
private bool WriteDatItem(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks
|
||||
|
||||
@@ -1250,7 +1250,7 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, rom, ignoreblanks);
|
||||
WriteDatItem(sw, rom, ignoreblanks);
|
||||
|
||||
// Set the new data to compare against
|
||||
lastgame = rom.MachineName;
|
||||
@@ -1330,7 +1330,7 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Write out Game start using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteStartGame(StreamWriter sw, DatItem rom)
|
||||
{
|
||||
@@ -1400,13 +1400,13 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// Write out DatItem using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="ignoreblanks">True if blank roms should be skipped on output, false otherwise (default)</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteRomData(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
private bool WriteDatItem(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, rom, lastgame, ignoreblanks);
|
||||
WriteDatItem(sw, rom, lastgame, ignoreblanks);
|
||||
|
||||
// Set the new data to compare against
|
||||
lastgame = rom.MachineName;
|
||||
@@ -141,14 +141,14 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// Write out DatItem using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="lastgame">The name of the last game to be output</param>
|
||||
/// <param name="ignoreblanks">True if blank roms should be skipped on output, false otherwise (default)</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteRomData(StreamWriter sw, DatItem rom, string lastgame, bool ignoreblanks = false)
|
||||
private bool WriteDatItem(StreamWriter sw, DatItem rom, string lastgame, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, rom, ignoreblanks);
|
||||
WriteDatItem(sw, rom, ignoreblanks);
|
||||
|
||||
// Set the new data to compare against
|
||||
lastgame = rom.MachineName;
|
||||
@@ -249,13 +249,13 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// Write out DatItem using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="ignoreblanks">True if blank roms should be skipped on output, false otherwise (default)</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteRomData(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
private bool WriteDatItem(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks
|
||||
|
||||
@@ -266,7 +266,7 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, rom, ignoreblanks);
|
||||
WriteDatItem(sw, rom, ignoreblanks);
|
||||
|
||||
// Set the new data to compare against
|
||||
lastgame = rom.MachineName;
|
||||
@@ -322,13 +322,13 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// Write out DatItem using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="ignoreblanks">True if blank roms should be skipped on output, false otherwise (default)</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteRomData(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
private bool WriteDatItem(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, rom, depth, ignoreblanks);
|
||||
WriteDatItem(sw, rom, depth, ignoreblanks);
|
||||
|
||||
// Set the new data to compare against
|
||||
splitpath = newsplit;
|
||||
@@ -221,7 +221,7 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Write out Game start using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="newsplit">Split path representing the parent game (SabreDAT only)</param>
|
||||
/// <param name="lastgame">The name of the last game to be output</param>
|
||||
/// <param name="depth">Current depth to output file at (SabreDAT only)</param>
|
||||
@@ -319,14 +319,14 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// Write out DatItem using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="depth">Current depth to output file at (SabreDAT only)</param>
|
||||
/// <param name="ignoreblanks">True if blank roms should be skipped on output, false otherwise (default)</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteRomData(StreamWriter sw, DatItem rom, int depth, bool ignoreblanks = false)
|
||||
private bool WriteDatItem(StreamWriter sw, DatItem rom, int depth, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks
|
||||
|
||||
@@ -422,7 +422,7 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, delim, rom, ignoreblanks);
|
||||
WriteDatItem(sw, delim, rom, ignoreblanks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,14 +466,14 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// Write out DatItem using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="delim">Delimiter for parsing individual lines</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="ignoreblanks">True if blank roms should be skipped on output, false otherwise (default)</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteRomData(StreamWriter sw, char delim, DatItem rom, bool ignoreblanks = false)
|
||||
private bool WriteDatItem(StreamWriter sw, char delim, DatItem rom, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, rom, ignoreblanks);
|
||||
WriteDatItem(sw, rom, ignoreblanks);
|
||||
|
||||
// Set the new data to compare against
|
||||
lastgame = rom.MachineName;
|
||||
@@ -203,7 +203,7 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Write out Game start using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteStartGame(StreamWriter sw, DatItem rom)
|
||||
{
|
||||
@@ -273,13 +273,13 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// Write out DatItem using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="rom">DatItem object to be output</param>
|
||||
/// <param name="ignoreblanks">True if blank roms should be skipped on output, false otherwise (default)</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
private bool WriteRomData(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
private bool WriteDatItem(StreamWriter sw, DatItem rom, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks
|
||||
|
||||
Reference in New Issue
Block a user