Version

Represents a version in semantic version format, or a branch identifier.

This can either have the form "~master", where "master" is a branch name, or the form "major.update.bugfix-prerelease+buildmetadata" (see the Semantic Versioning Specification v2.0.0 at http://semver.org/).

struct Version {
@safe static immutable
Version minRelease;
@safe static immutable
Version maxRelease;
@safe static immutable
Version masterBranch;
@safe static immutable
Version unknown;
}

Constructors

this
this(string vers)

Constructs a new Version from its string representation.

Members

Functions

isBranch
bool isBranch()

Tests if this represents a branch instead of a version.

isMaster
bool isMaster()

Tests if this represents the master branch "~master".

isPreRelease
bool isPreRelease()

Tests if this represents a pre-release version.

isUnknown
bool isUnknown()

Tests if this represents the special unknown version constant.

opCmp
int opCmp(ref const Version other)
int opCmp(const Version other)

Compares two versions/branches for precedence.

toString
string toString()

Returns the string representation of the version/branch.

Static functions

fromString
Version fromString(string vers)

Constructs a new Version from its string representation.

Meta