Add bitmasks helper method

This commit is contained in:
Matt Nadareski
2024-11-13 21:29:43 -05:00
parent db5fe4a2cd
commit a0177f1174

View File

@@ -248,6 +248,23 @@ namespace SabreTools.Serialization.Wrappers
#region Data
/// <summary>
/// Get the bit masks for a partition
/// </summary>
public BitMasks GetBitMasks(int partitionIndex)
{
if (Model.Partitions == null)
return 0;
if (partitionIndex < 0 || partitionIndex >= Model.Partitions.Length)
return 0;
var partition = Model.Partitions[partitionIndex];
if (partition?.Flags == null)
return 0;
return partition.Flags.BitMasks;
}
/// <summary>
/// Determines if a file header represents a CODE block
/// </summary>