Table of Contents

Struct CSemVer

Namespace
Ubiquity.NET.Versioning
Assembly
Ubiquity.NET.Versioning.dll

Holds a Constrained Semantic Version (CSemVer) value

public readonly struct CSemVer : IParsable<CSemVer>, IComparable<CSemVer>, IComparisonOperators<CSemVer, CSemVer, bool>, IEqualityOperators<CSemVer, CSemVer, bool>, IEquatable<CSemVer>
Implements
Inherited Members

Remarks

Based on CSemVer v1.0.0-rc.1

Constructors

CSemVer(int, int, int, PrereleaseVersion?, IEnumerable<string>?)

Initializes a new instance of the CSemVer struct.

Properties

BuildMeta

Gets the build components of the version

FileVersion

Gets the FileVersionQuad representation of this CSemVer

IsPrerelease

Gets a value indicating whether this is a pre-release version

IsZero

Gets a value indicating whether this is a zero based version

Major

Gets the Major portion of the core version

Minor

Gets the Minor portion of the core version

OrderedVersion

Gets the CSemVer ordered version value of the version

Patch

Gets the Patch portion of the core version

PrereleaseVersion

Gets the Pre-Release version value (if any)

Methods

CompareTo(CSemVer)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Equals(object?)

Indicates whether this instance and a specified object are equal.

Equals(CSemVer)

Indicates whether the current object is equal to another object of the same type.

From(string, IReadOnlyCollection<string>?)

Factory method to create a CSemVer from information available as part of a build

From(ulong, IReadOnlyCollection<string>?)

Converts a file version form (as a ulong) of a CSemVer into a full CSemVer

FromOrderedVersion(ulong, IReadOnlyCollection<string>?)

Converts a CSemVer ordered version integral value (UInt64) into a full CSemVer

GetHashCode()

Returns the hash code for this instance.

Parse(string, IFormatProvider?)

Parses a string into a value.

ToString()

Converts the internal representation of this version to a valid CSemVer formatted string

TryFrom(SemVer, out CSemVer, out Exception)

Tries to parse a SemVer as a CSemVer

TryParse(string?, IFormatProvider?, out CSemVer)

Tries to parse a string into a value.

TryParse(string?, out CSemVer, out Exception)

Applies try pattern to attempt parsing a CSemVer from a string

Operators

operator ==(CSemVer, CSemVer)

Compares two values to determine equality.

operator >(CSemVer, CSemVer)

Compares two values to determine which is greater.

operator >=(CSemVer, CSemVer)

Compares two values to determine which is greater or equal.

operator !=(CSemVer, CSemVer)

Compares two values to determine inequality.

operator <(CSemVer, CSemVer)

Compares two values to determine which is less.

operator <=(CSemVer, CSemVer)

Compares two values to determine which is less or equal.

See Also