MetadataWriter class final
Provides functionality to write a valid .winmd or ECMA-335 metadata file,
including metadata tables, heaps, and system-level assembly references.
Constructors
- MetadataWriter({required String name, int majorVersion = 0xFF, int minorVersion = 0xFF, int buildNumber = 0xFF, int revisionNumber = 0xFF, AssemblyFlags flags = AssemblyFlags.windowsRuntime, Guid? mvid})
-
Constructs a new MetadataWriter instance with the specified assembly
and module information.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toBytes(
) → Uint8List -
Serializes all metadata structures into a portable executable (PE) format,
as specified by the Windows Metadata (
.winmd) specification. -
toString(
) → String -
A string representation of this object.
inherited
-
writeAssemblyRef(
{required String namespace}) → AssemblyRefIndex -
Adds an
AssemblyRefrow representing the given namespace to the file, returning its row index. -
writeClassLayout(
{required TypeDefIndex parent, int packingSize = 0, int classSize = 0}) → void -
Writes a
ClassLayoutrow. -
writeConstant(
{required HasConstant parent, required MetadataValue value}) → void -
Writes a
Constantrow. -
writeCustomAttribute(
{required HasCustomAttribute parent, required CustomAttributeType type, List< FixedArg> fixedArgs = const [], List<NamedArg> namedArgs = const []}) → void -
Writes a
CustomAttributerow. -
writeDeclSecurity(
{required SecurityAction action, required HasDeclSecurity parent, required Uint8List permissionSet}) → void -
Writes a
DeclSecurityrow. -
writeEvent(
{required String name, NamedClassType? eventType, EventAttributes eventFlags = const EventAttributes(0)}) → EventIndex -
Writes an
Eventrow, returning the corresponding index. -
writeEventMap(
{required TypeDefIndex parent}) → void -
Associates a
TypeDefwith the first event in its event list. -
writeExportedType(
{required TypeDefIndex typeDefId, required String name, required Implementation implementation, String? namespace, TypeAttributes flags = const TypeAttributes(0)}) → ExportedTypeIndex -
Writes an
ExportedTyperow, returning the corresponding index. -
writeField(
{required String name, required MetadataType signature, FieldAttributes flags = const FieldAttributes(0)}) → FieldIndex -
Writes a
Fieldrow, returning the corresponding index. -
writeFieldLayout(
{required int offset, required FieldIndex field}) → void -
Writes a
FieldLayoutrow. -
writeFieldMarshal(
{required HasFieldMarshal parent, required MarshallingDescriptor descriptor}) → void -
Writes a
FieldMarshalrow. -
writeFieldRVA(
{required FieldIndex field, required int rva}) → void -
Writes a
FieldRVArow. -
writeFile(
{required String name, required Uint8List hashValue, FileAttributes flags = const FileAttributes(0)}) → FileIndex -
Writes a
Filerow, returning the corresponding index. -
writeGenericParam(
{required int number, required TypeOrMethodDef owner, required String name, GenericParamAttributes flags = const GenericParamAttributes(0), TypeDefOrRef? constraint}) → void -
Writes a
GenericParamrow. -
writeImplMap(
{required MethodDefIndex method, required String importName, required String importScope, PInvokeAttributes flags = const PInvokeAttributes(0)}) → void -
Writes an
ImplMaprow. -
writeInterfaceImpl(
{required TypeDefIndex class$, required NamedClassType interface}) → InterfaceImplIndex -
Writes an
InterfaceImplrow, returning the corresponding index. -
writeManifestResource(
{required int offset, required String name, required Implementation implementation, ManifestResourceAttributes flags = const ManifestResourceAttributes(0)}) → ManifestResourceIndex -
Writes a
ManifestResourcerow, returning the corresponding index. -
writeMemberRef(
{required MemberRefParent parent, required String name, required MemberRefSignature signature}) → MemberRefIndex -
Writes a
MemberRefrow, returning the corresponding index. -
writeMethodDef(
{required String name, int rva = 0, MethodImplAttributes implFlags = const MethodImplAttributes(0), MethodAttributes flags = const MethodAttributes(0), MethodSignature signature = const MethodSignature()}) → MethodDefIndex -
Writes a
MethodDefrow, returning the corresponding index. -
writeMethodImpl(
{required TypeDefIndex class$, required MethodDefOrRef methodBody, required MethodDefOrRef methodDeclaration}) → void -
Writes a
MethodImplrow. -
writeMethodSemantics(
{required MethodSemanticsAttributes semantics, required MethodDefIndex method, required HasSemantics association}) → void -
Adds a
MethodSemanticsrow associating a method with a property or event. -
writeMethodSpec(
{required MethodDefOrRef method, required List< MetadataType> generics}) → MethodSpecIndex -
Writes a
MethodSpecrow, returning the corresponding index. -
writeModuleRef(
{required String name}) → ModuleRefIndex -
Writes a
ModuleRefrow, returning the corresponding index. -
writeNestedClass(
{required TypeDefIndex inner, required TypeDefIndex outer}) → void -
Adds a
NestedClassrow associating an inner class with its outer class. -
writeParam(
{required int sequence, required String name, ParamAttributes flags = const ParamAttributes(0)}) → ParamIndex -
Writes a
Paramrow, returning the corresponding index. -
writeProperty(
{required String name, required PropertySig signature, PropertyAttributes flags = const PropertyAttributes(0)}) → PropertyIndex -
Writes a
Propertyrow, returning the corresponding index. -
writePropertyMap(
{required TypeDefIndex parent}) → void -
Associates a
TypeDefwith the first property in its property list. -
writeStandAloneSig(
{required StandAloneSignature signature}) → StandAloneSigIndex -
Writes a
StandAloneSigrow, returning the corresponding index. -
writeTypeDef(
{required String namespace, required String name, TypeAttributes flags = const TypeAttributes(0), TypeDefOrRef extends$ = TypeDefOrRef.none}) → TypeDefIndex -
Writes a
TypeDefrow, returning the corresponding index. -
writeTypeRef(
{required String namespace, required String name}) → TypeRefIndex -
Writes a
TypeRefrow, returning the corresponding index. -
writeTypeSpec(
{required String namespace, required String name, List< MetadataType> generics = const []}) → TypeSpecIndex -
Writes a
TypeSpecrow, returning the corresponding index.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited