[DatFile] Add flag for DFD filtering (archive / file)

This commit is contained in:
Matt Nadareski
2017-05-03 14:11:38 -07:00
parent 3a6040b6ba
commit a4dad289a3
6 changed files with 57 additions and 11 deletions

View File

@@ -185,6 +185,16 @@ namespace SabreTools
"Read files from a Romba input",
FeatureType.Flag,
null));
datFromDir.AddFeature("skiparc", new Feature(
new List<string>() { "-ska", "--skiparc" },
"Skip any files that are treated like archives",
FeatureType.Flag,
null));
datFromDir.AddFeature("skipfile", new Feature(
new List<string>() { "-skf", "--skipfile" },
"Skip any files that are not treated like archives",
FeatureType.Flag,
null));
datFromDir.AddFeature("filename", new Feature(
new List<string>() { "-f", "--filename" },
"Set the external name of the DAT",

View File

@@ -45,6 +45,7 @@ namespace SabreTools
/// <param name="removeDateFromAutomaticName">True if the date should be omitted from the DAT, false otherwise</param>
/// <param name="parseArchivesAsFiles">True if archives should be treated as files, false otherwise</param>
/// <param name="enableGzip">True if GZIP archives should be treated as files, false otherwise</param>
/// <param name="skipFileType">Type of files that should be skipped on scan</param>
/// <param name="addBlankFilesForEmptyFolder">True if blank items should be created for empty folders, false otherwise</param>
/// <param name="addFileDates">True if dates should be archived for all files, false otherwise</param>
/// /* Output DAT info */
@@ -75,6 +76,7 @@ namespace SabreTools
bool removeDateFromAutomaticName,
bool parseArchivesAsFiles,
bool enableGzip,
SkipFileType skipFileType,
bool addBlankFilesForEmptyFolder,
bool addFileDates,
@@ -133,7 +135,7 @@ namespace SabreTools
string basePath = Path.GetFullPath(path);
bool success = datdata.PopulateFromDir(basePath, omitFromScan, removeDateFromAutomaticName, parseArchivesAsFiles, enableGzip,
addBlankFilesForEmptyFolder, addFileDates, tempDir, copyFiles, headerToCheckAgainst);
skipFileType, addBlankFilesForEmptyFolder, addFileDates, tempDir, copyFiles, headerToCheckAgainst);
// If it was a success, write the DAT out
if (success)

View File

@@ -126,6 +126,7 @@ namespace SabreTools
Hash omitFromScan = Hash.SHA256 | Hash.SHA384 | Hash.SHA512; // Should be set to 0x0 later
Hash stripHash = 0x0;
OutputFormat outputFormat = OutputFormat.Folder;
SkipFileType skipFileType = SkipFileType.None;
SplitType splitType = SplitType.None;
StatDatFormat statDatFormat = 0x0;
@@ -562,6 +563,14 @@ namespace SabreTools
case "--single":
single = true;
break;
case "-ska":
case "--skiparc":
skipFileType = SkipFileType.Archive;
break;
case "-skf":
case "--skipfile":
skipFileType = SkipFileType.File;
break;
case "-t7z":
case "--t7z":
outputFormat = OutputFormat.Torrent7Zip;
@@ -1209,7 +1218,7 @@ namespace SabreTools
{
InitDatFromDir(inputs, filename, name, description, category, version, author, email, homepage, url, comment,
forcepack, excludeOf, datFormat, romba, superdat, omitFromScan, removeDateFromAutomaticName, parseArchivesAsFiles,
enableGzip, addBlankFilesForEmptyFolder, addFileDates, tempDir, outDir, copyFiles, header);
enableGzip, skipFileType, addBlankFilesForEmptyFolder, addFileDates, tempDir, outDir, copyFiles, header);
}
// If we're in header extract and remove mode