metadata

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2026 License: GPL-3.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttributeTypeGUID                 = "Windows.Foundation.Metadata.GuidAttribute"
	AttributeTypeExclusiveTo          = "Windows.Foundation.Metadata.ExclusiveToAttribute"
	AttributeTypeStaticAttribute      = "Windows.Foundation.Metadata.StaticAttribute"
	AttributeTypeActivatableAttribute = "Windows.Foundation.Metadata.ActivatableAttribute"
	AttributeTypeDefaultAttribute     = "Windows.Foundation.Metadata.DefaultAttribute"
	AttributeTypeOverloadAttribute    = "Windows.Foundation.Metadata.OverloadAttribute"
)

Custom Attributes

Variables

This section is empty.

Functions

func GetMethodOverloadName

func GetMethodOverloadName(ctx *winmd.Metadata, methodDef *winmd.MethodDef) string

GetMethodOverloadName finds and returns the overload attribute for the given method.

func ParseFieldSig

func ParseFieldSig(data winmd.SigFieldBlob) (winmd.SigField, error)

ParseFieldSig parses a raw ECMA-335 FieldSig blob (§II.23.2.4).

func ParseMethodSig

func ParseMethodSig(data winmd.SigMethodDefBlob) (winmd.SigMethodDef, error)

ParseMethodSig parses a raw ECMA-335 MethodDefSig blob (§II.23.2.1) into a winmd.SigMethodDef. It extends go-winmd's built-in parser by supporting ElementType_GENERICINST, ElementType_VAR, ElementType_MVAR and ElementType_SZARRAY which go-winmd does not yet decode.

func ResolveTypeDefOrRefName

func ResolveTypeDefOrRefName(m *winmd.Metadata, ci winmd.CodedIndex[winmd.TypeDefOrRef]) (string, string, error)

ResolveTypeDefOrRefName resolves a TypeDefOrRef coded index to its namespace and name.

Types

type ClassNotFoundError

type ClassNotFoundError struct {
	Class string
}

ClassNotFoundError is returned when a class is not found.

func (*ClassNotFoundError) Error

func (e *ClassNotFoundError) Error() string

type HasContext

type HasContext struct {
	// contains filtered or unexported fields
}

HasContext is a helper struct that holds the original context of a metadata element.

func (*HasContext) Ctx

func (hctx *HasContext) Ctx() *winmd.Metadata

Ctx returns the original context of the element.

type QualifiedID

type QualifiedID struct {
	Namespace string
	Name      string
}

QualifiedID holds the namespace and the name of a qualified element. This may be a type, a static function or a field.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store holds the windows metadata contexts. It can be used to get the metadata across multiple files.

func NewStore

func NewStore(logger logger.Log) (*Store, error)

NewStore loads all windows metadata files and returns a new Store.

func (*Store) TypeDefByName

func (mds *Store) TypeDefByName(class string) (*TypeDef, error)

TypeDefByName returns a type definition that matches the given name.

type TypeDef

type TypeDef struct {
	winmd.TypeDef
	HasContext
	// contains filtered or unexported fields
}

TypeDef is a helper struct that wraps winmd.TypeDef and stores the original context of the typeDef.

func (*TypeDef) Extends

func (typeDef *TypeDef) Extends(class string) (bool, error)

Extends returns true if the type extends the given class.

func (*TypeDef) GUID

func (typeDef *TypeDef) GUID() (string, error)

GUID returns the GUID of the type.

func (*TypeDef) GetAttributeWithType

func (typeDef *TypeDef) GetAttributeWithType(lookupAttrTypeClass string) ([]byte, error)

GetAttributeWithType returns the value of the given attribute type and fails if not found.

func (*TypeDef) GetImplementedInterfaces

func (typeDef *TypeDef) GetImplementedInterfaces() ([]QualifiedID, error)

GetImplementedInterfaces returns the interfaces implemented by the type.

func (*TypeDef) GetTypeDefAttributesWithType

func (typeDef *TypeDef) GetTypeDefAttributesWithType(lookupAttrTypeClass string) [][]byte

GetTypeDefAttributesWithType returns the values of all the attributes that match the given type.

func (*TypeDef) GetValueForEnumField

func (typeDef *TypeDef) GetValueForEnumField(fieldIndex uint32) (string, error)

GetValueForEnumField returns the value of the requested enum field.

func (*TypeDef) IsDelegate

func (typeDef *TypeDef) IsDelegate() bool

IsDelegate returns true if the type is a delegate.

func (*TypeDef) IsEnum

func (typeDef *TypeDef) IsEnum() bool

IsEnum returns true if the type is an enum.

func (*TypeDef) IsInterface

func (typeDef *TypeDef) IsInterface() bool

IsInterface returns true if the type is an interface.

func (*TypeDef) IsRuntimeClass

func (typeDef *TypeDef) IsRuntimeClass() bool

IsRuntimeClass returns true if the type is a runtime class.

func (*TypeDef) IsStruct

func (typeDef *TypeDef) IsStruct() bool

IsStruct returns true if the type is a struct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL