mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add SMDB size field support
This commit is contained in:
@@ -12,8 +12,8 @@ namespace SabreTools.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current toolset version to be used by all child applications
|
/// The current toolset version to be used by all child applications
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly static string Version = $"v1.1.1";
|
//public readonly static string Version = $"v1.1.1";
|
||||||
//public readonly static string Version = $"v1.1.1-{File.GetCreationTime(Assembly.GetExecutingAssembly().Location):yyyy-MM-dd HH:mm:ss}";
|
public readonly static string Version = $"v1.1.1-{File.GetCreationTime(Assembly.GetExecutingAssembly().Location):yyyy-MM-dd HH:mm:ss}";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Readies the console and outputs the header
|
/// Readies the console and outputs the header
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.IO;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Core.Tools;
|
||||||
using SabreTools.DatItems;
|
using SabreTools.DatItems;
|
||||||
using SabreTools.DatItems.Formats;
|
using SabreTools.DatItems.Formats;
|
||||||
using SabreTools.IO;
|
using SabreTools.IO;
|
||||||
@@ -58,6 +59,7 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
2 - SHA-1
|
2 - SHA-1
|
||||||
3 - MD5
|
3 - MD5
|
||||||
4 - CRC32
|
4 - CRC32
|
||||||
|
5 - Size (Optional)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
string[] fullname = svr.Line[1].Split('/');
|
string[] fullname = svr.Line[1].Split('/');
|
||||||
@@ -85,6 +87,10 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Size in SMDB files is optional
|
||||||
|
if (svr.Line.Count > 5)
|
||||||
|
rom.Size = Utilities.CleanLong(svr.Line[5]);
|
||||||
|
|
||||||
// Now process and add the rom
|
// Now process and add the rom
|
||||||
ParseAddHelper(rom, statsOnly);
|
ParseAddHelper(rom, statsOnly);
|
||||||
}
|
}
|
||||||
@@ -185,12 +191,12 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
|
|
||||||
string[] fields = new string[]
|
string[] fields = new string[]
|
||||||
{
|
{
|
||||||
rom.SHA256 ?? string.Empty,
|
rom.SHA256 ?? string.Empty,
|
||||||
$"{rom.Machine.Name ?? string.Empty}/",
|
$"{rom.Machine.Name ?? string.Empty}/{rom.Name ?? string.Empty}",
|
||||||
rom.Name ?? string.Empty,
|
rom.SHA1 ?? string.Empty,
|
||||||
rom.SHA1 ?? string.Empty,
|
rom.MD5 ?? string.Empty,
|
||||||
rom.MD5 ?? string.Empty,
|
rom.CRC ?? string.Empty,
|
||||||
rom.CRC ?? string.Empty,
|
rom.Size.ToString() ?? string.Empty,
|
||||||
};
|
};
|
||||||
|
|
||||||
svw.WriteValues(fields);
|
svw.WriteValues(fields);
|
||||||
|
|||||||
Reference in New Issue
Block a user