mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Convert DAT type to a key
This commit is contained in:
@@ -2198,11 +2198,11 @@ Some special strings that can be used:
|
||||
}
|
||||
else if (dftemp == DatFormat.Logiqx && deprecated)
|
||||
{
|
||||
datHeader.DatFormat |= DatFormat.LogiqxDeprecated;
|
||||
datHeader.SetFieldValue<DatFormat>(DatHeader.DatFormatKey, datHeader.GetFieldValue<DatFormat>(DatHeader.DatFormatKey) | DatFormat.LogiqxDeprecated);
|
||||
}
|
||||
else
|
||||
{
|
||||
datHeader.DatFormat |= dftemp;
|
||||
datHeader.SetFieldValue<DatFormat>(DatHeader.DatFormatKey, datHeader.GetFieldValue<DatFormat>(DatHeader.DatFormatKey) | dftemp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -480,10 +480,10 @@ Reset the internal state: reset();";
|
||||
public override void Process(BatchState batchState)
|
||||
{
|
||||
// Assume there could be multiple
|
||||
batchState.DatFile.Header.DatFormat = 0x00;
|
||||
batchState.DatFile.Header.SetFieldValue<DatFormat>(DatHeader.DatFormatKey, 0x00);
|
||||
foreach (string format in Arguments)
|
||||
{
|
||||
batchState.DatFile.Header.DatFormat |= GetDatFormat(format);
|
||||
batchState.DatFile.Header.SetFieldValue<DatFormat>(DatHeader.DatFormatKey, batchState.DatFile.Header.GetFieldValue<DatFormat>(DatHeader.DatFormatKey) | GetDatFormat(format));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -804,7 +804,7 @@ Reset the internal state: reset();";
|
||||
|
||||
// Read in the individual arguments
|
||||
(string? type, string? key) = FilterParser.ParseFilterId(Arguments[0]);
|
||||
|
||||
|
||||
// If we had an invalid input, log and continue
|
||||
if ((type == null || !string.Equals(type, Models.Metadata.MetadataFile.HeaderKey, StringComparison.OrdinalIgnoreCase)) && key == null)
|
||||
{
|
||||
|
||||
@@ -167,9 +167,9 @@ namespace SabreTools.Features
|
||||
DatFile datFile = DatFile.Create(Header);
|
||||
logger.User($"Processing '{Path.GetFileName(inputPath.CurrentPath)}'");
|
||||
Parser.ParseInto(datFile, inputPath, keep: true,
|
||||
keepext: datFile.Header.DatFormat.HasFlag(DatFormat.TSV)
|
||||
|| datFile.Header.DatFormat.HasFlag(DatFormat.CSV)
|
||||
|| datFile.Header.DatFormat.HasFlag(DatFormat.SSV));
|
||||
keepext: datFile.Header.GetFieldValue<DatFormat>(DatHeader.DatFormatKey).HasFlag(DatFormat.TSV)
|
||||
|| datFile.Header.GetFieldValue<DatFormat>(DatHeader.DatFormatKey).HasFlag(DatFormat.CSV)
|
||||
|| datFile.Header.GetFieldValue<DatFormat>(DatHeader.DatFormatKey).HasFlag(DatFormat.SSV));
|
||||
|
||||
// Perform additional processing steps
|
||||
Extras!.ApplyExtras(datFile);
|
||||
|
||||
Reference in New Issue
Block a user