Class IndexEncoder
- Namespace
- AsmResolver.PE.DotNet.Metadata.Tables
- Assembly
- AsmResolver.PE.dll
Provides a mechanism for translating between metadata tokens and coded indices.
public class IndexEncoder
- Inheritance
-
IndexEncoder
- Inherited Members
Constructors
IndexEncoder(TablesStream, params TableIndex[])
Creates a new index encoder.
public IndexEncoder(TablesStream tableStream, params TableIndex[] tables)
Parameters
tableStream
TablesStreamThe tables stream containing the tables the encoder targets.
tables
TableIndex[]The table indices to encode for.
Properties
IndexSize
Gets the size of the indices encoded by the index encoder.
public IndexSize IndexSize { get; }
Property Value
Methods
DecodeIndex(uint)
Translates a coded index to its corresponding metadata token.
public MetadataToken DecodeIndex(uint codedIndex)
Parameters
codedIndex
uintThe coded index to decode.
Returns
- MetadataToken
The decoded metadata token.
EncodeToken(MetadataToken)
Translates a metadata token to its corresponding coded index.
public uint EncodeToken(MetadataToken token)
Parameters
token
MetadataTokenThe metadata token to encode.
Returns
- uint
The coded index.
Exceptions
- ArgumentException
Occurs when the provided metadata token is part of an unsupported metadata table.