[Enums, Structs] Add proper header skip parts

This commit is contained in:
Matt Nadareski
2016-06-16 19:36:05 -07:00
parent e07258a970
commit 31c5292c8e
2 changed files with 58 additions and 0 deletions

View File

@@ -111,4 +111,37 @@
Internal,
External,
}
/// <summary>
/// Determines the header skip operation
/// </summary>
public enum HeaderSkipOperation
{
None = 0,
Bitswap,
Byteswap,
Wordswap,
}
/// <summary>
/// Determines the type of test to be done
/// </summary>
public enum HeaderSkipTest
{
Data = 0,
Or,
Xor,
And,
File,
}
/// <summary>
/// Determines the operator to be used in a file test
/// </summary>
public enum HeaderSkipTestFileOperator
{
Equal = 0,
Less,
Greater,
}
}

View File

@@ -149,4 +149,29 @@ namespace SabreTools.Helper
};
}
}
/// <summary>
/// Intermediate struct for holding header skipper rule information
/// </summary>
public struct SkipperRule
{
long? StartOffset; // null is EOF
long? EndOffset; // null if EOF
HeaderSkipOperation Operation;
List<SkipperTest> Tests;
}
/// <summary>
/// Intermediate struct for holding header test information
/// </summary>
public struct SkipperTest
{
HeaderSkipTest Type;
long? Offset; // null is EOF
byte[] Value;
bool Result;
byte[] Mask;
long? Size; // null is PO2, "power of 2" filesize
HeaderSkipTestFileOperator Operator;
}
}