writeMethodDef method
MethodDefIndex
writeMethodDef({
- required String name,
- int rva = 0,
- MethodImplAttributes implFlags = const MethodImplAttributes(0),
- MethodAttributes flags = const MethodAttributes(0),
- MethodSignature signature = const MethodSignature(),
Writes a MethodDef
row, returning the corresponding index.
Implementation
MethodDefIndex writeMethodDef({
required String name,
int rva = 0,
MethodImplAttributes implFlags = const MethodImplAttributes(0),
MethodAttributes flags = const MethodAttributes(0),
MethodSignature signature = const MethodSignature(),
}) {
final table = _tableStream[MetadataTableId.methodDef];
final index = MethodDefIndex(table.length);
table.add(
MethodDef(
rva: rva,
implFlags: implFlags,
flags: flags,
name: _stringHeap.insert(name),
signature: _writeMethodDefSig(signature),
paramList: ParamIndex(_tableStream[MetadataTableId.param].length),
),
);
return index;
}