mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[RombaSharp] Add skeletons for more functionality
This commit is contained in:
@@ -102,6 +102,13 @@ namespace RombaSharp
|
|||||||
FeatureType.Flag,
|
FeatureType.Flag,
|
||||||
null);
|
null);
|
||||||
|
|
||||||
|
// Create the Import feature
|
||||||
|
Feature import = new Feature(
|
||||||
|
"import",
|
||||||
|
"Import a database from a formatted CSV file",
|
||||||
|
FeatureType.Flag,
|
||||||
|
null);
|
||||||
|
|
||||||
// Create the Lookup feature
|
// Create the Lookup feature
|
||||||
Feature lookup = new Feature(
|
Feature lookup = new Feature(
|
||||||
"lookup",
|
"lookup",
|
||||||
@@ -146,6 +153,11 @@ namespace RombaSharp
|
|||||||
"Moves DAT index entries for orphaned DATs",
|
"Moves DAT index entries for orphaned DATs",
|
||||||
FeatureType.Flag,
|
FeatureType.Flag,
|
||||||
null);
|
null);
|
||||||
|
purgeBackup.AddFeature("log-only", new Feature(
|
||||||
|
"-log-only",
|
||||||
|
"Only write out actions to log",
|
||||||
|
FeatureType.Flag,
|
||||||
|
null));
|
||||||
|
|
||||||
// Create the Purge Delete feature
|
// Create the Purge Delete feature
|
||||||
Feature purgeDelete = new Feature(
|
Feature purgeDelete = new Feature(
|
||||||
@@ -153,6 +165,11 @@ namespace RombaSharp
|
|||||||
"Deletes DAT index entries for orphaned DATs",
|
"Deletes DAT index entries for orphaned DATs",
|
||||||
FeatureType.Flag,
|
FeatureType.Flag,
|
||||||
null);
|
null);
|
||||||
|
purgeDelete.AddFeature("log-only", new Feature(
|
||||||
|
"-log-only",
|
||||||
|
"Only write out actions to log",
|
||||||
|
FeatureType.Flag,
|
||||||
|
null));
|
||||||
|
|
||||||
// Create the Refresh DATs feature
|
// Create the Refresh DATs feature
|
||||||
Feature refreshDats = new Feature(
|
Feature refreshDats = new Feature(
|
||||||
@@ -185,6 +202,7 @@ namespace RombaSharp
|
|||||||
help.Add("Dir2Dat", dir2dat);
|
help.Add("Dir2Dat", dir2dat);
|
||||||
help.Add("Export", export);
|
help.Add("Export", export);
|
||||||
help.Add("Fixdat", fixdat);
|
help.Add("Fixdat", fixdat);
|
||||||
|
help.Add("Import", import);
|
||||||
help.Add("Lookup", lookup);
|
help.Add("Lookup", lookup);
|
||||||
help.Add("Memstats", memstats);
|
help.Add("Memstats", memstats);
|
||||||
help.Add("Merge", merge);
|
help.Add("Merge", merge);
|
||||||
|
|||||||
@@ -356,7 +356,8 @@ namespace RombaSharp
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moves DAT index entries for orphaned DATs to backup folder
|
/// Moves DAT index entries for orphaned DATs to backup folder
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void PurgeBackup()
|
/// <param name="logOnly">Only write out actions to log</param>
|
||||||
|
private static void PurgeBackup(bool logOnly)
|
||||||
{
|
{
|
||||||
_logger.User("This feature is not yet implemented: purge-backup");
|
_logger.User("This feature is not yet implemented: purge-backup");
|
||||||
}
|
}
|
||||||
@@ -364,7 +365,8 @@ namespace RombaSharp
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deletes DAT index entries for orphaned DATs
|
/// Deletes DAT index entries for orphaned DATs
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void PurgeDelete()
|
/// <param name="logOnly">Only write out actions to log</param>
|
||||||
|
private static void PurgeDelete(bool logOnly)
|
||||||
{
|
{
|
||||||
_logger.User("This feature is not yet implemented: purge-delete");
|
_logger.User("This feature is not yet implemented: purge-delete");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,6 +275,15 @@ namespace RombaSharp
|
|||||||
// NOTE: This might share code with InitMiss
|
// NOTE: This might share code with InitMiss
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wrap importing CSVs into the database
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inputs"></param>
|
||||||
|
private static void InitImport(List<string> inputs)
|
||||||
|
{
|
||||||
|
_logger.User("This feature is not yet implemented: import");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Wrap looking up if hashes exist in the database
|
/// Wrap looking up if hashes exist in the database
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ namespace RombaSharp
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Entry class for the RombaSharp application
|
/// Entry class for the RombaSharp application
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// In the database, we want to enable "offline mode". That is, when a user does an operation
|
||||||
|
/// that needs to read from the depot themselves, if the depot folder cannot be found, the
|
||||||
|
/// user is prompted to reconnect the depot OR skip that depot entirely.
|
||||||
|
/// </remarks>
|
||||||
public partial class RombaSharp
|
public partial class RombaSharp
|
||||||
{
|
{
|
||||||
// General settings
|
// General settings
|
||||||
@@ -84,6 +89,7 @@ namespace RombaSharp
|
|||||||
dir2dat = false,
|
dir2dat = false,
|
||||||
export = false,
|
export = false,
|
||||||
fixdat = false,
|
fixdat = false,
|
||||||
|
import = false,
|
||||||
lookup = false,
|
lookup = false,
|
||||||
memstats = false,
|
memstats = false,
|
||||||
merge = false,
|
merge = false,
|
||||||
@@ -96,6 +102,7 @@ namespace RombaSharp
|
|||||||
|
|
||||||
// User flags
|
// User flags
|
||||||
bool copy = false,
|
bool copy = false,
|
||||||
|
logOnly = false,
|
||||||
onlyNeeded = false;
|
onlyNeeded = false;
|
||||||
|
|
||||||
// User inputs
|
// User inputs
|
||||||
@@ -146,6 +153,9 @@ namespace RombaSharp
|
|||||||
case "fixdat":
|
case "fixdat":
|
||||||
fixdat = true;
|
fixdat = true;
|
||||||
break;
|
break;
|
||||||
|
case "import":
|
||||||
|
import = true;
|
||||||
|
break;
|
||||||
case "lookup":
|
case "lookup":
|
||||||
lookup = true;
|
lookup = true;
|
||||||
break;
|
break;
|
||||||
@@ -176,8 +186,13 @@ namespace RombaSharp
|
|||||||
|
|
||||||
// User flags
|
// User flags
|
||||||
case "-copy":
|
case "-copy":
|
||||||
|
case "--copy":
|
||||||
copy = true;
|
copy = true;
|
||||||
break;
|
break;
|
||||||
|
case "-log-only":
|
||||||
|
case "--log-only":
|
||||||
|
logOnly = true;
|
||||||
|
break;
|
||||||
case "-only-needed":
|
case "-only-needed":
|
||||||
case "--only-needed":
|
case "--only-needed":
|
||||||
onlyNeeded = true;
|
onlyNeeded = true;
|
||||||
@@ -240,7 +255,7 @@ namespace RombaSharp
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If more than one switch is enabled, show the help screen
|
// If more than one switch is enabled, show the help screen
|
||||||
if (!(archive ^ build ^ dbstats ^ depotRescan ^ diffdat ^ dir2dat ^ export ^ fixdat ^ lookup ^
|
if (!(archive ^ build ^ dbstats ^ depotRescan ^ diffdat ^ dir2dat ^ export ^ fixdat ^ import ^ lookup ^
|
||||||
memstats ^ merge ^ miss ^ progress ^ purgeBackup ^ purgeDelete ^ refreshDats ^ shutdown))
|
memstats ^ merge ^ miss ^ progress ^ purgeBackup ^ purgeDelete ^ refreshDats ^ shutdown))
|
||||||
{
|
{
|
||||||
_logger.Error("Only one feature switch is allowed at a time");
|
_logger.Error("Only one feature switch is allowed at a time");
|
||||||
@@ -250,7 +265,8 @@ namespace RombaSharp
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 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 && (archive || build || depotRescan || dir2dat || fixdat || lookup || merge || miss))
|
if (inputs.Count == 0 && (archive || build || depotRescan || dir2dat || fixdat ||
|
||||||
|
import || lookup || merge || miss))
|
||||||
{
|
{
|
||||||
_logger.Error("This feature requires at least one input");
|
_logger.Error("This feature requires at least one input");
|
||||||
_help.OutputGenericHelp();
|
_help.OutputGenericHelp();
|
||||||
@@ -311,6 +327,12 @@ namespace RombaSharp
|
|||||||
InitFixdat(inputs);
|
InitFixdat(inputs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Import a CSV into the database
|
||||||
|
else if (import)
|
||||||
|
{
|
||||||
|
InitImport(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
// For each specified hash it looks up any available information
|
// For each specified hash it looks up any available information
|
||||||
else if (lookup)
|
else if (lookup)
|
||||||
{
|
{
|
||||||
@@ -344,13 +366,13 @@ namespace RombaSharp
|
|||||||
// Moves DAT index entries for orphaned DATs
|
// Moves DAT index entries for orphaned DATs
|
||||||
else if (purgeBackup)
|
else if (purgeBackup)
|
||||||
{
|
{
|
||||||
PurgeBackup();
|
PurgeBackup(logOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deletes DAT index entries for orphaned DATs
|
// Deletes DAT index entries for orphaned DATs
|
||||||
else if (purgeDelete)
|
else if (purgeDelete)
|
||||||
{
|
{
|
||||||
PurgeDelete();
|
PurgeDelete(logOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refreshes the DAT index from the files in the DAT master directory tree
|
// Refreshes the DAT index from the files in the DAT master directory tree
|
||||||
|
|||||||
Reference in New Issue
Block a user