public ExportSubsection(ref WASMReader input, IFunctionOffsetProvider functionOffsetProvider = null) { _functionOffsetProvider = functionOffsetProvider; Name = input.ReadString(); Description = (ImpexDesc)input.ReadByte(); Index = input.ReadIntULEB128(); }
public ImportSubsection(ref WASMReader input) { Module = input.ReadString(); Name = input.ReadString(); Value = (Description = (ImpexDesc)input.ReadByte()) switch { ImpexDesc.Function => input.ReadIntULEB128(), ImpexDesc.Table => new TableType(ref input), ImpexDesc.Memory => new MemoryType(ref input), ImpexDesc.Global => new GlobalType(ref input), _ => throw new Exception("Failed to identify import type.") }; }
public ImportSubsection(string module, string name, uint functionTypeIndex) : this(module, name) { Value = functionTypeIndex; Description = ImpexDesc.Function; }
public ImportSubsection(string module, string name, GlobalType global) : this(module, name) { Value = global; Description = ImpexDesc.Global; }
public ImportSubsection(string module, string name, MemoryType memory) : this(module, name) { Value = memory; Description = ImpexDesc.Memory; }
public ImportSubsection(string module, string name, TableType table) : this(module, name) { Value = table; Description = ImpexDesc.Table; }
public IReadOnlyList <ImportSubsection> Choose(ImpexDesc description) => _imports[description];