mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-23 07:14:57 +00:00
Add bitmasks helper method
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user