Table of Contents

Struct OffsetRange

Namespace
AsmResolver
Assembly
AsmResolver.dll

Represents an offset range determined by a start and end offset.

public readonly struct OffsetRange
Inherited Members

Constructors

OffsetRange(ulong, ulong)

Creates a new offset range.

public OffsetRange(ulong start, ulong end)

Parameters

start ulong

The start offset.

end ulong

The end offset, this offset is exclusive.

Exceptions

ArgumentException

Occurs when the provided start offset is bigger than the end offset.

Properties

End

Gets the end offset. This offset is exclusive.

public ulong End { get; }

Property Value

ulong

IsEmpty

Gets a value indicating whether the range is empty.

public bool IsEmpty { get; }

Property Value

bool

Length

Gets the length of the range.

public int Length { get; }

Property Value

int

Start

Gets the start offset.

public ulong Start { get; }

Property Value

ulong

Methods

Contains(OffsetRange)

Determines whether the provided range is a subset of the range.

public bool Contains(OffsetRange range)

Parameters

range OffsetRange

The range.

Returns

bool

true if the range is a subset, false otherwise.

Contains(ulong)

Determines whether the provided offset falls within the range.

public bool Contains(ulong offset)

Parameters

offset ulong

The offset.

Returns

bool

true if the offset falls within the range, false otherwise.

Deconstruct(out ulong, out ulong)

Deconstructs an offset range into its individual components.

public void Deconstruct(out ulong start, out ulong end)

Parameters

start ulong

The start offset.

end ulong

The exclusive end offset.

Exclude(OffsetRange)

Determines the resulting ranges after excluding the provided range.

public (OffsetRange left, OffsetRange right) Exclude(OffsetRange other)

Parameters

other OffsetRange

The range to exclude.

Returns

(OffsetRange left, OffsetRange right)

The resulting ranges.

Intersect(OffsetRange)

Determines whether the current range intersects with the provided range.

public OffsetRange Intersect(OffsetRange other)

Parameters

other OffsetRange

The other range.

Returns

OffsetRange

true if the range intersects, false otherwise.

Intersects(OffsetRange)

Obtains the intersection between two ranges.

public bool Intersects(OffsetRange other)

Parameters

other OffsetRange

The other range.

Returns

bool

The intersection.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

implicit operator OffsetRange((ulong Start, ulong End))

Converts a value tuple of unsigned integers to an offset range.

public static implicit operator OffsetRange((ulong Start, ulong End) tuple)

Parameters

tuple (ulong Start, ulong End)

The tuple to convert.

Returns

OffsetRange

The constructed offset range.