Zero Install .NET API 2.20.0
ZeroInstall.Model.ImplementationVersion Class Reference

Represents a version number consisting of dot-separated decimals and optional modifier strings. More...

Inheritance diagram for ZeroInstall.Model.ImplementationVersion:

Public Member Functions

 ImplementationVersion (string value)
 Creates a new implementation version from a a string. More...
 
 ImplementationVersion (Version version)
 Creates a new implementation version from a .NET Version. More...
 
override string ToString ()
 Returns a string representation of the version. Safe for parsing!
 
bool Equals (ImplementationVersion? other)
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 
int CompareTo (ImplementationVersion? other)
 

Static Public Member Functions

static bool TryCreate (string value, [NotNullWhen(true)] out ImplementationVersion? result)
 Creates a new ImplementationVersion using the specified string representation. More...
 
static bool operator== (ImplementationVersion? left, ImplementationVersion? right)
 
static bool operator!= (ImplementationVersion? left, ImplementationVersion? right)
 
static bool operator< (ImplementationVersion left, ImplementationVersion right)
 
static bool operator> (ImplementationVersion left, ImplementationVersion right)
 
static bool operator<= (ImplementationVersion left, ImplementationVersion right)
 
static bool operator>= (ImplementationVersion left, ImplementationVersion right)
 

Properties

VersionDottedList FirstPart [get]
 The first part of the version number.
 
IReadOnlyList< VersionPartAdditionalParts [get]
 All additional parts of the version number.
 
bool ContainsTemplateVariables [get]
 Indicates whether this version number contains a template variable (a substring enclosed in curly brackets, e.g {var}) . More...
 

Detailed Description

Represents a version number consisting of dot-separated decimals and optional modifier strings.

This class is immutable.

This is the syntax for valid version strings:

Version := DottedList ("-" Modifier? DottedList?)*
DottedList := (Integer ("." Integer)*)
Modifier := "pre" | "rc" | "post"

If the string ModelUtils.ContainsTemplateVariables the entire string is stored verbatim and not parsed.

Constructor & Destructor Documentation

◆ ImplementationVersion() [1/2]

ZeroInstall.Model.ImplementationVersion.ImplementationVersion ( string  value)
inline

Creates a new implementation version from a a string.

Parameters
valueThe string containing the version information.
Exceptions
FormatExceptionvalue is not a valid version string.

◆ ImplementationVersion() [2/2]

ZeroInstall.Model.ImplementationVersion.ImplementationVersion ( Version  version)
inline

Creates a new implementation version from a .NET Version.

Parameters
versionThe .NET Version to convert.

Member Function Documentation

◆ TryCreate()

static bool ZeroInstall.Model.ImplementationVersion.TryCreate ( string  value,
[NotNullWhen(true)] out ImplementationVersion result 
)
inlinestatic

Creates a new ImplementationVersion using the specified string representation.

Parameters
valueThe string to parse.
resultReturns the created ImplementationVersion if successfully; null otherwise.
Returns
true if the ImplementationVersion was successfully created; false otherwise.

Property Documentation

◆ ContainsTemplateVariables

bool ZeroInstall.Model.ImplementationVersion.ContainsTemplateVariables
get

Indicates whether this version number contains a template variable (a substring enclosed in curly brackets, e.g {var}) .

This must be false in regular feeds; true is only valid for templates.


The documentation for this class was generated from the following file: