mirror of
https://github.com/GayPizzaSpecifications/darwin-apk.git
synced 2025-08-03 05:30:54 +00:00
39 lines
882 B
Swift
39 lines
882 B
Swift
/*
|
|
* darwin-apk © 2024 Gay Pizza Specifications
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
enum ApkVersionSpecification: Equatable, Hashable, Sendable {
|
|
case any(invert: Bool = false)
|
|
case constraint(invert: Bool = false, op: Operator, version: String)
|
|
}
|
|
|
|
extension ApkVersionSpecification {
|
|
enum Operator: Equatable, Sendable {
|
|
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: "~"
|
|
}
|
|
}
|
|
}
|