mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using SabreTools.DatTools;
|
|
using SabreTools.Help;
|
|
using SabreTools.Reports;
|
|
|
|
namespace RombaSharp.Features
|
|
{
|
|
internal class DatStats : BaseFeature
|
|
{
|
|
public const string Value = "DatStats";
|
|
|
|
public DatStats()
|
|
{
|
|
Name = Value;
|
|
Flags = ["datstats"];
|
|
Description = "Prints dat stats.";
|
|
_featureType = ParameterType.Flag;
|
|
LongDescription = "Print dat stats.";
|
|
Features = [];
|
|
|
|
// Common Features
|
|
AddCommonFeatures();
|
|
}
|
|
|
|
public override bool ProcessFeatures(Dictionary<string, Feature?> features)
|
|
{
|
|
// If the base fails, just fail out
|
|
if (!base.ProcessFeatures(features))
|
|
return false;
|
|
|
|
// If we have no inputs listed, we want to use datroot
|
|
if (Inputs == null || Inputs.Count == 0)
|
|
Inputs = new List<string> { Path.GetFullPath(_dats!) };
|
|
|
|
// Now output the stats for all inputs
|
|
var statistics = Statistics.CalculateStatistics(Inputs, single: true);
|
|
Statistics.Write(
|
|
statistics,
|
|
"rombasharp-datstats",
|
|
outDir: null,
|
|
baddumpCol: true,
|
|
nodumpCol: true,
|
|
StatReportFormat.Textfile);
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|