Files
SabreTools/RombaSharp/Features/DatStats.cs

47 lines
1.3 KiB
C#
Raw Normal View History

2020-08-01 13:25:32 -07:00
using System.Collections.Generic;
using System.IO;
2020-12-10 23:24:09 -08:00
using SabreTools.DatTools;
2020-12-07 13:57:26 -08:00
using SabreTools.Help;
using SabreTools.Reports;
2020-08-01 13:25:32 -07:00
namespace RombaSharp.Features
{
internal class DatStats : BaseFeature
{
public const string Value = "DatStats";
public DatStats()
{
Name = Value;
Flags = new List<string>() { "datstats" };
Description = "Prints dat stats.";
2020-12-07 13:57:26 -08:00
_featureType = ParameterType.Flag;
2020-08-01 13:25:32 -07:00
LongDescription = "Print dat stats.";
Features = new Dictionary<string, Feature>();
2021-02-03 11:10:19 -08:00
// Common Features
AddCommonFeatures();
2020-08-01 13:25:32 -07:00
}
public override void ProcessFeatures(Dictionary<string, Feature> features)
{
base.ProcessFeatures(features);
// 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);
2020-08-01 13:25:32 -07:00
}
}
}