mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fully integrate stats into DATabase
This commit is contained in:
@@ -78,6 +78,8 @@ namespace SabreTools
|
|||||||
quotes = false,
|
quotes = false,
|
||||||
rem = false,
|
rem = false,
|
||||||
romba = false,
|
romba = false,
|
||||||
|
single = false,
|
||||||
|
stats = false,
|
||||||
superdat = false,
|
superdat = false,
|
||||||
trim = false,
|
trim = false,
|
||||||
skip = false,
|
skip = false,
|
||||||
@@ -223,6 +225,14 @@ namespace SabreTools
|
|||||||
case "--superdat":
|
case "--superdat":
|
||||||
superdat = true;
|
superdat = true;
|
||||||
break;
|
break;
|
||||||
|
case "-si":
|
||||||
|
case "--single":
|
||||||
|
single = true;
|
||||||
|
break;
|
||||||
|
case "-st":
|
||||||
|
case "--stats":
|
||||||
|
stats = true;
|
||||||
|
break;
|
||||||
case "--skip":
|
case "--skip":
|
||||||
skip = true;
|
skip = true;
|
||||||
break;
|
break;
|
||||||
@@ -331,7 +341,7 @@ namespace SabreTools
|
|||||||
|
|
||||||
// If more than one switch is enabled or help is set, show the help screen
|
// If more than one switch is enabled or help is set, show the help screen
|
||||||
if (help || !(add ^ (convertMiss || romba) ^ convertCMP ^ convertRC ^ convertSD ^ convertXml ^ extsplit ^ generate ^
|
if (help || !(add ^ (convertMiss || romba) ^ convertCMP ^ convertRC ^ convertSD ^ convertXml ^ extsplit ^ generate ^
|
||||||
genall ^ hashsplit ^ import ^ listsrc ^ listsys ^ (merge || diff) ^ rem ^ trim))
|
genall ^ hashsplit ^ import ^ listsrc ^ listsys ^ (merge || diff) ^ rem ^ stats ^ trim))
|
||||||
{
|
{
|
||||||
Build.Help();
|
Build.Help();
|
||||||
logger.Close();
|
logger.Close();
|
||||||
@@ -340,7 +350,7 @@ namespace SabreTools
|
|||||||
|
|
||||||
// If a switch that requires a filename is set and no file is, show the help screen
|
// If a switch that requires a filename is set and no file is, show the help screen
|
||||||
if (inputs.Count == 0 && ((convertMiss || romba) || convertCMP || convertRC || convertSD
|
if (inputs.Count == 0 && ((convertMiss || romba) || convertCMP || convertRC || convertSD
|
||||||
|| convertXml || extsplit || hashsplit || import || (merge || diff) || trim))
|
|| convertXml || extsplit || hashsplit || import || (merge || diff) || stats || trim))
|
||||||
{
|
{
|
||||||
Build.Help();
|
Build.Help();
|
||||||
logger.Close();
|
logger.Close();
|
||||||
@@ -491,6 +501,12 @@ namespace SabreTools
|
|||||||
InitHashSplit(inputs, outdir);
|
InitHashSplit(inputs, outdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get statistics on input files
|
||||||
|
else if (stats)
|
||||||
|
{
|
||||||
|
InitStats(inputs, single);
|
||||||
|
}
|
||||||
|
|
||||||
logger.Close();
|
logger.Close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1729,7 +1745,7 @@ Make a selection:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Stats stats = new Stats(inputs, single, logger);
|
Stats stats = new Stats(newinputs, single, logger);
|
||||||
stats.Process();
|
stats.Process();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
using SabreTools.Helper;
|
using SabreTools.Helper;
|
||||||
|
|
||||||
@@ -10,7 +9,7 @@ namespace SabreTools
|
|||||||
/// Get statistics on one or more DAT files
|
/// Get statistics on one or more DAT files
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Finish making this a proper object then port to DATabase (-st, --stats)</remarks>
|
/// <remarks>Finish making this a proper object then port to DATabase (-st, --stats)</remarks>
|
||||||
public class UncompressedSize
|
public class Stats
|
||||||
{
|
{
|
||||||
// Private instance variables
|
// Private instance variables
|
||||||
private List<String> _inputs;
|
private List<String> _inputs;
|
||||||
@@ -23,7 +22,7 @@ namespace SabreTools
|
|||||||
/// <param name="inputs">List of files and folders to parse</param>
|
/// <param name="inputs">List of files and folders to parse</param>
|
||||||
/// <param name="single">True if single DAT stats are output, false otherwise</param>
|
/// <param name="single">True if single DAT stats are output, false otherwise</param>
|
||||||
/// <param name="logger">Logger object for file and console output</param>
|
/// <param name="logger">Logger object for file and console output</param>
|
||||||
public UncompressedSize(List<String> inputs, bool single, Logger logger)
|
public Stats(List<String> inputs, bool single, Logger logger)
|
||||||
{
|
{
|
||||||
_inputs = inputs;
|
_inputs = inputs;
|
||||||
_single = single;
|
_single = single;
|
||||||
@@ -115,6 +114,10 @@ namespace SabreTools
|
|||||||
Roms with Nodump status: " + singleNodump + @"
|
Roms with Nodump status: " + singleNodump + @"
|
||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.User("Adding stats for file '" + filename + "'");
|
||||||
|
}
|
||||||
|
|
||||||
// Add single DAT stats to totals
|
// Add single DAT stats to totals
|
||||||
totalSize += singleSize;
|
totalSize += singleSize;
|
||||||
|
|||||||
@@ -132,6 +132,8 @@ Options:
|
|||||||
-rm, --remove Remove a system or source from the database
|
-rm, --remove Remove a system or source from the database
|
||||||
-system= System ID
|
-system= System ID
|
||||||
-source= Source ID
|
-source= Source ID
|
||||||
|
-st, --stats Get statistics on all input DATs
|
||||||
|
-si, --single Show individual statistics
|
||||||
-tm, --trim-merge Consolidate DAT into a single game and trim entries
|
-tm, --trim-merge Consolidate DAT into a single game and trim entries
|
||||||
-rd=, --root-dir= Set the root directory for trimming calculation
|
-rd=, --root-dir= Set the root directory for trimming calculation
|
||||||
-nr, --no-rename Keep game names instead of using '!'
|
-nr, --no-rename Keep game names instead of using '!'
|
||||||
|
|||||||
Reference in New Issue
Block a user