Class BytePattern
- Namespace
- SkyrimForge
- Assembly
- SkyrimForge.dll
A byte sequence in which some positions match any byte, written as hexadecimal pairs separated by spaces, such as "48 8D 0D ?? ?? ?? ??".
public sealed class BytePattern
- Inheritance
-
BytePattern
- Inherited Members
Constructors
BytePattern(string)
Parses a pattern. Each position is two hexadecimal digits, or "?" or "??" for a position that matches any byte.
public BytePattern(string pattern)
Parameters
patternstring
Exceptions
- ArgumentNullException
patternisnull.- FormatException
patternhas no positions, or a position is neither two hexadecimal digits nor a wildcard.
Properties
Length
The number of positions.
public int Length { get; }
Property Value
Methods
IndexOf(ReadOnlySpan<byte>)
The index of the first position in a span at which the pattern matches, or -1 where it matches nowhere.
public int IndexOf(ReadOnlySpan<byte> span)
Parameters
spanReadOnlySpan<byte>
Returns
Matches(ReadOnlySpan<byte>)
Whether a span begins with the pattern. A span shorter than the pattern does not match.
public bool Matches(ReadOnlySpan<byte> span)
Parameters
spanReadOnlySpan<byte>
Returns
ToString()
The pattern with each position as two uppercase hexadecimal digits or "??".
public override string ToString()