mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add nullability to the two programs (not enforced)
This commit is contained in:
@@ -20,7 +20,7 @@ namespace RombaSharp.Features
|
||||
Description = "Creates a DAT file for the specified input directory and saves it to the -out filename.";
|
||||
_featureType = ParameterType.Flag;
|
||||
LongDescription = "Creates a DAT file for the specified input directory and saves it to the -out filename.";
|
||||
Features = new Dictionary<string, Feature>();
|
||||
Features = [];
|
||||
|
||||
// Common Features
|
||||
AddCommonFeatures();
|
||||
@@ -31,20 +31,20 @@ namespace RombaSharp.Features
|
||||
AddFeature(DescriptionStringInput);
|
||||
}
|
||||
|
||||
public override bool ProcessFeatures(Dictionary<string, Feature> features)
|
||||
public override bool ProcessFeatures(Dictionary<string, Feature?> features)
|
||||
{
|
||||
// If the base fails, just fail out
|
||||
if (!base.ProcessFeatures(features))
|
||||
return false;
|
||||
|
||||
// Get feature flags
|
||||
string name = GetString(features, NameStringValue);
|
||||
string description = GetString(features, DescriptionStringValue);
|
||||
string source = GetString(features, SourceStringValue);
|
||||
string outdat = GetString(features, OutStringValue);
|
||||
string? name = GetString(features, NameStringValue);
|
||||
string? description = GetString(features, DescriptionStringValue);
|
||||
string? source = GetString(features, SourceStringValue);
|
||||
string? outdat = GetString(features, OutStringValue);
|
||||
|
||||
// Ensure the output directory
|
||||
outdat.Ensure(create: true);
|
||||
outdat = outdat?.Ensure(create: true);
|
||||
|
||||
// Check that all required directories exist
|
||||
if (!Directory.Exists(source))
|
||||
@@ -58,7 +58,7 @@ namespace RombaSharp.Features
|
||||
datfile.Header.Name = string.IsNullOrWhiteSpace(name) ? "untitled" : name;
|
||||
datfile.Header.Description = description;
|
||||
DatFromDir.PopulateFromDir(datfile, source, asFiles: TreatAsFile.NonArchive, hashes: [HashType.CRC32, HashType.MD5, HashType.SHA1]);
|
||||
Writer.Write(datfile, outdat);
|
||||
Writer.Write(datfile, outdat!);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user