Table of Contents

Struct SemanticVersion

Namespace
PAC.DataStructures
public struct SemanticVersion
Inherited Members

Constructors

SemanticVersion(int, int, int)

public SemanticVersion(int major, int minor, int patch)

Parameters

major int
minor int
patch int

Properties

major

public int major { get; set; }

Property Value

int

minor

public int minor { get; set; }

Property Value

int

patch

public int patch { get; set; }

Property Value

int

Methods

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

IncrementMajor()

Adds 1 to the major and resets the minor and patch to 0.

public void IncrementMajor()

IncrementMinor()

Adds 1 to the minor and resets the patch to 0. (The major is unchanged.)

public void IncrementMinor()

IncrementPatch()

Adds 1 to the patch. (The major and minor are unchanged.)

public void IncrementPatch()

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(SemanticVersion, SemanticVersion)

public static bool operator ==(SemanticVersion version1, SemanticVersion version2)

Parameters

version1 SemanticVersion
version2 SemanticVersion

Returns

bool

operator >(SemanticVersion, SemanticVersion)

public static bool operator >(SemanticVersion version1, SemanticVersion version2)

Parameters

version1 SemanticVersion
version2 SemanticVersion

Returns

bool

operator >=(SemanticVersion, SemanticVersion)

public static bool operator >=(SemanticVersion version1, SemanticVersion version2)

Parameters

version1 SemanticVersion
version2 SemanticVersion

Returns

bool

operator !=(SemanticVersion, SemanticVersion)

public static bool operator !=(SemanticVersion version1, SemanticVersion version2)

Parameters

version1 SemanticVersion
version2 SemanticVersion

Returns

bool

operator <(SemanticVersion, SemanticVersion)

public static bool operator <(SemanticVersion version1, SemanticVersion version2)

Parameters

version1 SemanticVersion
version2 SemanticVersion

Returns

bool

operator <=(SemanticVersion, SemanticVersion)

public static bool operator <=(SemanticVersion version1, SemanticVersion version2)

Parameters

version1 SemanticVersion
version2 SemanticVersion

Returns

bool

operator -(SemanticVersion, SemanticVersion)

Returns a Version such that the most important field in which the operands differ (in the order major, minor, patch) is set to the positive difference of them in this field, and the other two fields are set to 0.

NOTE: This operation is commutative (swapping the order of the operands doesn't affect the result).

Example:
Version(1, 4, 3) - Version(1, 6, 10) = Version(0, 2, 0)
public static SemanticVersion operator -(SemanticVersion version1, SemanticVersion version2)

Parameters

version1 SemanticVersion
version2 SemanticVersion

Returns

SemanticVersion