mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[SabreTools, Flags, DatFile, DatSTats] StatReportFormat stuff
This commit is contained in:
@@ -752,6 +752,27 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
// Statistical data related to the DAT
|
||||
public StatReportFormat ReportFormat
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_datStats == null)
|
||||
{
|
||||
_datStats = new DatStats();
|
||||
}
|
||||
|
||||
return _datStats.ReportFormat;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_datStats == null)
|
||||
{
|
||||
_datStats = new DatStats();
|
||||
}
|
||||
|
||||
_datStats.ReportFormat = value;
|
||||
}
|
||||
}
|
||||
public long Count
|
||||
{
|
||||
get
|
||||
@@ -5884,9 +5905,9 @@ namespace SabreTools.Library.DatFiles
|
||||
bool baddumpCol, bool nodumpCol, StatReportFormat statDatFormat)
|
||||
{
|
||||
// If there's no output format, set the default
|
||||
if (statDatFormat == 0x0)
|
||||
if (statDatFormat == StatReportFormat.None)
|
||||
{
|
||||
statDatFormat = StatReportFormat.None;
|
||||
statDatFormat = StatReportFormat.Textfile;
|
||||
}
|
||||
|
||||
// Get the proper output file name
|
||||
@@ -5916,7 +5937,7 @@ namespace SabreTools.Library.DatFiles
|
||||
BaseReport report = null;
|
||||
switch (kvp.Key)
|
||||
{
|
||||
case StatReportFormat.None:
|
||||
case StatReportFormat.Textfile:
|
||||
report = new Textfile(null, kvp.Value, baddumpCol, nodumpCol);
|
||||
break;
|
||||
case StatReportFormat.CSV:
|
||||
@@ -6071,9 +6092,9 @@ Please check the log folder if the stats scrolled offscreen", false);
|
||||
}
|
||||
|
||||
// For each output format, get the appropriate stream writer
|
||||
if ((statDatFormat & StatReportFormat.None) != 0)
|
||||
if ((statDatFormat & StatReportFormat.Textfile) != 0)
|
||||
{
|
||||
output.Add(StatReportFormat.None, CreateOutStatsNamesHelper(outDir, ".txt", reportName, overwrite));
|
||||
output.Add(StatReportFormat.Textfile, CreateOutStatsNamesHelper(outDir, ".txt", reportName, overwrite));
|
||||
}
|
||||
if ((statDatFormat & StatReportFormat.CSV) != 0)
|
||||
{
|
||||
|
||||
@@ -12,6 +12,9 @@ namespace SabreTools.Library.DatFiles
|
||||
{
|
||||
#region Private instance variables
|
||||
|
||||
// Statistics report format
|
||||
private StatReportFormat _reportFormat = StatReportFormat.None;
|
||||
|
||||
// Object used to lock stats updates
|
||||
private object _lockObject = new object();
|
||||
|
||||
@@ -50,6 +53,13 @@ namespace SabreTools.Library.DatFiles
|
||||
|
||||
#region Publicly facing variables
|
||||
|
||||
// Statistics report format
|
||||
public StatReportFormat ReportFormat
|
||||
{
|
||||
get { return _reportFormat; }
|
||||
set { _reportFormat = value; }
|
||||
}
|
||||
|
||||
// Overall item count
|
||||
public long Count
|
||||
{
|
||||
|
||||
@@ -245,15 +245,16 @@ namespace SabreTools.Library.Data
|
||||
/// <summary>
|
||||
/// Determine which format to output Stats to
|
||||
/// </summary>
|
||||
/// [Flags]
|
||||
[Flags]
|
||||
public enum StatReportFormat
|
||||
{
|
||||
None = 0x01,
|
||||
HTML = None << 1,
|
||||
None = 0x0,
|
||||
Textfile = 0x01,
|
||||
HTML = Textfile << 1,
|
||||
CSV = HTML << 1,
|
||||
TSV = CSV << 1,
|
||||
|
||||
All = None | HTML | CSV | TSV,
|
||||
All = Textfile | HTML | CSV | TSV,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace SabreTools
|
||||
OutputFormat outputFormat = OutputFormat.Folder;
|
||||
SkipFileType skipFileType = SkipFileType.None;
|
||||
SplitType splitType = SplitType.None;
|
||||
StatReportFormat statDatFormat = 0x0;
|
||||
StatReportFormat statDatFormat = StatReportFormat.None;
|
||||
UpdateMode updateMode = UpdateMode.None;
|
||||
|
||||
// User inputs
|
||||
@@ -638,7 +638,7 @@ namespace SabreTools
|
||||
break;
|
||||
case "-txt":
|
||||
case "--text":
|
||||
statDatFormat |= StatReportFormat.None;
|
||||
statDatFormat |= StatReportFormat.Textfile;
|
||||
break;
|
||||
case "-tzip":
|
||||
case "--tzip":
|
||||
|
||||
Reference in New Issue
Block a user