Table of Contents

Struct MetadataRange

Namespace
AsmResolver.PE.DotNet.Metadata.Tables
Assembly
AsmResolver.PE.dll

Represents a range of metadata tokens, indicated by a starting and ending row identifier within a metadata table.

public readonly struct MetadataRange : IEnumerable<MetadataToken>, IEnumerable, IEquatable<MetadataRange>
Implements
Inherited Members

Constructors

MetadataRange(IMetadataTable, TableIndex, uint, uint)

Initializes the range.

public MetadataRange(IMetadataTable redirectionTable, TableIndex table, uint startRid, uint endRid)

Parameters

redirectionTable IMetadataTable

The table that is used for translating raw indices.

table TableIndex

The table.

startRid uint

The starting row identifier.

endRid uint

The ending row identifier. This identifier is exclusive.

MetadataRange(TableIndex, uint, uint)

Initializes the range.

public MetadataRange(TableIndex table, uint startRid, uint endRid)

Parameters

table TableIndex

The table.

startRid uint

The starting row identifier.

endRid uint

The ending row identifier. This identifier is exclusive.

Fields

Empty

Represents the empty metadata range.

public static readonly MetadataRange Empty

Field Value

MetadataRange

Properties

Count

Gets the number of metadata rows this range spans.

public int Count { get; }

Property Value

int

EndRid

Gets the row identifier indicating the end of the range. The range excludes this row identifier.

public uint EndRid { get; }

Property Value

uint

IsEmpty

Gets a value indicating whether the range is empty or not.

public bool IsEmpty { get; }

Property Value

bool

IsRedirected

Gets a value indicating whether the range is associated to a redirection table.

public bool IsRedirected { get; }

Property Value

bool

RedirectionTable

Gets the table that is used for translating raw indices.

public IMetadataTable? RedirectionTable { get; }

Property Value

IMetadataTable

StartRid

Gets the first row identifier that this range includes.

public uint StartRid { get; }

Property Value

uint

Table

Gets the index of the metadata table this range is targeting.

public TableIndex Table { get; }

Property Value

TableIndex

Methods

Equals(MetadataRange)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(MetadataRange other)

Parameters

other MetadataRange

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetEnumerator()

Obtains an enumerator that enumerates all metadata tokens within the range.

public MetadataRange.Enumerator GetEnumerator()

Returns

MetadataRange.Enumerator

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.