mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add support for old CMP dats (partial library-only)
This commit is contained in:
@@ -42,6 +42,17 @@ namespace SabreTools.Library.IO
|
||||
/// </summary>
|
||||
public bool DosCenter { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Get if quotes should surround attribute values
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If this is disabled, then a special bit of code will be
|
||||
/// invoked to deal with unquoted, multi-part names. This can
|
||||
/// backfire in a lot of circumstances, so don't disable this
|
||||
/// unless you know what you're doing
|
||||
/// </remarks>
|
||||
public bool Quotes { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Current row type
|
||||
/// </summary>
|
||||
@@ -166,6 +177,22 @@ namespace SabreTools.Library.IO
|
||||
value = linegc[++i].Replace("\"", string.Empty);
|
||||
}
|
||||
}
|
||||
// Special case for assumed unquoted values (only affects `name`)
|
||||
else if (!Quotes && key == "name")
|
||||
{
|
||||
while (++i < linegc.Length
|
||||
&& linegc[i] != "merge"
|
||||
&& linegc[i] != "size"
|
||||
&& linegc[i] != "crc"
|
||||
&& linegc[i] != "md5"
|
||||
&& linegc[i] != "sha1")
|
||||
{
|
||||
value += $" {linegc[i]}";
|
||||
}
|
||||
|
||||
value = value.Trim();
|
||||
i--;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Special cases for standalone statuses
|
||||
|
||||
Reference in New Issue
Block a user