Version object for OpenTAP versions. Adheres to Semantic Version 2.0 formatting and behavior, see http://semver.org. Supported formats: Major.Minor.Patch Major.Minor.Patch-PreRelease Major.Minor.Patch+BuildMetadata. Major.Minor.Patch-PreRelease+BuildMetadata.
More...
Inherits IComparable.
|
| SemanticVersion (int major, int minor, int patch, string preRelease, string buildMetadata) |
| Creates a new SemanticVersion instance More...
|
|
override string | ToString () |
| Prints the string in version format. It should be parsable from the same string. More...
|
|
string | ToString (int fieldCount) |
| Prints the string in version format. It should be parsable from the same string. More...
|
|
bool | IsCompatible (SemanticVersion other) |
| Returns true if the given version is backwards compatible with this. Meaning that 'other' can replace 'this' in every respect. More...
|
|
int | CompareTo (object obj) |
| Returns -1 if obj is greater than this version, 0 if they are the same, and 1 if this is greater than obj More...
|
|
override bool | Equals (object obj) |
| Returns true if the two versions are equal. More...
|
|
override int | GetHashCode () |
| Returns the hashcode for the version. More...
|
|
|
readonly int | Major |
| Major version. Incrementing this number signifies a backward incompatible change in the API.
|
|
readonly int | Minor |
| Minor version. Incrementing this number usually signifies a backward compatible addition to the API.
|
|
readonly int | Patch |
| Patch version. Incrementing this number signifies a change that is both backward and forward compatible.
|
|
readonly string | BuildMetadata |
| Optional build related metadata. Usually a short git commit hash (8 chars). Ignored when determining version presedence. Only ASCII alphanumeric characters and hyphen is allowed [0-9A-Za-z-]
|
|
readonly string | PreRelease |
| Optional pre-release version, denoted by a -. Only ASCII alphanumeric characters and hyphen is allowed [0-9A-Za-z-]. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version.
|
|
Version object for OpenTAP versions. Adheres to Semantic Version 2.0 formatting and behavior, see http://semver.org. Supported formats: Major.Minor.Patch Major.Minor.Patch-PreRelease Major.Minor.Patch+BuildMetadata. Major.Minor.Patch-PreRelease+BuildMetadata.
◆ SemanticVersion()
OpenTap.SemanticVersion.SemanticVersion |
( |
int |
major, |
|
|
int |
minor, |
|
|
int |
patch, |
|
|
string |
preRelease, |
|
|
string |
buildMetadata |
|
) |
| |
|
inline |
Creates a new SemanticVersion instance
- Parameters
-
major | Major version. Incrementing this number signifies a backward incompatible change in the API. |
minor | Minor version. Incrementing this number usually signifies a backward compatible addition to the API. |
patch | Patch version. Incrementing this number signifies a change that is both backward and forward compatible. |
preRelease | Optional pre-release version, denoted by a -. Only ASCII alphanumeric characters and hyphen is allowed [0-9A-Za-z-]. |
buildMetadata | Optional build related metadata. Usually a short git commit hash (8 chars). Ignored when determining version presedence. Only ASCII alphanumeric characters and hyphen is allowed [0-9A-Za-z-] |
◆ CompareTo()
int OpenTap.SemanticVersion.CompareTo |
( |
object |
obj | ) |
|
|
inline |
Returns -1 if obj is greater than this version, 0 if they are the same, and 1 if this is greater than obj
- Parameters
-
- Returns
◆ Equals()
override bool OpenTap.SemanticVersion.Equals |
( |
object |
obj | ) |
|
|
inline |
Returns true if the two versions are equal.
- Parameters
-
- Returns
◆ GetHashCode()
override int OpenTap.SemanticVersion.GetHashCode |
( |
| ) |
|
|
inline |
Returns the hashcode for the version.
- Returns
◆ IsCompatible()
Returns true if the given version is backwards compatible with this. Meaning that 'other' can replace 'this' in every respect.
- Parameters
-
- Returns
◆ Parse()
◆ ToString() [1/2]
override string OpenTap.SemanticVersion.ToString |
( |
| ) |
|
|
inline |
Prints the string in version format. It should be parsable from the same string.
- Returns
◆ ToString() [2/2]
string OpenTap.SemanticVersion.ToString |
( |
int |
fieldCount | ) |
|
|
inline |
Prints the string in version format. It should be parsable from the same string.
- Parameters
-
fieldCount | Number of values to return. Must be 1, 2, 4 or 5. |
- Exceptions
-
ArgumentOutOfRangeException | |
- Returns
◆ TryParse()
static bool OpenTap.SemanticVersion.TryParse |
( |
string |
version, |
|
|
out SemanticVersion |
result |
|
) |
| |
|
inlinestatic |