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

Restricts the versions of an Implementation that are allowed without creating a dependency on the implementation if its was not already chosen. More...

Inheritance diagram for ZeroInstall.Model.Restriction:
ZeroInstall.Model.FeedElement ZeroInstall.Model.IInterfaceUri NanoByte.Common.ICloneable< Restriction > ZeroInstall.Model.XmlUnknown ZeroInstall.Model.Dependency ZeroInstall.Model.Runner

Public Member Functions

virtual bool IsApplicable (Requirements requirements)
 Determines whether this reference is applicable for the given requirements . More...
 
virtual void Normalize ()
 Flattens inheritance structures, Converts legacy elements, sets default values, etc.. More...
 
override string ToString ()
 Returns the dependency in the form "Interface". Not safe for parsing!
 
virtual Restriction Clone ()
 Creates a deep copy of this Restriction instance. More...
 
bool Equals (Restriction? other)
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 
- Public Member Functions inherited from ZeroInstall.Model.FeedElement
override int GetHashCode ()
 
- Public Member Functions inherited from ZeroInstall.Model.XmlUnknown
string ToShortXml ()
 Returns a shortened XML representation (with attributes but without child elements). More...
 
override int GetHashCode ()
 
- Public Member Functions inherited from NanoByte.Common.ICloneable< Restriction >
Restriction Clone ()
 

Static Public Attributes

const string DistributionZeroInstall = "0install"
 Special value for Distributions that requires require an implementation provided by Zero Install (i.e. one not provided by a PackageImplementation).
 

Properties

FeedUri InterfaceUri = default! [getset]
 The URI or local path used to identify the interface.
 
OS OS [getset]
 Determines for which operating systems this dependency is required.
 
VersionRangeVersions [getset]
 A more flexible alternative to Constraints. Each range is in the form "START..!END". The range matches versions where START <= VERSION < END. The start or end may be omitted. A single version number may be used instead of a range to match only that version, or !VERSION to match everything except that version.
 
string??? InterfaceUriString [getset]
 Used for XML serialization. More...
 
string??? VersionsString [getset]
 Used for XML serialization. More...
 
List< ConstraintConstraints = new() [get]
 A list of version Constraints that must be fulfilled.
 
List< string > Distributions = new() [get]
 Specifies that the selected implementation must be from one of the given distributions (e.g. Debian, RPM). The special value DistributionZeroInstall may be used to require an implementation provided by Zero Install (i.e. one not provided by a PackageImplementation).
 
string DistributionsString [getset]
 Specifies that the selected implementation must be from one of the space-separated distributions (e.g. Debian, RPM). The special value '0install' may be used to require an implementation provided by Zero Install (i.e. one not provided by a PackageImplementation). More...
 
virtual string XmlTagName [get]
 
- Properties inherited from ZeroInstall.Model.FeedElement
VersionRangeIfZeroInstallVersion [getset]
 Only process this element if the current Zero Install version matches the range.
 
string??? IfZeroInstallVersionString [getset]
 Used for XML serialization. More...
 
- Properties inherited from ZeroInstall.Model.IInterfaceUri
FeedUri InterfaceUri [getset]
 An interface URI (URL or file path).
 

Additional Inherited Members

- Public Attributes inherited from ZeroInstall.Model.XmlUnknown
XmlAttribute?[] UnknownAttributes
 Contains any unknown additional XML attributes.
 
XmlElement?[] UnknownElements
 Contains any unknown additional XML elements.
 
- Protected Member Functions inherited from ZeroInstall.Model.FeedElement
bool Equals (FeedElement? other)
 
- Protected Member Functions inherited from ZeroInstall.Model.XmlUnknown
void EnsureAttribute (object? value, string attributeName)
 Ensures that a value deserialized from an XML attribute is set (not null). More...
 
void EnsureAttributeSafeID (string? value, string attributeName)
 Ensures that a value deserialized from an XML attribute is set (not null) and only contains alphanumeric characters, spaces ( ), dots (.), underscores (_), hyphens (-) and plus signs (+). More...
 
bool Equals (XmlUnknown? other)
 
- Static Protected Member Functions inherited from ZeroInstall.Model.FeedElement
static bool FilterMismatch (IRecipeStep step)
 Checks whether an element passes the specified IfZeroInstallVersion restriction, if any.
 
- Static Package Functions inherited from ZeroInstall.Model.FeedElement
static bool FilterMismatch< T > (T element)
 Checks whether an element passes the specified IfZeroInstallVersion restriction, if any. More...
 

Detailed Description

Restricts the versions of an Implementation that are allowed without creating a dependency on the implementation if its was not already chosen.

Member Function Documentation

◆ Clone()

virtual Restriction ZeroInstall.Model.Restriction.Clone ( )
inlinevirtual

Creates a deep copy of this Restriction instance.

Returns
The new copy of the Restriction.

Reimplemented in ZeroInstall.Model.Dependency, and ZeroInstall.Model.Runner.

◆ IsApplicable()

virtual bool ZeroInstall.Model.Restriction.IsApplicable ( Requirements  requirements)
inlinevirtual

Determines whether this reference is applicable for the given requirements .

Reimplemented in ZeroInstall.Model.Dependency.

◆ Normalize()

virtual void ZeroInstall.Model.Restriction.Normalize ( )
inlinevirtual

Flattens inheritance structures, Converts legacy elements, sets default values, etc..

Exceptions
InvalidDataExceptionA required property is not set or invalid.

Reimplemented in ZeroInstall.Model.Dependency, and ZeroInstall.Model.Runner.

Property Documentation

◆ DistributionsString

string ZeroInstall.Model.Restriction.DistributionsString
getset

Specifies that the selected implementation must be from one of the space-separated distributions (e.g. Debian, RPM). The special value '0install' may be used to require an implementation provided by Zero Install (i.e. one not provided by a PackageImplementation).

See also
Distributions

◆ InterfaceUriString

string??? ZeroInstall.Model.Restriction.InterfaceUriString
getset

Used for XML serialization.

See also
InterfaceUri

◆ VersionsString

string??? ZeroInstall.Model.Restriction.VersionsString
getset

Used for XML serialization.

See also
Versions

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