diff --git a/Sources/WindowsMetadata/ActivatableData.swift b/Sources/WindowsMetadata/ActivatableData.swift index a924e96..4741152 100644 --- a/Sources/WindowsMetadata/ActivatableData.swift +++ b/Sources/WindowsMetadata/ActivatableData.swift @@ -2,10 +2,10 @@ import DotNetMetadata public struct ActivatableData { public var type: InterfaceDefinition? = nil - public var startVersion: StartVersion + public var applicability: VersionApplicability - public init(type: InterfaceDefinition? = nil, startVersion: StartVersion) { + public init(type: InterfaceDefinition? = nil, applicability: VersionApplicability) { self.type = type - self.startVersion = startVersion + self.applicability = applicability } } \ No newline at end of file diff --git a/Sources/WindowsMetadata/FoundationAttributes.swift b/Sources/WindowsMetadata/FoundationAttributes.swift index 243f913..0d54589 100644 --- a/Sources/WindowsMetadata/FoundationAttributes.swift +++ b/Sources/WindowsMetadata/FoundationAttributes.swift @@ -42,10 +42,10 @@ public enum FoundationAttributes { if case .type(let definition) = arguments[0] { guard let type = definition as? InterfaceDefinition else { throw InvalidMetadataError.attributeArguments } - return ActivatableData(type: type, startVersion: try toStartVersion(arguments[1...])) + return ActivatableData(type: type, applicability: try toVersionApplicability(arguments[1...])) } else { - return ActivatableData(startVersion: try toStartVersion(arguments[...])) + return ActivatableData(applicability: try toVersionApplicability(arguments[...])) } } } @@ -57,14 +57,14 @@ public enum FoundationAttributes { guard arguments.count >= 2 else { throw InvalidMetadataError.attributeArguments } guard case .type(let definition) = arguments[0], let type = definition as? InterfaceDefinition else { throw InvalidMetadataError.attributeArguments } - return StaticInterface(type: type, startVersion: try toStartVersion(arguments[1...])) + return StaticInterface(type: type, applicability: try toVersionApplicability(arguments[1...])) } } - private static func toStartVersion(_ arguments: ArraySlice) throws -> StartVersion { + private static func toVersionApplicability(_ arguments: ArraySlice) throws -> VersionApplicability { guard arguments.count >= 1 else { throw InvalidMetadataError.attributeArguments } - var context: StartVersion.Context? + var context: VersionApplicability.Context? if arguments.count == 2 { guard case .constant(let contextConstant) = arguments.last! else { throw InvalidMetadataError.attributeArguments } switch contextConstant { @@ -80,7 +80,7 @@ public enum FoundationAttributes { guard case .constant(let versionConstant) = arguments.first!, case .uint32(let version) = versionConstant else { throw InvalidMetadataError.attributeArguments } - return StartVersion(version: .init(unpacking: version), context: context) + return VersionApplicability(version: .init(unpacking: version), context: context) } public static func isDefaultInterface(_ baseInterface: BaseInterface) throws -> Bool { diff --git a/Sources/WindowsMetadata/StaticInterface.swift b/Sources/WindowsMetadata/StaticInterface.swift index 9a58e64..1fc5ca0 100644 --- a/Sources/WindowsMetadata/StaticInterface.swift +++ b/Sources/WindowsMetadata/StaticInterface.swift @@ -2,10 +2,10 @@ import DotNetMetadata public struct StaticInterface { public var type: TypeDefinition - public var startVersion: StartVersion + public var applicability: VersionApplicability - public init(type: TypeDefinition, startVersion: StartVersion) { + public init(type: TypeDefinition, applicability: VersionApplicability) { self.type = type - self.startVersion = startVersion + self.applicability = applicability } } \ No newline at end of file diff --git a/Sources/WindowsMetadata/StartVersion.swift b/Sources/WindowsMetadata/VersionApplicability.swift similarity index 94% rename from Sources/WindowsMetadata/StartVersion.swift rename to Sources/WindowsMetadata/VersionApplicability.swift index abeaf8f..d5d68ce 100644 --- a/Sources/WindowsMetadata/StartVersion.swift +++ b/Sources/WindowsMetadata/VersionApplicability.swift @@ -1,4 +1,4 @@ -public struct StartVersion { +public struct VersionApplicability { public enum Context { case contract(name: String) case platform(Platform)