Files
darwin-apk/Sources/apk/Common/ApkVersionSpecification.swift
a dinosaur e7fc47d640 make ApkIndexDependency conform to ApkIndexRequirementRef
dunno if this is necessary for the graph to work but we'll see
2024-11-10 21:00:07 +11:00

40 lines
834 B
Swift

/*
* darwin-apk © 2024 Gay Pizza Specifications
* SPDX-License-Identifier: Apache-2.0
*/
enum ApkVersionSpecification: Equatable, Hashable {
case any
case constraint(op: Operator, version: String)
case conflict
}
extension ApkVersionSpecification {
enum Operator: Equatable {
case equals
case fuzzyEquals
case greater
case less
case greaterEqual
case lessEqual
case greaterFuzzy
case lessFuzzy
}
}
extension ApkVersionSpecification.Operator: CustomStringConvertible {
var description: String {
switch self {
//case .checksum: "><"
case .lessEqual: "<="
case .greaterEqual: ">="
case .lessFuzzy: "<~"
case .greaterFuzzy: ">~"
case .equals: "="
case .less: "<"
case .greater: ">"
case .fuzzyEquals: "~"
}
}
}