writeExportedType method

ExportedTypeIndex writeExportedType({
  1. required TypeDefIndex typeDefId,
  2. required String name,
  3. required Implementation implementation,
  4. String? namespace,
  5. TypeAttributes flags = const TypeAttributes(0),
})

Writes an ExportedType row, returning the corresponding index.

Implementation

ExportedTypeIndex writeExportedType({
  required TypeDefIndex typeDefId,
  required String name,
  required Implementation implementation,
  String? namespace,
  TypeAttributes flags = const TypeAttributes(0),
}) {
  final table = _tableStream[MetadataTableId.exportedType];
  final index = ExportedTypeIndex(table.length);
  table.add(
    ExportedType(
      flags: flags,
      typeDefId: typeDefId,
      typeName: _stringHeap.insert(name),
      typeNamespace: namespace == null
          ? const StringIndex(0)
          : _stringHeap.insert(namespace),
      implementation: implementation,
    ),
  );
  return index;
}