mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Tweak stats output and input handling
This commit is contained in:
@@ -426,7 +426,7 @@ namespace SabreTools.Library.DatFiles
|
||||
outDir = DirectoryExtensions.Ensure(outDir);
|
||||
|
||||
// Get the dictionary of desired output report names
|
||||
Dictionary<StatReportFormat, string> outputs = DatStats.CreateOutStatsNames(outDir, statDatFormat, reportName);
|
||||
Dictionary<StatReportFormat, string> outputs = CreateOutStatsNames(outDir, statDatFormat, reportName);
|
||||
|
||||
// Make sure we have all files and then order them
|
||||
List<string> files = DirectoryExtensions.GetFilesOnly(inputs);
|
||||
@@ -551,7 +551,6 @@ Please check the log folder if the stats scrolled offscreen", false);
|
||||
outDir += Path.DirectorySeparatorChar;
|
||||
|
||||
// For each output format, get the appropriate stream writer
|
||||
if (statDatFormat.HasFlag(StatReportFormat.None))
|
||||
output.Add(StatReportFormat.None, CreateOutStatsNamesHelper(outDir, ".null", reportName, overwrite));
|
||||
|
||||
if (statDatFormat.HasFlag(StatReportFormat.Textfile))
|
||||
|
||||
@@ -29,7 +29,10 @@ namespace SabreTools.Library.Reports
|
||||
/// <param name="nodumpCol">True if nodumps should be included in output, false otherwise</param>
|
||||
public BaseReport(string filename, bool baddumpCol = false, bool nodumpCol = false)
|
||||
{
|
||||
_writer = new StreamWriter(FileExtensions.TryCreate(filename));
|
||||
var fs = FileExtensions.TryCreate(filename);
|
||||
if (fs != null)
|
||||
_writer = new StreamWriter(fs);
|
||||
|
||||
_baddumpCol = baddumpCol;
|
||||
_nodumpCol = nodumpCol;
|
||||
}
|
||||
|
||||
@@ -3321,10 +3321,22 @@ The stats that are outputted are as follows:
|
||||
|
||||
public override void ProcessFeatures(Dictionary<string, Feature> features)
|
||||
{
|
||||
string filename = GetDatHeader(features).FileName;
|
||||
string outputDir = GetString(features, OutputDirStringValue);
|
||||
if (Path.GetFileName(filename) != filename)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(outputDir))
|
||||
outputDir = Path.GetDirectoryName(filename);
|
||||
else
|
||||
outputDir = Path.Combine(outputDir, Path.GetDirectoryName(filename));
|
||||
|
||||
filename = Path.GetFileName(filename);
|
||||
}
|
||||
|
||||
DatStats.OutputStats(
|
||||
Inputs,
|
||||
GetDatHeader(features).FileName,
|
||||
GetString(features, OutputDirStringValue),
|
||||
filename,
|
||||
outputDir,
|
||||
GetBoolean(features, IndividualValue),
|
||||
GetBoolean(features, BaddumpColumnValue),
|
||||
GetBoolean(features, NodumpColumnValue),
|
||||
|
||||
Reference in New Issue
Block a user