class

WinMD::Ecma335Importer

Inherits Reference < Object

Converts the Ecma335::ApiModel of a parsed .winmd into the win32json document shape that WinMD::File already consumes, one document per namespace. Keeping the JSON contract as the boundary means every template, override and alias mechanism of the JSON pipeline applies unchanged, and the intermediate documents can be dumped for diffing against real win32json.

Constants

ARCHITECTURES = {1 => "X86", 2 => "X64", 4 => "Arm64"}

Windows.Win32.Foundation.Metadata.Architecture flag bits.

CONSTANT_VALUE_TYPES = {"bool" => "Boolean", "char" => "Char", "int8" => "SByte", "uint8" => "Byte", "int16" => "Int16", "uint16" => "UInt16", "int32" => "Int32", "uint32" => "UInt32", "int64" => "Int64", "uint64" => "UInt64", "float32" => "Single", "float64" => "Double", "string" => "String"}

Constant element types (from the Constant table) to win32json ValueType.

PRIMITIVES = {"void" => "Void", "bool" => "Boolean", "char" => "Char", "int8" => "SByte", "uint8" => "Byte", "int16" => "Int16", "uint16" => "UInt16", "int32" => "Int32", "uint32" => "UInt32", "int64" => "Int64", "uint64" => "UInt64", "float32" => "Single", "float64" => "Double", "nativeint" => "IntPtr", "nativeuint" => "UIntPtr"}

ECMA-335 primitive element names to the .NET names win32json uses.

UNLINKABLE_MODULES = {"forceinline", "ntdllk"}

Import modules that no user-mode program can link against: FORCEINLINE marks header-only inline functions with no export anywhere, and ntdllk is the kernel-mode ntdll. Emitting these would add unresolvable @[Link] libraries.

WIN32_PREFIX = "Windows.Win32."

Constructors

Class methods

api_name(namespace : String) : String

win32json file/API name: the namespace without the Windows.Win32 prefix.

Source

Instance methods

associated_enums=(associated_enums : Bool)

When true, integer parameters and fields that carry an AssociatedEnum attribute are typed as that enum, the way older metadata declared them.

Source
associated_enums?

When true, integer parameters and fields that carry an AssociatedEnum attribute are typed as that enum, the way older metadata declared them.

Source
dump(dir : Path) : Nil

Writes one <Api>.json document per namespace into dir.

Source
files
Source
import
Source
namespace_json(namespace : String, pretty : Bool = false) : String
Source
namespaces

Namespaces that produce an output file, sorted. The namespace holding the metadata attribute definitions themselves is not part of the API surface.

Source

Nested types