mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Make Reports similar to DatFiles with access
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using SabreTools.DatFiles;
|
||||
using SabreTools.IO.Logging;
|
||||
using SabreTools.Reports.Formats;
|
||||
|
||||
namespace SabreTools.Reports
|
||||
{
|
||||
@@ -30,26 +29,6 @@ namespace SabreTools.Reports
|
||||
Statistics = statsList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a specific type of BaseReport to be used based on a format and user inputs
|
||||
/// </summary>
|
||||
/// <param name="statReportFormat">Format of the Statistics Report to be created</param>
|
||||
/// <param name="statsList">List of statistics objects to set</param>
|
||||
/// <returns>BaseReport of the specific internal type that corresponds to the inputs</returns>
|
||||
public static BaseReport? Create(StatReportFormat statReportFormat, List<DatStatistics> statsList)
|
||||
{
|
||||
return statReportFormat switch
|
||||
{
|
||||
StatReportFormat.None => new ConsoleOutput(statsList),
|
||||
StatReportFormat.Textfile => new Textfile(statsList),
|
||||
StatReportFormat.CSV => new CommaSeparatedValue(statsList),
|
||||
StatReportFormat.HTML => new Html(statsList),
|
||||
StatReportFormat.SSV => new SemicolonSeparatedValue(statsList),
|
||||
StatReportFormat.TSV => new TabSeparatedValue(statsList),
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create and open an output file for writing direct from a set of statistics
|
||||
/// </summary>
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace SabreTools.Reports.Formats
|
||||
/// HTML report format
|
||||
/// </summary>
|
||||
/// TODO: Make output standard width, without making the entire thing a table
|
||||
internal class Html : BaseReport
|
||||
public class Html : BaseReport
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a new report from the filename
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace SabreTools.Reports.Formats
|
||||
/// <summary>
|
||||
/// Separated-Value report format
|
||||
/// </summary>
|
||||
internal abstract class SeparatedValue : BaseReport
|
||||
public abstract class SeparatedValue : BaseReport
|
||||
{
|
||||
// Private instance variables specific to Hashfile DATs
|
||||
protected char _delim;
|
||||
@@ -161,7 +161,7 @@ namespace SabreTools.Reports.Formats
|
||||
/// <summary>
|
||||
/// Represents a comma-separated value file
|
||||
/// </summary>
|
||||
internal sealed class CommaSeparatedValue : SeparatedValue
|
||||
public sealed class CommaSeparatedValue : SeparatedValue
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a new report from the filename
|
||||
@@ -176,7 +176,7 @@ namespace SabreTools.Reports.Formats
|
||||
/// <summary>
|
||||
/// Represents a semicolon-separated value file
|
||||
/// </summary>
|
||||
internal sealed class SemicolonSeparatedValue : SeparatedValue
|
||||
public sealed class SemicolonSeparatedValue : SeparatedValue
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a new report from the filename
|
||||
@@ -191,7 +191,7 @@ namespace SabreTools.Reports.Formats
|
||||
/// <summary>
|
||||
/// Represents a tab-separated value file
|
||||
/// </summary>
|
||||
internal sealed class TabSeparatedValue : SeparatedValue
|
||||
public sealed class TabSeparatedValue : SeparatedValue
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a new report from the filename
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace SabreTools.Reports.Formats
|
||||
/// <summary>
|
||||
/// Textfile report format
|
||||
/// </summary>
|
||||
internal class Textfile : BaseReport
|
||||
public class Textfile : BaseReport
|
||||
{
|
||||
protected bool _writeToConsole = false;
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace SabreTools.Reports.Formats
|
||||
/// <summary>
|
||||
/// Console report format
|
||||
/// </summary>
|
||||
internal sealed class ConsoleOutput : Textfile
|
||||
public sealed class ConsoleOutput : Textfile
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a new report from the filename
|
||||
|
||||
Reference in New Issue
Block a user