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
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
IsEmpty
Gets a value indicating whether the range is empty.
public bool IsEmpty { get; }
Property Value
Length
Gets the length of the range.
public int Length { get; }
Property Value
Start
Gets the start offset.
public ulong Start { get; }
Property Value
Methods
Contains(OffsetRange)
Determines whether the provided range is a subset of the range.
public bool Contains(OffsetRange range)
Parameters
rangeOffsetRangeThe range.
Returns
- bool
trueif the range is a subset,falseotherwise.
Contains(ulong)
Determines whether the provided offset falls within the range.
public bool Contains(ulong offset)
Parameters
offsetulongThe offset.
Returns
- bool
trueif the offset falls within the range,falseotherwise.
Deconstruct(out ulong, out ulong)
Deconstructs an offset range into its individual components.
public void Deconstruct(out ulong start, out ulong end)
Parameters
Exclude(OffsetRange)
Determines the resulting ranges after excluding the provided range.
public (OffsetRange left, OffsetRange right) Exclude(OffsetRange other)
Parameters
otherOffsetRangeThe 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
otherOffsetRangeThe other range.
Returns
- OffsetRange
trueif the range intersects,falseotherwise.
Intersects(OffsetRange)
Obtains the intersection between two ranges.
public bool Intersects(OffsetRange other)
Parameters
otherOffsetRangeThe 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
Returns
- OffsetRange
The constructed offset range.