[SimpleSort] Rename inits

This commit is contained in:
Matt Nadareski
2016-09-12 22:02:55 -07:00
parent 4d36d8ec59
commit 5a4e463179
2 changed files with 40 additions and 3 deletions

View File

@@ -45,6 +45,43 @@ namespace SabreTools
} }
} }
/// <summary>
/// Wrap sorting files using an input DAT
/// </summary>
/// <param name="inputs">List of all inputted files and folders</param>
/// <param name="outdir">Output directory (empty for default directory)</param>
/// <param name="tempdir">Temporary directory for archive extraction</param>
/// <param name="delete">True if input files should be deleted, false otherwise</param>
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
/// <param name="sevenzip">Integer representing the archive handling level for 7z</param>
/// <param name="gz">Integer representing the archive handling level for GZip</param>
/// <param name="rar">Integer representing the archive handling level for RAR</param>
/// <param name="zip">Integer representing the archive handling level for Zip</param>
/// <param name="logger">Logger object for file and console output</param>
public static bool InitConvertFolderTGZ(List<string> inputs, string outdir, string tempdir, bool delete,
bool romba, int sevenzip, int gz, int rar, int zip, Logger logger)
{
// Get all individual files from the inputs
List<string> newinputs = new List<string>();
foreach (string input in inputs)
{
if (File.Exists(input))
{
newinputs.Add(Path.GetFullPath(input));
}
else if (Directory.Exists(input))
{
foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories))
{
newinputs.Add(Path.GetFullPath(file));
}
}
}
SimpleSort ss = new SimpleSort(new Dat(), newinputs, outdir, tempdir, false, false, false, delete, true, romba, sevenzip, gz, rar, zip, false, logger);
return ss.Convert();
}
/// <summary> /// <summary>
/// Wrap creating a DAT file from files or a directory /// Wrap creating a DAT file from files or a directory
/// </summary> /// </summary>
@@ -404,7 +441,7 @@ namespace SabreTools
/// <param name="zip">Integer representing the archive handling level for Zip</param> /// <param name="zip">Integer representing the archive handling level for Zip</param>
/// <param name="updateDat">True if the updated DAT should be output, false otherwise</param> /// <param name="updateDat">True if the updated DAT should be 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>
private static void InitSimpleSort(List<string> datfiles, List<string> inputs, string outdir, string tempdir, bool quickScan, private static void InitSortVerify(List<string> datfiles, List<string> inputs, string outdir, string tempdir, bool quickScan,
bool toFolder, bool verify, bool delete, bool tgz, bool romba, int sevenzip, int gz, int rar, int zip, bool updateDat, Logger logger) bool toFolder, bool verify, bool delete, bool tgz, bool romba, int sevenzip, int gz, int rar, int zip, bool updateDat, Logger logger)
{ {
// Add all of the input DATs into one huge internal DAT // Add all of the input DATs into one huge internal DAT

View File

@@ -193,7 +193,7 @@ namespace SabreTools
// If we are converting the folder to TGZ // If we are converting the folder to TGZ
if (convert) if (convert)
{ {
InitConvert(inputs, outdir, tempdir, delete, romba, sevenzip, gz, rar, zip, logger); InitConvertFolderTGZ(inputs, outdir, tempdir, delete, romba, sevenzip, gz, rar, zip, logger);
} }
// If we are doing a simple sort // If we are doing a simple sort
@@ -270,7 +270,7 @@ namespace SabreTools
/// <param name="rar">Integer representing the archive handling level for RAR</param> /// <param name="rar">Integer representing the archive handling level for RAR</param>
/// <param name="zip">Integer representing the archive handling level for Zip</param> /// <param name="zip">Integer representing the archive handling level for Zip</param>
/// <param name="logger">Logger object for file and console output</param> /// <param name="logger">Logger object for file and console output</param>
public static bool InitConvert(List<string> inputs, string outdir, string tempdir, bool delete, public static bool InitConvertFolderTGZ(List<string> inputs, string outdir, string tempdir, bool delete,
bool romba, int sevenzip, int gz, int rar, int zip, Logger logger) bool romba, int sevenzip, int gz, int rar, int zip, Logger logger)
{ {
// Get all individual files from the inputs // Get all individual files from the inputs