mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Clear format and parse
This commit is contained in:
@@ -463,16 +463,19 @@ namespace SabreTools.Features
|
|||||||
// Check the current format
|
// Check the current format
|
||||||
DatFormat currentFormat = datFile.Header.GetFieldValue<DatFormat>(DatHeader.DatFormatKey);
|
DatFormat currentFormat = datFile.Header.GetFieldValue<DatFormat>(DatHeader.DatFormatKey);
|
||||||
#if NET20 || NET35
|
#if NET20 || NET35
|
||||||
bool isSeparatedFile = (currentFormat & DatFormat.CSV) != 0
|
bool isSeparatedFile = (currentFormat & DatFormat.CSV) != 0
|
||||||
|| (currentFormat & DatFormat.SSV) != 0
|
|| (currentFormat & DatFormat.SSV) != 0
|
||||||
|| (currentFormat & DatFormat.TSV) != 0;
|
|| (currentFormat & DatFormat.TSV) != 0;
|
||||||
#else
|
#else
|
||||||
bool isSeparatedFile = currentFormat.HasFlag(DatFormat.CSV)
|
bool isSeparatedFile = currentFormat.HasFlag(DatFormat.CSV)
|
||||||
|| currentFormat.HasFlag(DatFormat.SSV)
|
|| currentFormat.HasFlag(DatFormat.SSV)
|
||||||
|| currentFormat.HasFlag(DatFormat.TSV);
|
|| currentFormat.HasFlag(DatFormat.TSV);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Clear format and parse
|
||||||
|
datFile.Header.RemoveField(DatHeader.DatFormatKey);
|
||||||
Parser.ParseInto(datFile, inputPath.CurrentPath, keep: true, keepext: isSeparatedFile);
|
Parser.ParseInto(datFile, inputPath.CurrentPath, keep: true, keepext: isSeparatedFile);
|
||||||
|
datFile.Header.SetFieldValue<DatFormat>(DatHeader.DatFormatKey, currentFormat);
|
||||||
|
|
||||||
// Perform additional processing steps
|
// Perform additional processing steps
|
||||||
AdditionalProcessing(datFile);
|
AdditionalProcessing(datFile);
|
||||||
|
|||||||
Reference in New Issue
Block a user