Table of Contents

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

pattern string

Exceptions

ArgumentNullException

pattern is null.

FormatException

pattern has 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

int

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

span ReadOnlySpan<byte>

Returns

int

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

span ReadOnlySpan<byte>

Returns

bool

ToString()

The pattern with each position as two uppercase hexadecimal digits or "??".

public override string ToString()

Returns

string