Пример #1
0
        public ExportSubsection(ref WASMReader input, IFunctionOffsetProvider functionOffsetProvider = null)
        {
            _functionOffsetProvider = functionOffsetProvider;

            Name        = input.ReadString();
            Description = (ImpexDesc)input.ReadByte();
            Index       = input.ReadIntULEB128();
        }
Пример #2
0
 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.")
     };
 }
Пример #3
0
 public ImportSubsection(string module, string name, uint functionTypeIndex)
     : this(module, name)
 {
     Value       = functionTypeIndex;
     Description = ImpexDesc.Function;
 }
Пример #4
0
 public ImportSubsection(string module, string name, GlobalType global)
     : this(module, name)
 {
     Value       = global;
     Description = ImpexDesc.Global;
 }
Пример #5
0
 public ImportSubsection(string module, string name, MemoryType memory)
     : this(module, name)
 {
     Value       = memory;
     Description = ImpexDesc.Memory;
 }
Пример #6
0
 public ImportSubsection(string module, string name, TableType table)
     : this(module, name)
 {
     Value       = table;
     Description = ImpexDesc.Table;
 }
Пример #7
0
 public IReadOnlyList <ImportSubsection> Choose(ImpexDesc description) => _imports[description];