STRUCT
PackageVersion
Contents
- Properties
maxSegmentCountmajorminorpatchsegment4segment5preReleaseSegmentspreReleasebuildMetadatavaluedescriptionversionCharsetlowest
- Methods
init(from:)parse(from:)init(_:_:_:_:_:preRelease:buildMetadata:preReleaseSegments:value:)bump()bumpMinor()bumpMajor()==(_:_:)hash(into:)<(_:_:)
swift
public struct PackageVersion: CustomStringConvertible, Codable, Comparable, Equatable, HashableProperties
maxSegmentCount
swift
public static let maxSegmentCount = 5major
swift
public let major: Intminor
swift
public let minor: Intpatch
swift
public let patch: Intsegment4
swift
public let segment4: Intsegment5
swift
public let segment5: IntpreReleaseSegments
swift
public let preReleaseSegments: [String]preRelease
swift
public let preRelease: String?buildMetadata
swift
public let buildMetadata: String?value
swift
public let value: Stringdescription
swift
public var description: StringversionCharset
swift
public static let versionCharset: CharacterSet = {
var charset = CharacterSet.decimalDigits
charset.insert(charactersIn: ".-+")
charset.insert(charactersIn: "a"..."z")
charset.insert(charactersIn: "A"..."Z")
return charset
}()lowest
swift
public static let lowest: PackageVersion = .init(0, 0, 0, 0, 1)Methods
init(from:)
swift
public init(from str: CustomStringConvertible)parse(from:)
swift
public static func parse(from str: CustomStringConvertible) -> PackageVersion?init(_:_:_:_:_:preRelease:buildMetadata:preReleaseSegments:value:)
swift
public init(
_ major: Int,
_ minor: Int = 0,
_ patch: Int = 0,
_ segment4: Int = 0,
_ segment5: Int = 0,
preRelease: String? = nil,
buildMetadata: String? = nil,
preReleaseSegments: [String] = [],
value: String? = nil
)bump()
swift
public func bump() -> SelfbumpMinor()
swift
public func bumpMinor() -> SelfbumpMajor()
swift
public func bumpMajor() -> Self==(_:_:)
swift
public static func == (lhs: Self, rhs: Self) -> BoolParameters
| Name | Description |
|---|---|
| lhs | A value to compare. |
| rhs | Another value to compare. |
hash(into:)
swift
public func hash(into hasher: inout Hasher)Parameters
| Name | Description |
|---|---|
| hasher | The hasher to use when combining the components of this instance. |
<(_:_:)
swift
public static func < (lhs: Self, rhs: Self) -> BoolParameters
| Name | Description |
|---|---|
| lhs | A value to compare. |
| rhs | Another value to compare. |
