SemVersion Class

Summary

Class for representing semantic versions.
Namespace
Cake.Common
Interfaces
Base Types
  • object
graph BT Type-->Base0["object"] Type-.->Interface0["IComparable"] Type-.->Interface1["IComparable<SemVersion>"] Type-.->Interface2["IEquatable<SemVersion>"] Type["SemVersion"] class Type type-node

Syntax

public class SemVersion : IComparable, IComparable<SemVersion>, IEquatable<SemVersion>

Constructors

Name Summary
SemVersion(int, int, int, string, string, string) Initializes a new instance of the SemVersion class.
SemVersion(int, int, int, string, string) Initializes a new instance of the SemVersion class.

Fields

Name Constant Value Summary
SemVerRegex
Regex property for parsing a semantic version number.
static

Properties

Name Value Summary
AssemblyVersion Version
Gets the AssemblyVersion of the semantic version.
HasMeta bool
Gets a value indicating whether semantic version has meta or not.
IsPreRelease bool
Gets a value indicating whether semantic version is a prerelease or not.
Major int
Gets the major number of the version.
Meta string
Gets the meta of the version.
Minor int
Gets the minor number of the version.
Patch int
Gets the patch number of the version.
PreRelease string
Gets the prerelease of the version.
VersionString string
Gets the VersionString of the semantic version.
Zero SemVersion
Gets the default version of a SemanticVersion.
static

Methods

Name Value Summary
CompareTo(object) int
Compares to SemVersion objects to and another.
CompareTo(SemVersion) int
Compares to SemVersion objects to and another.
Equals(object) bool
Equals-method for the SemVersion class.
Equals(SemVersion) bool
Checks if two SemVersion objects are equal.
GetHashCode() int
Method for getting the hashcode of the SemVersion object.
ToString() string
Returns the string representation of an SemVersion object.
TryParse(string, SemVersion) bool
Method which tries to parse a semantic version string.
static

Operators

Name Value Summary
operator >(SemVersion, SemVersion) bool

Extension Methods

Name Value Summary
Dump<SemVersion>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<SemVersion>(SemVersion[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<SemVersion>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
NotNull<SemVersion>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
ThrowIfNull<SemVersion>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<SemVersion>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin