mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[Skippers/] Much needed whitespace and doc cleanup
This commit is contained in:
@@ -23,11 +23,30 @@ namespace SabreTools.Library.Skippers
|
||||
{
|
||||
#region Fields
|
||||
|
||||
public string Name;
|
||||
public string Author;
|
||||
public string Version;
|
||||
public List<SkipperRule> Rules;
|
||||
public string SourceFile;
|
||||
/// <summary>
|
||||
/// Skipper name
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Author names
|
||||
/// </summary>
|
||||
public string Author { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File version
|
||||
/// </summary>
|
||||
public string Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set of all rules in the skipper
|
||||
/// </summary>
|
||||
public List<SkipperRule> Rules { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filename the skipper lives in
|
||||
/// </summary>
|
||||
public string SourceFile { get; set; }
|
||||
|
||||
// Local paths
|
||||
public static string LocalPath = Path.Combine(Globals.ExeDir, "Skippers") + Path.DirectorySeparatorChar;
|
||||
|
||||
@@ -19,12 +19,34 @@ namespace SabreTools.Library.Skippers
|
||||
{
|
||||
public class SkipperRule
|
||||
{
|
||||
// Public variables
|
||||
public long? StartOffset; // null is EOF
|
||||
public long? EndOffset; // null if EOF
|
||||
public HeaderSkipOperation Operation;
|
||||
public List<SkipperTest> Tests;
|
||||
public string SourceFile;
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// Starting offset for applying rule
|
||||
/// </summary>
|
||||
public long? StartOffset { get; set; } // null is EOF
|
||||
|
||||
/// <summary>
|
||||
/// Ending offset for applying rule
|
||||
/// </summary>
|
||||
public long? EndOffset { get; set; } // null if EOF
|
||||
|
||||
/// <summary>
|
||||
/// Byte manipulation operation
|
||||
/// </summary>
|
||||
public HeaderSkipOperation Operation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of matching tests in a rule
|
||||
/// </summary>
|
||||
public List<SkipperTest> Tests { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filename the skipper rule lives in
|
||||
/// </summary>
|
||||
public string SourceFile { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Transform an input file using the given rule
|
||||
@@ -201,12 +223,39 @@ namespace SabreTools.Library.Skippers
|
||||
/// </summary>
|
||||
public struct SkipperTest
|
||||
{
|
||||
public HeaderSkipTest Type;
|
||||
public long? Offset; // null is EOF
|
||||
public byte[] Value;
|
||||
public bool Result;
|
||||
public byte[] Mask;
|
||||
public long? Size; // null is PO2, "power of 2" filesize
|
||||
public HeaderSkipTestFileOperator Operator;
|
||||
/// <summary>
|
||||
/// Type of test to be run
|
||||
/// </summary>
|
||||
public HeaderSkipTest Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File offset to run the test
|
||||
/// </summary>
|
||||
public long? Offset { get; set; } // null is EOF
|
||||
|
||||
/// <summary>
|
||||
/// Static value to be checked at the offset
|
||||
/// </summary>
|
||||
public byte[] Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether a pass or failure is expected
|
||||
/// </summary>
|
||||
public bool Result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Byte mask to be applied to the tested bytes
|
||||
/// </summary>
|
||||
public byte[] Mask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Expected size of the input byte array, used with the Operator
|
||||
/// </summary>
|
||||
public long? Size { get; set; } // null is PO2, "power of 2" filesize
|
||||
|
||||
/// <summary>
|
||||
/// Expected range value for the input byte array size, used with Size
|
||||
/// </summary>
|
||||
public HeaderSkipTestFileOperator Operator { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user