mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ALL] Update way output formats are handled
This commit is contained in:
@@ -62,7 +62,7 @@ namespace SabreTools
|
||||
FileName = Path.GetFileName(inputs[0]) + " Dir2Dat",
|
||||
Name = Path.GetFileName(inputs[0]) + " Dir2Dat",
|
||||
Description = Path.GetFileName(inputs[0]) + " Dir2Dat",
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
};
|
||||
|
||||
|
||||
@@ -101,23 +101,6 @@
|
||||
Unzip,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines the DAT output format
|
||||
/// </summary>
|
||||
public enum OutputFormat
|
||||
{
|
||||
None = 0,
|
||||
Xml,
|
||||
ClrMamePro,
|
||||
RomCenter,
|
||||
DOSCenter,
|
||||
MissFile,
|
||||
SabreDat,
|
||||
RedumpMD5,
|
||||
RedumpSHA1,
|
||||
RedumpSFV,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines the level to scan archives at
|
||||
/// </summary>
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace SabreTools.Helper
|
||||
public ForceMerging ForceMerging;
|
||||
public ForceNodump ForceNodump;
|
||||
public ForcePacking ForcePacking;
|
||||
public OutputFormat OutputFormat;
|
||||
public OutputFormatFlag OutputFormatFlag;
|
||||
public bool MergeRoms;
|
||||
public List<HashData> Hashes;
|
||||
|
||||
@@ -318,7 +318,7 @@ namespace SabreTools.Helper
|
||||
public ForceMerging ForceMerging;
|
||||
public ForceNodump ForceNodump;
|
||||
public ForcePacking ForcePacking;
|
||||
public OutputFormat OutputFormat;
|
||||
public OutputFormatFlag OutputFormatFlag;
|
||||
public bool MergeRoms;
|
||||
public Dictionary<string, List<Rom>> Files;
|
||||
|
||||
@@ -363,7 +363,7 @@ namespace SabreTools.Helper
|
||||
ForceMerging = this.ForceMerging,
|
||||
ForceNodump = this.ForceNodump,
|
||||
ForcePacking = this.ForcePacking,
|
||||
OutputFormat = this.OutputFormat,
|
||||
OutputFormatFlag = this.OutputFormatFlag,
|
||||
MergeRoms = this.MergeRoms,
|
||||
Files = this.Files,
|
||||
UseGame = this.UseGame,
|
||||
@@ -406,7 +406,7 @@ namespace SabreTools.Helper
|
||||
ForceMerging = this.ForceMerging,
|
||||
ForceNodump = this.ForceNodump,
|
||||
ForcePacking = this.ForcePacking,
|
||||
OutputFormat = this.OutputFormat,
|
||||
OutputFormatFlag = this.OutputFormatFlag,
|
||||
MergeRoms = this.MergeRoms,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
UseGame = this.UseGame,
|
||||
|
||||
@@ -115,13 +115,13 @@ namespace SabreTools
|
||||
else
|
||||
{
|
||||
// Create and open the output file for writing
|
||||
FileStream fs = File.Create(Style.CreateOutfileName(Environment.CurrentDirectory, _datdata));
|
||||
FileStream fs = File.Create(Style.CreateOutfileNames(Environment.CurrentDirectory, _datdata)[_datdata.OutputFormatFlag]);
|
||||
sw = new StreamWriter(fs, Encoding.UTF8);
|
||||
sw.AutoFlush = true;
|
||||
}
|
||||
|
||||
// Write out the initial file header
|
||||
DatTools.WriteHeader(sw, _datdata, _logger);
|
||||
DatTools.WriteHeader(sw, _datdata.OutputFormatFlag, _datdata, _logger);
|
||||
|
||||
// Loop over each of the found paths, if any
|
||||
string lastparent = null;
|
||||
@@ -265,7 +265,7 @@ namespace SabreTools
|
||||
Rom rom = roms[i];
|
||||
|
||||
// If we're in a mode that doesn't allow for actual empty folders, add the blank info
|
||||
if (_datdata.OutputFormat != OutputFormat.SabreDat && _datdata.OutputFormat != OutputFormat.MissFile)
|
||||
if ((_datdata.OutputFormatFlag & OutputFormatFlag.SabreDat) == 0 && (_datdata.OutputFormatFlag & OutputFormatFlag.MissFile) == 0)
|
||||
{
|
||||
rom.Type = ItemType.Rom;
|
||||
rom.Name = "-";
|
||||
@@ -295,19 +295,19 @@ namespace SabreTools
|
||||
int last = 0;
|
||||
if (lastparent != null && lastparent.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
{
|
||||
DatTools.WriteEndGame(sw, rom, new List<string>(), new List<string>(), lastparent, _datdata, 0, out last, _logger);
|
||||
DatTools.WriteEndGame(sw, _datdata.OutputFormatFlag, rom, new List<string>(), new List<string>(), lastparent, 0, out last, _logger);
|
||||
}
|
||||
|
||||
// If we have a new game, output the beginning of the new item
|
||||
if (lastparent == null || lastparent.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
{
|
||||
DatTools.WriteStartGame(sw, rom, new List<string>(), lastparent, _datdata, 0, last, _logger);
|
||||
DatTools.WriteStartGame(sw, _datdata.OutputFormatFlag, rom, new List<string>(), lastparent, 0, last, _logger);
|
||||
}
|
||||
|
||||
// Write out the rom data
|
||||
if (_datdata.OutputFormat != OutputFormat.SabreDat && _datdata.OutputFormat != OutputFormat.MissFile)
|
||||
if ((_datdata.OutputFormatFlag & OutputFormatFlag.SabreDat) == 0 && (_datdata.OutputFormatFlag & OutputFormatFlag.MissFile) == 0)
|
||||
{
|
||||
DatTools.WriteRomData(sw, rom, lastparent, _datdata, 0, _logger);
|
||||
DatTools.WriteRomData(sw, _datdata.OutputFormatFlag, rom, lastparent, _datdata, 0, _logger);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ namespace SabreTools
|
||||
}
|
||||
|
||||
// Now write the final piece and close the output stream
|
||||
DatTools.WriteFooter(sw, _datdata, 0, _logger);
|
||||
DatTools.WriteFooter(sw, _datdata.OutputFormatFlag, _datdata, 0, _logger);
|
||||
sw.Close();
|
||||
|
||||
return true;
|
||||
@@ -369,9 +369,9 @@ namespace SabreTools
|
||||
}
|
||||
else
|
||||
{
|
||||
DatTools.WriteStartGame(sw, rom, new List<string>(), "", _datdata, 0, 0, _logger);
|
||||
DatTools.WriteRomData(sw, rom, "", _datdata, 0, _logger);
|
||||
DatTools.WriteEndGame(sw, rom, new List<string>(), new List<string>(), "", _datdata, 0, out last, _logger);
|
||||
DatTools.WriteStartGame(sw, _datdata.OutputFormatFlag, rom, new List<string>(), "", 0, 0, _logger);
|
||||
DatTools.WriteRomData(sw, _datdata.OutputFormatFlag, rom, "", _datdata, 0, _logger);
|
||||
DatTools.WriteEndGame(sw, _datdata.OutputFormatFlag, rom, new List<string>(), new List<string>(), "", 0, out last, _logger);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -548,17 +548,17 @@ namespace SabreTools
|
||||
int last = 0;
|
||||
if (lastparent != null && lastparent.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
{
|
||||
DatTools.WriteEndGame(sw, rom, new List<string>(), new List<string>(), lastparent, datdata, 0, out last, _logger);
|
||||
DatTools.WriteEndGame(sw, datdata.OutputFormatFlag, rom, new List<string>(), new List<string>(), lastparent, 0, out last, _logger);
|
||||
}
|
||||
|
||||
// If we have a new game, output the beginning of the new item
|
||||
if (lastparent == null || lastparent.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
{
|
||||
DatTools.WriteStartGame(sw, rom, new List<string>(), lastparent, datdata, 0, last, _logger);
|
||||
DatTools.WriteStartGame(sw, datdata.OutputFormatFlag, rom, new List<string>(), lastparent, 0, last, _logger);
|
||||
}
|
||||
|
||||
// Write out the rom data
|
||||
DatTools.WriteRomData(sw, rom, lastparent, datdata, 0, _logger);
|
||||
DatTools.WriteRomData(sw, datdata.OutputFormatFlag, rom, lastparent, datdata, 0, _logger);
|
||||
}
|
||||
_logger.User("File added: " + actualitem + Environment.NewLine);
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace SabreTools
|
||||
Category = "The Wizard of DATz",
|
||||
Author = "The Wizard of DATz",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormat = (_old ? OutputFormat.ClrMamePro : OutputFormat.Xml),
|
||||
OutputFormatFlag = (_old ? OutputFormatFlag.ClrMamePro : OutputFormatFlag.Xml),
|
||||
Files = dict,
|
||||
};
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace SabreTools
|
||||
Category = "SabreTools",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormat = (_old ? OutputFormat.ClrMamePro : OutputFormat.Xml),
|
||||
OutputFormatFlag = (_old ? OutputFormatFlag.ClrMamePro : OutputFormatFlag.Xml),
|
||||
MergeRoms = true,
|
||||
};
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
MergeRoms = true,
|
||||
Files = netNew,
|
||||
};
|
||||
@@ -317,7 +317,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
MergeRoms = true,
|
||||
Files = unneeded,
|
||||
};
|
||||
@@ -330,7 +330,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
MergeRoms = true,
|
||||
Files = newMissing,
|
||||
};
|
||||
@@ -343,7 +343,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
MergeRoms = true,
|
||||
Files = have,
|
||||
};
|
||||
@@ -417,7 +417,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
MergeRoms = true,
|
||||
Files = have,
|
||||
};
|
||||
@@ -487,7 +487,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
MergeRoms = true,
|
||||
Files = have,
|
||||
};
|
||||
|
||||
@@ -21,15 +21,15 @@ namespace SabreTools.Helper
|
||||
/// Get what type of DAT the input file is
|
||||
/// </summary>
|
||||
/// <param name="filename">Name of the file to be parsed</param>
|
||||
/// <returns>The OutputFormat corresponding to the DAT</returns>
|
||||
/// <returns>The OutputFormatFlagcorresponding to the DAT</returns>
|
||||
/// <remarks>There is currently no differentiation between XML and SabreDAT here</remarks>
|
||||
public static OutputFormat GetOutputFormat(string filename, Logger logger)
|
||||
public static OutputFormatFlag GetOutputFormat(string filename, Logger logger)
|
||||
{
|
||||
// Limit the output formats based on extension
|
||||
string ext = Path.GetExtension(filename).ToLowerInvariant();
|
||||
if (ext != ".dat" && ext != ".xml")
|
||||
{
|
||||
return OutputFormat.None;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Read the input file, if possible
|
||||
@@ -39,7 +39,7 @@ namespace SabreTools.Helper
|
||||
if (!File.Exists(filename))
|
||||
{
|
||||
logger.Warning("File '" + filename + "' could not read from!");
|
||||
return OutputFormat.None;
|
||||
return 0;
|
||||
}
|
||||
|
||||
try
|
||||
@@ -50,20 +50,20 @@ namespace SabreTools.Helper
|
||||
sr.Dispose();
|
||||
if (first.Contains("<") && first.Contains(">"))
|
||||
{
|
||||
return OutputFormat.Xml;
|
||||
return OutputFormatFlag.Xml;
|
||||
}
|
||||
else if (first.Contains("[") && first.Contains("]"))
|
||||
{
|
||||
return OutputFormat.RomCenter;
|
||||
return OutputFormatFlag.RomCenter;
|
||||
}
|
||||
else
|
||||
{
|
||||
return OutputFormat.ClrMamePro;
|
||||
return OutputFormatFlag.ClrMamePro;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return OutputFormat.None;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace SabreTools.Helper
|
||||
datdata.FileName = (String.IsNullOrEmpty(datdata.FileName) ? (keepext ? Path.GetFileName(filename) : Path.GetFileNameWithoutExtension(filename)) : datdata.FileName);
|
||||
|
||||
// If the output type isn't set already, get the internal output type
|
||||
datdata.OutputFormat = (datdata.OutputFormat == OutputFormat.None ? GetOutputFormat(filename, logger) : datdata.OutputFormat);
|
||||
datdata.OutputFormatFlag = (datdata.OutputFormatFlag == 0 ? GetOutputFormat(filename, logger) : datdata.OutputFormatFlag);
|
||||
|
||||
// Make sure there's a dictionary to read to
|
||||
if (datdata.Files == null)
|
||||
@@ -186,12 +186,12 @@ namespace SabreTools.Helper
|
||||
// Now parse the correct type of DAT
|
||||
switch (GetOutputFormat(filename, logger))
|
||||
{
|
||||
case OutputFormat.ClrMamePro:
|
||||
case OutputFormatFlag.ClrMamePro:
|
||||
return ParseCMP(filename, sysid, srcid, datdata, gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, logger, keep, clean);
|
||||
case OutputFormat.RomCenter:
|
||||
case OutputFormatFlag.RomCenter:
|
||||
return ParseRC(filename, sysid, srcid, datdata, gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, logger, clean);
|
||||
case OutputFormat.SabreDat:
|
||||
case OutputFormat.Xml:
|
||||
case OutputFormatFlag.SabreDat:
|
||||
case OutputFormatFlag.Xml:
|
||||
return ParseXML(filename, sysid, srcid, datdata, gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, logger, keep, clean, softlist);
|
||||
default:
|
||||
return datdata;
|
||||
@@ -1779,7 +1779,7 @@ namespace SabreTools.Helper
|
||||
root, logger, true, clean, softlist, keepext:(innerDatdata.XSV != null));
|
||||
|
||||
// If the extension matches, append ".new" to the filename
|
||||
string extension = (innerDatdata.OutputFormat == OutputFormat.Xml || innerDatdata.OutputFormat == OutputFormat.SabreDat ? ".xml" : ".dat");
|
||||
string extension = ((innerDatdata.OutputFormatFlag & OutputFormatFlag.Xml) != 0 || (innerDatdata.OutputFormatFlag & OutputFormatFlag.SabreDat) != 0 ? ".xml" : ".dat");
|
||||
if (outputDirectory == "" && Path.GetExtension(inputFileName) == extension)
|
||||
{
|
||||
innerDatdata.FileName += ".new";
|
||||
@@ -1804,7 +1804,7 @@ namespace SabreTools.Helper
|
||||
slt, seq, crc, md5, sha1, nodump, trim, single, root, logger, true, clean, keepext:(datdata.XSV != null));
|
||||
|
||||
// If the extension matches, append ".new" to the filename
|
||||
string extension = (innerDatdata.OutputFormat == OutputFormat.Xml || innerDatdata.OutputFormat == OutputFormat.SabreDat ? ".xml" : ".dat");
|
||||
string extension = ((innerDatdata.OutputFormatFlag & OutputFormatFlag.Xml) != 0 || (innerDatdata.OutputFormatFlag & OutputFormatFlag.SabreDat) != 0 ? ".xml" : ".dat");
|
||||
if (outputDirectory == "" && Path.GetExtension(file) == extension)
|
||||
{
|
||||
innerDatdata.FileName += ".new";
|
||||
@@ -1856,7 +1856,7 @@ namespace SabreTools.Helper
|
||||
int i = 0;
|
||||
userData = new Dat
|
||||
{
|
||||
OutputFormat = (inputDat.OutputFormat != OutputFormat.None ? inputDat.OutputFormat : OutputFormat.None),
|
||||
OutputFormatFlag = (inputDat.OutputFormatFlag != 0 ? inputDat.OutputFormatFlag : 0),
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
MergeRoms = inputDat.MergeRoms,
|
||||
};
|
||||
@@ -1876,7 +1876,7 @@ namespace SabreTools.Helper
|
||||
Dictionary<string, List<Rom>> temp = userData.Files;
|
||||
userData = new Dat
|
||||
{
|
||||
OutputFormat = (inputDat.OutputFormat != OutputFormat.None ? inputDat.OutputFormat : OutputFormat.None),
|
||||
OutputFormatFlag = (inputDat.OutputFormatFlag != 0 ? inputDat.OutputFormatFlag : 0),
|
||||
Files = temp,
|
||||
MergeRoms = inputDat.MergeRoms,
|
||||
};
|
||||
@@ -2424,6 +2424,7 @@ namespace SabreTools.Helper
|
||||
/// </summary>
|
||||
/// <param name="inputFileNames">Names of the input files and/or folders</param>
|
||||
/// <param name="datdata">User specified inputs contained in a DatData object</param>
|
||||
/// <param name="outputFormatFlag">Non-zero flag for output format, zero otherwise for default</param>
|
||||
/// <param name="outputDirectory">Optional param for output directory</param>
|
||||
/// <param name="merge">True if input files should be merged into a single file, false otherwise</param>
|
||||
/// <param name="diff">Non-zero flag for diffing mode, zero otherwise</param>
|
||||
@@ -2448,9 +2449,10 @@ namespace SabreTools.Helper
|
||||
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
||||
/// <param name="maxDegreeOfParallelism">Integer representing the maximum amount of parallelization to be used</param>
|
||||
/// <param name="logger">Logging object for console and file output</param>
|
||||
public static void UpdateParallel(List<string> inputFileNames, Dat datdata, string outputDirectory, bool merge, DiffMode diff, bool? cascade, bool inplace,
|
||||
bool skip, bool bare, bool clean, bool softlist, string gamename, string romname, string romtype, long sgt, long slt, long seq, string crc,
|
||||
string md5, string sha1, bool? nodump, bool trim, bool single, string root, int maxDegreeOfParallelism, Logger logger)
|
||||
public static void UpdateParallel(List<string> inputFileNames, Dat datdata, OutputFormatFlag outputFormatFlag, string outputDirectory, bool merge,
|
||||
DiffMode diff, bool? cascade, bool inplace, bool skip, bool bare, bool clean, bool softlist, string gamename, string romname, string romtype,
|
||||
long sgt, long slt, long seq, string crc, string md5, string sha1, bool? nodump, bool trim, bool single, string root, int maxDegreeOfParallelism,
|
||||
Logger logger)
|
||||
{
|
||||
// If we're in merging or diffing mode, use the full list of inputs
|
||||
if (merge || diff != 0)
|
||||
@@ -2544,7 +2546,7 @@ namespace SabreTools.Helper
|
||||
root, logger, true, clean, softlist, keepext: (innerDatdata.XSV != null));
|
||||
|
||||
// If the extension matches, append ".new" to the filename
|
||||
string extension = (innerDatdata.OutputFormat == OutputFormat.Xml || innerDatdata.OutputFormat == OutputFormat.SabreDat ? ".xml" : ".dat");
|
||||
string extension = ((innerDatdata.OutputFormatFlag & OutputFormatFlag.Xml) != 0 || (innerDatdata.OutputFormatFlag & OutputFormatFlag.SabreDat) != 0 ? ".xml" : ".dat");
|
||||
if (outputDirectory == "" && Path.GetExtension(inputFileName) == extension)
|
||||
{
|
||||
innerDatdata.FileName += ".new";
|
||||
@@ -2571,7 +2573,7 @@ namespace SabreTools.Helper
|
||||
slt, seq, crc, md5, sha1, nodump, trim, single, root, logger, true, clean, keepext: (datdata.XSV != null));
|
||||
|
||||
// If the extension matches, append ".new" to the filename
|
||||
string extension = (innerDatdata.OutputFormat == OutputFormat.Xml || innerDatdata.OutputFormat == OutputFormat.SabreDat ? ".xml" : ".dat");
|
||||
string extension = ((innerDatdata.OutputFormatFlag & OutputFormatFlag.Xml) != 0 || (innerDatdata.OutputFormatFlag & OutputFormatFlag.SabreDat) != 0 ? ".xml" : ".dat");
|
||||
if (outputDirectory == "" && Path.GetExtension(file) == extension)
|
||||
{
|
||||
innerDatdata.FileName += ".new";
|
||||
@@ -2623,7 +2625,7 @@ namespace SabreTools.Helper
|
||||
|
||||
userData = new Dat
|
||||
{
|
||||
OutputFormat = (inputDat.OutputFormat != OutputFormat.None ? inputDat.OutputFormat : OutputFormat.None),
|
||||
OutputFormatFlag = (inputDat.OutputFormatFlag != 0 ? inputDat.OutputFormatFlag: 0),
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
MergeRoms = inputDat.MergeRoms,
|
||||
};
|
||||
@@ -2634,7 +2636,7 @@ namespace SabreTools.Helper
|
||||
logger.User("Adding DAT: " + input.Split('¬')[0]);
|
||||
datHeaders[i] = new Dat
|
||||
{
|
||||
OutputFormat = (inputDat.OutputFormat != OutputFormat.None ? inputDat.OutputFormat : OutputFormat.None),
|
||||
OutputFormatFlag = (inputDat.OutputFormatFlag != 0 ? inputDat.OutputFormatFlag: 0),
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
MergeRoms = inputDat.MergeRoms,
|
||||
};
|
||||
@@ -2709,9 +2711,9 @@ namespace SabreTools.Helper
|
||||
}
|
||||
|
||||
// If the DAT has no output format, default to XML
|
||||
if (datdata.OutputFormat == OutputFormat.None)
|
||||
if (datdata.OutputFormatFlag == 0)
|
||||
{
|
||||
datdata.OutputFormat = OutputFormat.Xml;
|
||||
datdata.OutputFormatFlag = OutputFormatFlag.Xml;
|
||||
}
|
||||
|
||||
// Make sure that the three essential fields are filled in
|
||||
@@ -2758,87 +2760,91 @@ namespace SabreTools.Helper
|
||||
SortedDictionary<string, List<Rom>> sortable = BucketByGame(datdata.Files, datdata.MergeRoms, norename, logger);
|
||||
|
||||
// Get the outfile name
|
||||
string outfile = Style.CreateOutfileName(outDir, datdata);
|
||||
|
||||
logger.User("Opening file for writing: " + outfile);
|
||||
Dictionary<OutputFormatFlag, string> outfiles = Style.CreateOutfileNames(outDir, datdata);
|
||||
|
||||
try
|
||||
{
|
||||
FileStream fs = File.Create(outfile);
|
||||
StreamWriter sw = new StreamWriter(fs, Encoding.UTF8);
|
||||
|
||||
// Write out the header
|
||||
WriteHeader(sw, datdata, logger);
|
||||
|
||||
// Write out each of the machines and roms
|
||||
int depth = 2, last = -1;
|
||||
string lastgame = null;
|
||||
List<string> splitpath = new List<string>();
|
||||
|
||||
// Get a properly sorted set of keys
|
||||
List<string> keys = sortable.Keys.ToList();
|
||||
keys.Sort(Style.CompareNumeric);
|
||||
|
||||
foreach (string key in keys)
|
||||
foreach (OutputFormatFlag outputFormatFlag in outfiles.Keys)
|
||||
{
|
||||
List<Rom> roms = sortable[key];
|
||||
string outfile = outfiles[outputFormatFlag];
|
||||
|
||||
for (int index = 0; index < roms.Count; index++)
|
||||
logger.User("Opening file for writing: " + outfile);
|
||||
FileStream fs = File.Create(outfile);
|
||||
StreamWriter sw = new StreamWriter(fs, Encoding.UTF8);
|
||||
|
||||
// Write out the header
|
||||
WriteHeader(sw, outputFormatFlag, datdata, logger);
|
||||
|
||||
// Write out each of the machines and roms
|
||||
int depth = 2, last = -1;
|
||||
string lastgame = null;
|
||||
List<string> splitpath = new List<string>();
|
||||
|
||||
// Get a properly sorted set of keys
|
||||
List<string> keys = sortable.Keys.ToList();
|
||||
keys.Sort(Style.CompareNumeric);
|
||||
|
||||
foreach (string key in keys)
|
||||
{
|
||||
Rom rom = roms[index];
|
||||
List<string> newsplit = rom.Machine.Name.Split('\\').ToList();
|
||||
List<Rom> roms = sortable[key];
|
||||
|
||||
// If we have a different game and we're not at the start of the list, output the end of last item
|
||||
if (lastgame != null && lastgame.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
for (int index = 0; index < roms.Count; index++)
|
||||
{
|
||||
depth = WriteEndGame(sw, rom, splitpath, newsplit, lastgame, datdata, depth, out last, logger);
|
||||
}
|
||||
Rom rom = roms[index];
|
||||
List<string> newsplit = rom.Machine.Name.Split('\\').ToList();
|
||||
|
||||
// If we have a new game, output the beginning of the new item
|
||||
if (lastgame == null || lastgame.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
{
|
||||
depth = WriteStartGame(sw, rom, newsplit, lastgame, datdata, depth, last, logger);
|
||||
}
|
||||
|
||||
// If we have a "null" game (created by DATFromDir or something similar), log it to file
|
||||
if (rom.HashData.Size == -1 && rom.HashData.CRC == "null" && rom.HashData.MD5 == "null" && rom.HashData.SHA1 == "null")
|
||||
{
|
||||
logger.Log("Empty folder found: " + rom.Machine.Name);
|
||||
|
||||
// If we're in a mode that doesn't allow for actual empty folders, add the blank info
|
||||
if (datdata.OutputFormat != OutputFormat.SabreDat && datdata.OutputFormat != OutputFormat.MissFile)
|
||||
// If we have a different game and we're not at the start of the list, output the end of last item
|
||||
if (lastgame != null && lastgame.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
{
|
||||
rom.Name = (rom.Name == "null" ? "-" : rom.Name);
|
||||
rom.HashData.Size = Constants.SizeZero;
|
||||
rom.HashData.CRC = Constants.CRCZero;
|
||||
rom.HashData.MD5 = Constants.MD5Zero;
|
||||
rom.HashData.SHA1 = Constants.SHA1Zero;
|
||||
depth = WriteEndGame(sw, outputFormatFlag, rom, splitpath, newsplit, lastgame, depth, out last, logger);
|
||||
}
|
||||
|
||||
// Otherwise, set the new path and such, write out, and continue
|
||||
else
|
||||
// If we have a new game, output the beginning of the new item
|
||||
if (lastgame == null || lastgame.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
{
|
||||
splitpath = newsplit;
|
||||
lastgame = rom.Machine.Name;
|
||||
continue;
|
||||
depth = WriteStartGame(sw, outputFormatFlag, rom, newsplit, lastgame, depth, last, logger);
|
||||
}
|
||||
|
||||
// If we have a "null" game (created by DATFromDir or something similar), log it to file
|
||||
if (rom.HashData.Size == -1 && rom.HashData.CRC == "null" && rom.HashData.MD5 == "null" && rom.HashData.SHA1 == "null")
|
||||
{
|
||||
logger.Log("Empty folder found: " + rom.Machine.Name);
|
||||
|
||||
// If we're in a mode that doesn't allow for actual empty folders, add the blank info
|
||||
if (outputFormatFlag != OutputFormatFlag.SabreDat && outputFormatFlag != OutputFormatFlag.MissFile)
|
||||
{
|
||||
rom.Name = (rom.Name == "null" ? "-" : rom.Name);
|
||||
rom.HashData.Size = Constants.SizeZero;
|
||||
rom.HashData.CRC = Constants.CRCZero;
|
||||
rom.HashData.MD5 = Constants.MD5Zero;
|
||||
rom.HashData.SHA1 = Constants.SHA1Zero;
|
||||
}
|
||||
|
||||
// Otherwise, set the new path and such, write out, and continue
|
||||
else
|
||||
{
|
||||
splitpath = newsplit;
|
||||
lastgame = rom.Machine.Name;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, outputFormatFlag, rom, lastgame, datdata, depth, logger, ignoreblanks);
|
||||
|
||||
// Set the new data to compare against
|
||||
splitpath = newsplit;
|
||||
lastgame = rom.Machine.Name;
|
||||
}
|
||||
|
||||
// Now, output the rom data
|
||||
WriteRomData(sw, rom, lastgame, datdata, depth, logger, ignoreblanks);
|
||||
|
||||
// Set the new data to compare against
|
||||
splitpath = newsplit;
|
||||
lastgame = rom.Machine.Name;
|
||||
}
|
||||
|
||||
// Write the file footer out
|
||||
WriteFooter(sw, outputFormatFlag, datdata, depth, logger);
|
||||
|
||||
logger.Log("File written!" + Environment.NewLine);
|
||||
sw.Close();
|
||||
fs.Close();
|
||||
}
|
||||
|
||||
// Write the file footer out
|
||||
WriteFooter(sw, datdata, depth, logger);
|
||||
|
||||
logger.Log("File written!" + Environment.NewLine);
|
||||
sw.Close();
|
||||
fs.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -2853,17 +2859,18 @@ namespace SabreTools.Helper
|
||||
/// Write out DAT header using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="outputFormatFlag">Output format to write to</param>
|
||||
/// <param name="datdata">DatData object representing DAT information</param>
|
||||
/// <param name="logger">Logger object for file and console output</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
public static bool WriteHeader(StreamWriter sw, Dat datdata, Logger logger)
|
||||
public static bool WriteHeader(StreamWriter sw, OutputFormatFlag outputFormatFlag, Dat datdata, Logger logger)
|
||||
{
|
||||
try
|
||||
{
|
||||
string header = "";
|
||||
switch (datdata.OutputFormat)
|
||||
switch (outputFormatFlag)
|
||||
{
|
||||
case OutputFormat.ClrMamePro:
|
||||
case OutputFormatFlag.ClrMamePro:
|
||||
header = "clrmamepro (\n" +
|
||||
"\tname \"" + datdata.Name + "\"\n" +
|
||||
"\tdescription \"" + datdata.Description + "\"\n" +
|
||||
@@ -2878,7 +2885,7 @@ namespace SabreTools.Helper
|
||||
(datdata.ForcePacking == ForcePacking.Unzip ? "\tforcezipping no\n" : "") +
|
||||
")\n";
|
||||
break;
|
||||
case OutputFormat.MissFile:
|
||||
case OutputFormatFlag.MissFile:
|
||||
if (datdata.XSV == true)
|
||||
{
|
||||
header = "\"File Name\"\t\"Internal Name\"\t\"Description\"\t\"Game Name\"\t\"Game Description\"\t\"Type\"\t\"" +
|
||||
@@ -2890,7 +2897,7 @@ namespace SabreTools.Helper
|
||||
"Rom Name\",\"Disk Name\",\"Size\",\"CRC\",\"MD5\",\"SHA1\",\"Nodump\"\n";
|
||||
}
|
||||
break;
|
||||
case OutputFormat.RomCenter:
|
||||
case OutputFormatFlag.RomCenter:
|
||||
header = "[CREDITS]\n" +
|
||||
"author=" + datdata.Author + "\n" +
|
||||
"version=" + datdata.Version + "\n" +
|
||||
@@ -2904,7 +2911,7 @@ namespace SabreTools.Helper
|
||||
"version=" + datdata.Description + "\n" +
|
||||
"[GAMES]\n";
|
||||
break;
|
||||
case OutputFormat.SabreDat:
|
||||
case OutputFormatFlag.SabreDat:
|
||||
header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
|
||||
"<!DOCTYPE datafile PUBLIC \"-//Logiqx//DTD ROM Management Datafile//EN\" \"http://www.logiqx.com/Dats/datafile.dtd\">\n\n" +
|
||||
"<datafile>\n" +
|
||||
@@ -2925,7 +2932,7 @@ namespace SabreTools.Helper
|
||||
"\t</header>\n" +
|
||||
"\t<data>\n";
|
||||
break;
|
||||
case OutputFormat.Xml:
|
||||
case OutputFormatFlag.Xml:
|
||||
header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
|
||||
"<!DOCTYPE datafile PUBLIC \"-//Logiqx//DTD ROM Management Datafile//EN\" \"http://www.logiqx.com/Dats/datafile.dtd\">\n\n" +
|
||||
"<datafile>\n" +
|
||||
@@ -2963,15 +2970,15 @@ namespace SabreTools.Helper
|
||||
/// Write out Game start using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="outputFormatFlag">Output format to write to</param>
|
||||
/// <param name="rom">RomData 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="datdata">DatData object representing DAT information</param>
|
||||
/// <param name="depth">Current depth to output file at (SabreDAT only)</param>
|
||||
/// <param name="last">Last known depth to cycle back from (SabreDAT only)</param>
|
||||
/// <param name="logger">Logger object for file and console output</param>
|
||||
/// <returns>The new depth of the tag</returns>
|
||||
public static int WriteStartGame(StreamWriter sw, Rom rom, List<string> newsplit, string lastgame, Dat datdata, int depth, int last, Logger logger)
|
||||
public static int WriteStartGame(StreamWriter sw, OutputFormatFlag outputFormatFlag, Rom rom, List<string> newsplit, string lastgame, int depth, int last, Logger logger)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -2982,13 +2989,13 @@ namespace SabreTools.Helper
|
||||
}
|
||||
|
||||
string state = "";
|
||||
switch (datdata.OutputFormat)
|
||||
switch (outputFormatFlag)
|
||||
{
|
||||
case OutputFormat.ClrMamePro:
|
||||
case OutputFormatFlag.ClrMamePro:
|
||||
state += "game (\n\tname \"" + rom.Machine.Name + "\"\n" +
|
||||
"\tdescription \"" + (String.IsNullOrEmpty(rom.Machine.Description) ? rom.Machine.Name : rom.Machine.Description) + "\"\n";
|
||||
break;
|
||||
case OutputFormat.SabreDat:
|
||||
case OutputFormatFlag.SabreDat:
|
||||
for (int i = (last == -1 ? 0 : last); i < newsplit.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < depth - last + i - (lastgame == null ? 1 : 0); j++)
|
||||
@@ -3000,7 +3007,7 @@ namespace SabreTools.Helper
|
||||
}
|
||||
depth = depth - (last == -1 ? 0 : last) + newsplit.Count;
|
||||
break;
|
||||
case OutputFormat.Xml:
|
||||
case OutputFormatFlag.Xml:
|
||||
state += "\t<machine name=\"" + HttpUtility.HtmlEncode(rom.Machine.Name) + "\">\n" +
|
||||
"\t\t<description>" + HttpUtility.HtmlEncode((String.IsNullOrEmpty(rom.Machine.Description) ? rom.Machine.Name : rom.Machine.Description)) + "</description>\n";
|
||||
break;
|
||||
@@ -3021,16 +3028,16 @@ namespace SabreTools.Helper
|
||||
/// Write out Game start using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="outputFormatFlag">Output format to write to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="splitpath">Split path representing last kwown parent game (SabreDAT only)</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="datdata">DatData object representing DAT information</param>
|
||||
/// <param name="depth">Current depth to output file at (SabreDAT only)</param>
|
||||
/// <param name="last">Last known depth to cycle back from (SabreDAT only)</param>
|
||||
/// <param name="logger">Logger object for file and console output</param>
|
||||
/// <returns>The new depth of the tag</returns>
|
||||
public static int WriteEndGame(StreamWriter sw, Rom rom, List<string> splitpath, List<string> newsplit, string lastgame, Dat datdata, int depth, out int last, Logger logger)
|
||||
public static int WriteEndGame(StreamWriter sw, OutputFormatFlag outputFormatFlag, Rom rom, List<string> splitpath, List<string> newsplit, string lastgame, int depth, out int last, Logger logger)
|
||||
{
|
||||
last = 0;
|
||||
|
||||
@@ -3038,12 +3045,12 @@ namespace SabreTools.Helper
|
||||
{
|
||||
string state = "";
|
||||
|
||||
switch (datdata.OutputFormat)
|
||||
switch (outputFormatFlag)
|
||||
{
|
||||
case OutputFormat.ClrMamePro:
|
||||
case OutputFormatFlag.ClrMamePro:
|
||||
state += ")\n";
|
||||
break;
|
||||
case OutputFormat.SabreDat:
|
||||
case OutputFormatFlag.SabreDat:
|
||||
if (splitpath != null)
|
||||
{
|
||||
for (int i = 0; i < newsplit.Count && i < splitpath.Count; i++)
|
||||
@@ -3073,7 +3080,7 @@ namespace SabreTools.Helper
|
||||
depth = 2 + last;
|
||||
}
|
||||
break;
|
||||
case OutputFormat.Xml:
|
||||
case OutputFormatFlag.Xml:
|
||||
state += "\t</machine>\n";
|
||||
break;
|
||||
}
|
||||
@@ -3093,6 +3100,7 @@ namespace SabreTools.Helper
|
||||
/// Write out RomData using the supplied StreamWriter
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter to output to</param>
|
||||
/// <param name="outputFormatFlag">Output format to write to</param>
|
||||
/// <param name="rom">RomData object to be output</param>
|
||||
/// <param name="lastgame">The name of the last game to be output</param>
|
||||
/// <param name="datdata">DatData object representing DAT information</param>
|
||||
@@ -3100,7 +3108,7 @@ namespace SabreTools.Helper
|
||||
/// <param name="logger">Logger object for file and console 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>
|
||||
public static bool WriteRomData(StreamWriter sw, Rom rom, string lastgame, Dat datdata, int depth, Logger logger, bool ignoreblanks = false)
|
||||
public static bool WriteRomData(StreamWriter sw, OutputFormatFlag outputFormatFlag, Rom rom, string lastgame, Dat datdata, int depth, Logger logger, bool ignoreblanks = false)
|
||||
{
|
||||
// If we are in ignore blanks mode AND we have a blank (0-size) rom, skip
|
||||
if (ignoreblanks && (rom.HashData.Size == 0 || rom.HashData.Size == -1))
|
||||
@@ -3111,9 +3119,9 @@ namespace SabreTools.Helper
|
||||
try
|
||||
{
|
||||
string state = "";
|
||||
switch (datdata.OutputFormat)
|
||||
switch (outputFormatFlag)
|
||||
{
|
||||
case OutputFormat.ClrMamePro:
|
||||
case OutputFormatFlag.ClrMamePro:
|
||||
state += "\t" + rom.Type.ToString().ToLowerInvariant() + " ( name \"" + rom.Name + "\"" +
|
||||
(rom.HashData.Size != -1 ? " size " + rom.HashData.Size : "") +
|
||||
(!String.IsNullOrEmpty(rom.HashData.CRC) ? " crc " + rom.HashData.CRC.ToLowerInvariant() : "") +
|
||||
@@ -3123,7 +3131,7 @@ namespace SabreTools.Helper
|
||||
(rom.Nodump ? " flags nodump" : "") +
|
||||
" )\n";
|
||||
break;
|
||||
case OutputFormat.MissFile:
|
||||
case OutputFormatFlag.MissFile:
|
||||
string pre = datdata.Prefix + (datdata.Quotes ? "\"" : "");
|
||||
string post = (datdata.Quotes ? "\"" : "") + datdata.Postfix;
|
||||
|
||||
@@ -3188,23 +3196,23 @@ namespace SabreTools.Helper
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OutputFormat.RedumpMD5:
|
||||
case OutputFormatFlag.RedumpMD5:
|
||||
state += rom.HashData.MD5 + " *" + rom.Name + "\n";
|
||||
break;
|
||||
case OutputFormat.RedumpSFV:
|
||||
case OutputFormatFlag.RedumpSFV:
|
||||
state += rom.Name + " " + rom.HashData.CRC + "\n";
|
||||
break;
|
||||
case OutputFormat.RedumpSHA1:
|
||||
case OutputFormatFlag.RedumpSHA1:
|
||||
state += rom.HashData.SHA1 + " *" + rom.Name + "\n";
|
||||
break;
|
||||
case OutputFormat.RomCenter:
|
||||
case OutputFormatFlag.RomCenter:
|
||||
state += "¬¬¬" + HttpUtility.HtmlEncode(rom.Machine) +
|
||||
"¬" + HttpUtility.HtmlEncode((String.IsNullOrEmpty(rom.Machine.Description) ? rom.Machine.Name : rom.Machine.Description)) +
|
||||
"¬" + HttpUtility.HtmlEncode(rom.Name) +
|
||||
"¬" + rom.HashData.CRC.ToLowerInvariant() +
|
||||
"¬" + (rom.HashData.Size != -1 ? rom.HashData.Size.ToString() : "") + "¬¬¬\n";
|
||||
break;
|
||||
case OutputFormat.SabreDat:
|
||||
case OutputFormatFlag.SabreDat:
|
||||
string prefix = "";
|
||||
for (int i = 0; i < depth; i++)
|
||||
{
|
||||
@@ -3224,7 +3232,7 @@ namespace SabreTools.Helper
|
||||
prefix + "</file>\n" :
|
||||
"/>\n");
|
||||
break;
|
||||
case OutputFormat.Xml:
|
||||
case OutputFormatFlag.Xml:
|
||||
state += "\t\t<" + rom.Type.ToString().ToLowerInvariant() + " name=\"" + HttpUtility.HtmlEncode(rom.Name) + "\"" +
|
||||
(rom.HashData.Size != -1 ? " size=\"" + rom.HashData.Size + "\"" : "") +
|
||||
(!String.IsNullOrEmpty(rom.HashData.CRC) ? " crc=\"" + rom.HashData.CRC.ToLowerInvariant() + "\"" : "") +
|
||||
@@ -3255,7 +3263,7 @@ namespace SabreTools.Helper
|
||||
/// <param name="depth">Current depth to output file at (SabreDAT only)</param>
|
||||
/// <param name="logger">Logger object for file and console output</param>
|
||||
/// <returns>True if the data was written, false on error</returns>
|
||||
public static bool WriteFooter(StreamWriter sw, Dat datdata, int depth, Logger logger)
|
||||
public static bool WriteFooter(StreamWriter sw, OutputFormatFlag outputFormatFlag, Dat datdata, int depth, Logger logger)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -3264,12 +3272,12 @@ namespace SabreTools.Helper
|
||||
// If we have roms, output the full footer
|
||||
if (datdata.Files != null && datdata.Files.Count > 0)
|
||||
{
|
||||
switch (datdata.OutputFormat)
|
||||
switch (outputFormatFlag)
|
||||
{
|
||||
case OutputFormat.ClrMamePro:
|
||||
case OutputFormatFlag.ClrMamePro:
|
||||
footer = ")";
|
||||
break;
|
||||
case OutputFormat.SabreDat:
|
||||
case OutputFormatFlag.SabreDat:
|
||||
for (int i = depth - 1; i >= 2; i--)
|
||||
{
|
||||
// Print out the number of tabs and the end folder
|
||||
@@ -3281,7 +3289,7 @@ namespace SabreTools.Helper
|
||||
}
|
||||
footer += "\t</data>\n</datafile>";
|
||||
break;
|
||||
case OutputFormat.Xml:
|
||||
case OutputFormatFlag.Xml:
|
||||
footer = "\t</machine>\n</datafile>";
|
||||
break;
|
||||
}
|
||||
@@ -3290,10 +3298,10 @@ namespace SabreTools.Helper
|
||||
// Otherwise, output the abbreviated form
|
||||
else
|
||||
{
|
||||
switch (datdata.OutputFormat)
|
||||
switch (outputFormatFlag)
|
||||
{
|
||||
case OutputFormat.SabreDat:
|
||||
case OutputFormat.Xml:
|
||||
case OutputFormatFlag.SabreDat:
|
||||
case OutputFormatFlag.Xml:
|
||||
footer = "</datafile>";
|
||||
break;
|
||||
}
|
||||
@@ -3343,8 +3351,8 @@ namespace SabreTools.Helper
|
||||
string newExtBString = string.Join(",", newExtB);
|
||||
|
||||
// Get the file format
|
||||
OutputFormat outputFormat = GetOutputFormat(filename, logger);
|
||||
if (outputFormat == OutputFormat.None)
|
||||
OutputFormatFlag outputFormatFlag = GetOutputFormat(filename, logger);
|
||||
if (outputFormatFlag == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -3368,7 +3376,7 @@ namespace SabreTools.Helper
|
||||
Url = datdata.Url,
|
||||
Comment = datdata.Comment,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
OutputFormat = outputFormat,
|
||||
OutputFormatFlag = outputFormatFlag,
|
||||
};
|
||||
Dat datdataB = new Dat
|
||||
{
|
||||
@@ -3384,7 +3392,7 @@ namespace SabreTools.Helper
|
||||
Url = datdata.Url,
|
||||
Comment = datdata.Comment,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
OutputFormat = outputFormat,
|
||||
OutputFormatFlag = outputFormatFlag,
|
||||
};
|
||||
|
||||
// If roms is empty, return false
|
||||
@@ -3481,8 +3489,8 @@ namespace SabreTools.Helper
|
||||
basepath = (basepath.EndsWith(Path.DirectorySeparatorChar.ToString()) ? basepath : basepath + Path.DirectorySeparatorChar);
|
||||
|
||||
// Get the file format
|
||||
OutputFormat outputFormat = GetOutputFormat(filename, logger);
|
||||
if (outputFormat == OutputFormat.None)
|
||||
OutputFormatFlag outputFormatFlag = GetOutputFormat(filename, logger);
|
||||
if (outputFormatFlag == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -3511,7 +3519,7 @@ namespace SabreTools.Helper
|
||||
ForceMerging = datdata.ForceMerging,
|
||||
ForceNodump = datdata.ForceNodump,
|
||||
ForcePacking = datdata.ForcePacking,
|
||||
OutputFormat = outputFormat,
|
||||
OutputFormatFlag = outputFormatFlag,
|
||||
MergeRoms = datdata.MergeRoms,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
};
|
||||
@@ -3533,7 +3541,7 @@ namespace SabreTools.Helper
|
||||
ForceMerging = datdata.ForceMerging,
|
||||
ForceNodump = datdata.ForceNodump,
|
||||
ForcePacking = datdata.ForcePacking,
|
||||
OutputFormat = outputFormat,
|
||||
OutputFormatFlag = outputFormatFlag,
|
||||
MergeRoms = datdata.MergeRoms,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
};
|
||||
@@ -3555,7 +3563,7 @@ namespace SabreTools.Helper
|
||||
ForceMerging = datdata.ForceMerging,
|
||||
ForceNodump = datdata.ForceNodump,
|
||||
ForcePacking = datdata.ForcePacking,
|
||||
OutputFormat = outputFormat,
|
||||
OutputFormatFlag = outputFormatFlag,
|
||||
MergeRoms = datdata.MergeRoms,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
};
|
||||
@@ -3577,7 +3585,7 @@ namespace SabreTools.Helper
|
||||
ForceMerging = datdata.ForceMerging,
|
||||
ForceNodump = datdata.ForceNodump,
|
||||
ForcePacking = datdata.ForcePacking,
|
||||
OutputFormat = outputFormat,
|
||||
OutputFormatFlag = outputFormatFlag,
|
||||
MergeRoms = datdata.MergeRoms,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
};
|
||||
@@ -3695,8 +3703,8 @@ namespace SabreTools.Helper
|
||||
basepath = (basepath.EndsWith(Path.DirectorySeparatorChar.ToString()) ? basepath : basepath + Path.DirectorySeparatorChar);
|
||||
|
||||
// Get the file format
|
||||
OutputFormat outputFormat = GetOutputFormat(filename, logger);
|
||||
if (outputFormat == OutputFormat.None)
|
||||
OutputFormatFlag outputFormatFlag = GetOutputFormat(filename, logger);
|
||||
if (outputFormatFlag == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -3725,7 +3733,7 @@ namespace SabreTools.Helper
|
||||
ForceMerging = datdata.ForceMerging,
|
||||
ForceNodump = datdata.ForceNodump,
|
||||
ForcePacking = datdata.ForcePacking,
|
||||
OutputFormat = outputFormat,
|
||||
OutputFormatFlag = outputFormatFlag,
|
||||
MergeRoms = datdata.MergeRoms,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
};
|
||||
@@ -3747,7 +3755,7 @@ namespace SabreTools.Helper
|
||||
ForceMerging = datdata.ForceMerging,
|
||||
ForceNodump = datdata.ForceNodump,
|
||||
ForcePacking = datdata.ForcePacking,
|
||||
OutputFormat = outputFormat,
|
||||
OutputFormatFlag = outputFormatFlag,
|
||||
MergeRoms = datdata.MergeRoms,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace SabreTools.Helper
|
||||
datdata.FileName = (String.IsNullOrEmpty(datdata.FileName) ? (keepext ? Path.GetFileName(filename) : Path.GetFileNameWithoutExtension(filename)) : datdata.FileName);
|
||||
|
||||
// If the output type isn't set already, get the internal output type
|
||||
datdata.OutputFormat = (datdata.OutputFormat == OutputFormat.None ? DatTools.GetOutputFormat(filename, logger) : datdata.OutputFormat);
|
||||
datdata.OutputFormatFlag = (datdata.OutputFormatFlag == 0 ? DatTools.GetOutputFormat(filename, logger) : datdata.OutputFormatFlag);
|
||||
|
||||
// Make sure there's a dictionary to read to
|
||||
if (datdata.Hashes == null)
|
||||
@@ -50,12 +50,12 @@ namespace SabreTools.Helper
|
||||
// Now parse the correct type of DAT
|
||||
switch (DatTools.GetOutputFormat(filename, logger))
|
||||
{
|
||||
case OutputFormat.ClrMamePro:
|
||||
case OutputFormatFlag.ClrMamePro:
|
||||
return ParseCMP(filename, sysid, srcid, datdata, logger, keep, clean);
|
||||
case OutputFormat.RomCenter:
|
||||
case OutputFormatFlag.RomCenter:
|
||||
return ParseRC(filename, sysid, srcid, datdata, logger, clean);
|
||||
case OutputFormat.SabreDat:
|
||||
case OutputFormat.Xml:
|
||||
case OutputFormatFlag.SabreDat:
|
||||
case OutputFormatFlag.Xml:
|
||||
return ParseXML(filename, sysid, srcid, datdata, logger, keep, clean, softlist);
|
||||
default:
|
||||
return datdata;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -151,49 +152,74 @@ namespace SabreTools.Helper
|
||||
/// </summary>
|
||||
/// <param name="outDir">Output directory</param>
|
||||
/// <param name="datdata">DAT information</param>
|
||||
/// <returns>String representing the proper name</returns>
|
||||
public static string CreateOutfileName(string outDir, Dat datdata)
|
||||
/// <returns>Dictionary of output formats mapped to file names</returns>
|
||||
public static Dictionary<OutputFormatFlag, string> CreateOutfileNames(string outDir, Dat datdata)
|
||||
{
|
||||
// Create the output dictionary
|
||||
Dictionary<OutputFormatFlag, string> outfileNames = new Dictionary<OutputFormatFlag, string>();
|
||||
|
||||
// Double check the outdir for the end delim
|
||||
if (!outDir.EndsWith(Path.DirectorySeparatorChar.ToString()))
|
||||
{
|
||||
outDir += Path.DirectorySeparatorChar;
|
||||
}
|
||||
|
||||
// Get the extension from the output type
|
||||
string extension = "";
|
||||
switch(datdata.OutputFormat)
|
||||
// Get the extensions from the output type
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.Xml) != 0)
|
||||
{
|
||||
case OutputFormat.ClrMamePro:
|
||||
case OutputFormat.DOSCenter:
|
||||
case OutputFormat.RomCenter:
|
||||
extension = ".dat";
|
||||
break;
|
||||
case OutputFormat.MissFile:
|
||||
extension = ".txt";
|
||||
break;
|
||||
case OutputFormat.SabreDat:
|
||||
case OutputFormat.Xml:
|
||||
extension = ".xml";
|
||||
break;
|
||||
case OutputFormat.RedumpMD5:
|
||||
extension = ".md5";
|
||||
break;
|
||||
case OutputFormat.RedumpSFV:
|
||||
extension = ".sfv";
|
||||
break;
|
||||
case OutputFormat.RedumpSHA1:
|
||||
extension = ".sha1";
|
||||
break;
|
||||
}
|
||||
outfileNames.Add(OutputFormatFlag.Xml, CreateOutfileNamesHelper(outDir, ".xml", datdata));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.ClrMamePro) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.ClrMamePro, CreateOutfileNamesHelper(outDir, ".dat", datdata));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.RomCenter) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.RomCenter, CreateOutfileNamesHelper(outDir, ".rc.dat", datdata));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.DOSCenter) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.DOSCenter, CreateOutfileNamesHelper(outDir, ".dc.dat", datdata));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.MissFile) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.MissFile, CreateOutfileNamesHelper(outDir, ".txt", datdata));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.SabreDat) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.SabreDat, CreateOutfileNamesHelper(outDir, ".sd.xml", datdata));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.RedumpMD5) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.RedumpMD5, CreateOutfileNamesHelper(outDir, ".md5", datdata));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.RedumpSHA1) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.RedumpSHA1, CreateOutfileNamesHelper(outDir, ".sha1", datdata));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.RedumpSFV) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.RedumpSFV, CreateOutfileNamesHelper(outDir, ".sfv", datdata));
|
||||
};
|
||||
|
||||
return outfileNames;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Help generating the outfile name
|
||||
/// </summary>
|
||||
/// <param name="outDir">Output directory</param>
|
||||
/// <param name="extension">Extension to use for the file</param>
|
||||
/// <param name="datdata">DAT information</param>
|
||||
/// <returns>String containing the new filename</returns>
|
||||
private static string CreateOutfileNamesHelper(string outDir, string extension, Dat datdata)
|
||||
{
|
||||
string filename = (String.IsNullOrEmpty(datdata.FileName) ? datdata.Description : datdata.FileName);
|
||||
string outfile = outDir + filename + extension;
|
||||
outfile = (outfile.Contains(Path.DirectorySeparatorChar.ToString() + Path.DirectorySeparatorChar.ToString()) ?
|
||||
outfile.Replace(Path.DirectorySeparatorChar.ToString() + Path.DirectorySeparatorChar.ToString(), Path.DirectorySeparatorChar.ToString()) :
|
||||
outfile);
|
||||
|
||||
Console.WriteLine(outfile);
|
||||
|
||||
return outfile;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace SabreTools
|
||||
/// <param name="forcemerge">None, Split, Full</param>
|
||||
/// <param name="forcend">None, Obsolete, Required, Ignore</param>
|
||||
/// <param name="forcepack">None, Zip, Unzip</param>
|
||||
/// <param name="outputFormatFlag">Non-zero flag for output format, zero otherwise</param>
|
||||
/// <param name="outputFormatFlag">Non-zero flag for output format, zero otherwise for default</param>
|
||||
/// /* Missfile-specific DAT info */
|
||||
/// <param name="usegame">True if games are to be used in output, false if roms are</param>
|
||||
/// <param name="prefix">Generic prefix to be added to each line</param>
|
||||
@@ -303,6 +303,7 @@ namespace SabreTools
|
||||
ForceNodump = fn,
|
||||
ForcePacking = fp,
|
||||
MergeRoms = dedup,
|
||||
OutputFormatFlag = outputFormatFlag,
|
||||
|
||||
UseGame = usegame,
|
||||
Prefix = prefix,
|
||||
@@ -315,59 +316,8 @@ namespace SabreTools
|
||||
XSV = tsv,
|
||||
};
|
||||
|
||||
if ((outputFormatFlag & OutputFormatFlag.ClrMamePro) != 0)
|
||||
{
|
||||
userInputDat.OutputFormat = OutputFormat.ClrMamePro;
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
if ((outputFormatFlag & OutputFormatFlag.MissFile) != 0 || tsv != null)
|
||||
{
|
||||
userInputDat.OutputFormat = OutputFormat.MissFile;
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
if ((outputFormatFlag & OutputFormatFlag.RedumpMD5) != 0)
|
||||
{
|
||||
userInputDat.OutputFormat = OutputFormat.RedumpMD5;
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
if ((outputFormatFlag & OutputFormatFlag.RedumpSFV) != 0)
|
||||
{
|
||||
userInputDat.OutputFormat = OutputFormat.RedumpSFV;
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
if ((outputFormatFlag & OutputFormatFlag.RedumpSHA1) != 0)
|
||||
{
|
||||
userInputDat.OutputFormat = OutputFormat.RedumpSHA1;
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
if ((outputFormatFlag & OutputFormatFlag.RomCenter) != 0)
|
||||
{
|
||||
userInputDat.OutputFormat = OutputFormat.RomCenter;
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
if ((outputFormatFlag & OutputFormatFlag.SabreDat) != 0)
|
||||
{
|
||||
userInputDat.OutputFormat = OutputFormat.SabreDat;
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
if ((outputFormatFlag & OutputFormatFlag.Xml) != 0)
|
||||
{
|
||||
userInputDat.OutputFormat = OutputFormat.Xml;
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
if (outputFormatFlag == 0 && tsv == null)
|
||||
{
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outputFormatFlag, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -419,7 +369,7 @@ namespace SabreTools
|
||||
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||
Author = author,
|
||||
ForcePacking = (forceunpack ? ForcePacking.Unzip : ForcePacking.None),
|
||||
OutputFormat = (old ? OutputFormat.ClrMamePro : OutputFormat.Xml),
|
||||
OutputFormatFlag = (old ? OutputFormatFlag.ClrMamePro : OutputFormatFlag.Xml),
|
||||
Romba = romba,
|
||||
Type = (superdat ? "SuperDAT" : ""),
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
@@ -487,7 +437,7 @@ namespace SabreTools
|
||||
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||
Author = author,
|
||||
ForcePacking = (forceunpack ? ForcePacking.Unzip : ForcePacking.None),
|
||||
OutputFormat = (old ? OutputFormat.ClrMamePro : OutputFormat.Xml),
|
||||
OutputFormatFlag = (old ? OutputFormatFlag.ClrMamePro : OutputFormatFlag.Xml),
|
||||
Romba = romba,
|
||||
Type = (superdat ? "SuperDAT" : ""),
|
||||
};
|
||||
|
||||
@@ -241,7 +241,7 @@ Make a selection:
|
||||
private static void ConvertMenu()
|
||||
{
|
||||
string selection = "", input = "", outdir = "";
|
||||
OutputFormat outputFormat = OutputFormat.Xml;
|
||||
OutputFormatFlag outputFormatFlag = OutputFormatFlag.Xml;
|
||||
while (selection.ToLowerInvariant() != "b")
|
||||
{
|
||||
Console.Clear();
|
||||
@@ -252,7 +252,7 @@ Make a selection:
|
||||
|
||||
1) File or folder to convert" + (input == "" ? "" : ":\n" + input) + @"
|
||||
2) New output folder" + (outdir == "" ? " (blank means source directory)" : ":\n" + outdir) + @"
|
||||
3) Current output type: " + (outputFormat.ToString()) + @"
|
||||
3) Current output type: " + (outputFormatFlag.ToString()) + @"
|
||||
4) Process file or folder
|
||||
B) Go back to the previous menu
|
||||
");
|
||||
@@ -287,16 +287,16 @@ Make a selection:
|
||||
switch (subsel)
|
||||
{
|
||||
case "1":
|
||||
outputFormat = OutputFormat.Xml;
|
||||
outputFormatFlag = OutputFormatFlag.Xml;
|
||||
break;
|
||||
case "2":
|
||||
outputFormat = OutputFormat.ClrMamePro;
|
||||
outputFormatFlag = OutputFormatFlag.ClrMamePro;
|
||||
break;
|
||||
case "3":
|
||||
outputFormat = OutputFormat.RomCenter;
|
||||
outputFormatFlag = OutputFormatFlag.RomCenter;
|
||||
break;
|
||||
case "4":
|
||||
outputFormat = OutputFormat.SabreDat;
|
||||
outputFormatFlag = OutputFormatFlag.SabreDat;
|
||||
break;
|
||||
default:
|
||||
subsel = "";
|
||||
@@ -310,14 +310,14 @@ Make a selection:
|
||||
temp.Add(input);
|
||||
/*
|
||||
InitUpdate(temp, "", "", "", "", "", "", "", "", "", "", "", "", false, "", "", "",
|
||||
(outputFormat == OutputFormat.ClrMamePro), (outputFormat == OutputFormat.MissFile), (outputFormat == OutputFormat.RomCenter),
|
||||
(outputFormat == OutputFormat.SabreDat), (outputFormat == OutputFormat.Xml), false, "", "", false, "", "", false, false, false,
|
||||
(outputFormatFlag == OutputFormatFlag.ClrMamePro), (outputFormatFlag == OutputFormatFlag.MissFile), (outputFormatFlag == OutputFormatFlag.RomCenter),
|
||||
(outputFormatFlag == OutputFormatFlag.SabreDat), (outputFormatFlag == OutputFormatFlag.Xml), false, "", "", false, "", "", false, false, false,
|
||||
false, false, false, false, false, "", "", "", -1, -1, -1, "", "", "", null, outdir, false, false);
|
||||
*/
|
||||
Console.Write("\nPress any key to continue...");
|
||||
Console.ReadKey();
|
||||
input = ""; outdir = "";
|
||||
outputFormat = OutputFormat.Xml;
|
||||
outputFormatFlag = OutputFormatFlag.Xml;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ namespace SabreTools
|
||||
_matched.FileName = "fixDat_" + _matched.FileName;
|
||||
_matched.Name = "fixDat_" + _matched.Name;
|
||||
_matched.Description = "fixDat_" + _matched.Description;
|
||||
_matched.OutputFormat = OutputFormat.Xml;
|
||||
_matched.OutputFormatFlag = OutputFormatFlag.Xml;
|
||||
|
||||
// Now that all files are parsed, get only files found in directory
|
||||
bool found = false;
|
||||
@@ -476,7 +476,7 @@ namespace SabreTools
|
||||
_datdata.FileName = "fixDat_" + _datdata.FileName;
|
||||
_datdata.Name = "fixDat_" + _datdata.Name;
|
||||
_datdata.Description = "fixDat_" + _datdata.Description;
|
||||
_datdata.OutputFormat = OutputFormat.Xml;
|
||||
_datdata.OutputFormatFlag = OutputFormatFlag.Xml;
|
||||
DatTools.WriteDatfile(_datdata, "", _logger);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user