SemVer

Represent a semantic version number

Semantic versions are usually represented as string as: MAJOR[.MINOR[.PATCH]][-PRERELEASE][+BUILD]. For ease of use, a leading v or a leading = are also accepted. Invalid input to the constructor will not throw, but the version will be marked as invalid. This can be checked via isValid.

Constructors

this
this(string semVer)

Creates and validates a version number from a string.

this
this(uint major, uint minor, uint patch)

Creates a 'simple' version with only major, minor, patch components

Members

Functions

differAt
VersionPart differAt(SemVer other)

Compare two different versions and return the parte they differ on.

differAt
VersionPart differAt(SemVer other)

Compare two different versions and return the parte they differ on.

increment
SemVer increment(VersionPart versionPart)

Increment version number.

isStable
bool isStable()

Property that indicates whether this $(D_PSYMBOL SemVer) is stable.

isValid
bool isValid()

Property that indicates whether this $(D_PSYMBOL SemVer) is valid.

opCmp
int opCmp(SemVer other)

Compare this $(D_PSYMBOL SemVer) with the other $(D_PSYMBOL SemVer).

opEquals
bool opEquals(SemVer other)

Check for equality between this $(D_PSYMBOL SemVer) and the other $(D_PSYMBOL SemVer).

query
int query(VersionPart versionPart)

Query a Major, Minor and Patch as integers

queryAsString
string queryAsString(VersionPart versionPart)

Query a possibly decoded PRERELEASE and BUILD string

toString
string toString()

Return the canonical string format.

Meta