[SabreTools, Flags, DatFile, Utilities, README] Stat output

Add new input that mirrors the input for DAT formats. This also introduces the SSV statistics output format
This commit is contained in:
Matt Nadareski
2018-03-12 21:18:25 -07:00
parent 79ba3c1044
commit eb71c16454
6 changed files with 106 additions and 22 deletions

View File

@@ -6226,6 +6226,10 @@ Please check the log folder if the stats scrolled offscreen", false);
{
output.Add(StatReportFormat.HTML, CreateOutStatsNamesHelper(outDir, ".html", reportName, overwrite));
}
if ((statDatFormat & StatReportFormat.SSV) != 0)
{
output.Add(StatReportFormat.SSV, CreateOutStatsNamesHelper(outDir, ".ssv", reportName, overwrite));
}
if ((statDatFormat & StatReportFormat.TSV) != 0)
{
output.Add(StatReportFormat.TSV, CreateOutStatsNamesHelper(outDir, ".tsv", reportName, overwrite));

View File

@@ -273,9 +273,10 @@ namespace SabreTools.Library.Data
Textfile = 0x01,
HTML = Textfile << 1,
CSV = HTML << 1,
TSV = CSV << 1,
SSV = CSV << 1,
TSV = SSV << 1,
All = Textfile | HTML | CSV | TSV,
All = Textfile | HTML | CSV | SSV | TSV,
}
/// <summary>

View File

@@ -637,21 +637,38 @@ Options:
- Items that include a SHA-512
- Items with Nodump status
-as, --all-stats Write all statistics to all available formats
-srt, --report-type Output statistics to a specified format
Add outputting the created DAT to known format. Multiple instances
of this flag are allowed.
Possible values are:
all - All available DAT types
csv - Standardized Comma-Separated Value
html - HTML webpage
ssv - Standardized Semicolon-Separated Value
text - Generic textfile
tsv - Standardized Tab-Separated Value
-as, --all-stats Write all statistics to all available formats [DEPRECIATED]
Output all statistical information to all available formats.
[DEPRECIATED]
-csv, --csv Output in Comma-Separated Value format
-csv, --csv Output in Comma-Separated Value format [DEPRECIATED]
Output all statistical information in standardized CSV format.
[DEPRECIATED]
-html, --html Output in HTML format
-html, --html Output in HTML format [DEPRECIATED]
Output all statistical information in standardized HTML format.
[DEPRECIATED]
-tsv, --tsv Output in Tab-Separated Value format
-tsv, --tsv Output in Tab-Separated Value format [DEPRECIATED]
Output all statistical information in standardized TSV format.
[DEPRECIATED]
-txt, --text Output in generic text format
-txt, --text Output in generic text format [DEPRECIATED]
Output all statistical information in generic text format. If no
other format flags are enabled, this is the default output.
[DEPRECIATED]
-f, --filename Set the external name of the DAT
Set the external filename for the output DAT(s)

View File

@@ -558,6 +558,8 @@ namespace SabreTools.Library.Tools
return new Reports.SeparatedValue(null, filename, ',', baddumpCol, nodumpCol);
case StatReportFormat.HTML:
return new Html(null, filename, baddumpCol, nodumpCol);
case StatReportFormat.SSV:
return new Reports.SeparatedValue(null, filename, ';', baddumpCol, nodumpCol);
case StatReportFormat.TSV:
return new Reports.SeparatedValue(null, filename, '\t', baddumpCol, nodumpCol);
}
@@ -918,6 +920,32 @@ namespace SabreTools.Library.Tools
}
}
/// <summary>
/// Get StatReportFormat value from input string
/// </summary>
/// <param name="input">String to get value from</param>
/// <returns>StatReportFormat value corresponding to the string</returns>
public static StatReportFormat GetStatFormat(string input)
{
switch (input?.Trim().ToLowerInvariant())
{
case "all":
return StatReportFormat.All;
case "csv":
return StatReportFormat.CSV;
case "html":
return StatReportFormat.HTML;
case "ssv":
return StatReportFormat.SSV;
case "text":
return StatReportFormat.Textfile;
case "tsv":
return StatReportFormat.TSV;
default:
return 0x0;
}
}
/// <summary>
/// Get a sanitized size from an input string
/// </summary>