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

A set of requirements/restrictions imposed by the user on the Implementation selection process. Used as input for the solver. More...

Inheritance diagram for ZeroInstall.Model.Requirements:
NanoByte.Common.ICloneable< Requirements >

Public Member Functions

void AddRestriction (FeedUri feedUri, VersionRange versions)
 Adds version restriction for a specific feeds. Merges with any existing restrictions for that feed. More...
 
 Requirements ()
 Creates an empty requirements object. Use this to fill in values incrementally, e.g. when parsing command-line arguments.
 
 Requirements (FeedUri interfaceUri, string? command=null, Architecture architecture=default)
 Creates a new requirements object. More...
 
 Requirements (string interfaceUri)
 Creates a new requirements object. More...
 
 Requirements (string interfaceUri, string? command=null, Architecture architecture=default)
 Creates a new requirements object. More...
 
Requirements ForCurrentSystem ()
 Substitutes blank values with default values appropriate for the current system.
 
Requirements Clone ()
 Creates a deep copy of this Requirements instance. More...
 
override string ToString ()
 Returns the requirements in the form "InterfaceUri (Command)". Not safe for parsing!
 
string[] ToCommandLineArgs ()
 Transforms the requirements into a command-line arguments.
 
bool Equals (Requirements? other)
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 
- Public Member Functions inherited from NanoByte.Common.ICloneable< Requirements >
Requirements Clone ()
 

Properties

FeedUri InterfaceUri = default! [getset]
 The URI or local path (must be absolute) to the interface to solve the dependencies for.
 
string? Command [getset]
 The name of the command in the implementation to execute. Will default to Model.Command.NameRun or Model.Command.NameCompile if null. Will not try to find any command if set to string.Empty.
 
LanguageSet Languages = new() [get]
 The preferred languages for the implementation.
 
Architecture Architecture [getset]
 The architecture to find executables for. Find for the current system if left at default value. More...
 
string? InterfaceUriString [getset]
 Used for XML serialization. More...
 
string LanguagesString [getset]
 Used for XML and JSON serialization. More...
 
bool Source [getset]
 Used for XML and JSON serialization. More...
 
string OSString [getset]
 Used for XML and JSON serialization. More...
 
string CpuString [getset]
 Used for XML and JSON serialization. More...
 
Dictionary< FeedUri, VersionRangeExtraRestrictions = new() [get]
 The ranges of versions of specific sub-implementations that can be chosen.
 
List< string > Distributions = new() [get]
 Specifies that the selected implementations must be from one of the given distributions (e.g. Debian, RPM). The special value Restriction.DistributionZeroInstall may be used to require implementations provided by Zero Install (i.e. one not provided by a PackageImplementation). More...
 

Detailed Description

A set of requirements/restrictions imposed by the user on the Implementation selection process. Used as input for the solver.

Constructor & Destructor Documentation

◆ Requirements() [1/3]

ZeroInstall.Model.Requirements.Requirements ( FeedUri  interfaceUri,
string?  command = null,
Architecture  architecture = default 
)
inline

Creates a new requirements object.

Parameters
interfaceUriThe URI or local path (must be absolute) to the interface to solve the dependencies for.
commandThe name of the command in the implementation to execute. Will default to Model.Command.NameRun or Model.Command.NameCompile if null. Will not try to find any command if set to string.Empty.
architectureThe architecture to find executables for. Find for the current system if left at default value.

◆ Requirements() [2/3]

ZeroInstall.Model.Requirements.Requirements ( string  interfaceUri)
inline

Creates a new requirements object.

Parameters
interfaceUriThe URI or local path (must be absolute) to the interface to solve the dependencies for. Must be an HTTP(S) URL or an absolute local path.
Exceptions
UriFormatExceptioninterfaceUri is not a valid HTTP(S) URL or an absolute local path.

◆ Requirements() [3/3]

ZeroInstall.Model.Requirements.Requirements ( string  interfaceUri,
string?  command = null,
Architecture  architecture = default 
)
inline

Creates a new requirements object.

Parameters
interfaceUriThe URI or local path (must be absolute) to the interface to solve the dependencies for. Must be an HTTP(S) URL or an absolute local path.
commandThe name of the command in the implementation to execute. Will default to Model.Command.NameRun or Model.Command.NameCompile if null. Will not try to find any command if set to string.Empty.
architectureThe architecture to find executables for. Find for the current system if left at default value.
Exceptions
UriFormatExceptioninterfaceUri is not a valid HTTP(S) URL or an absolute local path.

Member Function Documentation

◆ AddRestriction()

void ZeroInstall.Model.Requirements.AddRestriction ( FeedUri  feedUri,
VersionRange  versions 
)

Adds version restriction for a specific feeds. Merges with any existing restrictions for that feed.

Parameters
feedUriThe feed URI to apply the restriction for.
versionsThe version range set to restrict to.

◆ Clone()

Requirements ZeroInstall.Model.Requirements.Clone ( )
inline

Creates a deep copy of this Requirements instance.

Returns
The new copy of the Requirements.

Property Documentation

◆ Architecture

Architecture ZeroInstall.Model.Requirements.Architecture
getset

The architecture to find executables for. Find for the current system if left at default value.

Will default to Model.Architecture.CurrentSystem if left at default value. Will not try to find any command if set to string.Empty.

◆ CpuString

string ZeroInstall.Model.Requirements.CpuString
getset

Used for XML and JSON serialization.

See also
Architecture

◆ Distributions

List<string> ZeroInstall.Model.Requirements.Distributions = new()
get

Specifies that the selected implementations must be from one of the given distributions (e.g. Debian, RPM). The special value Restriction.DistributionZeroInstall may be used to require implementations provided by Zero Install (i.e. one not provided by a PackageImplementation).

Used internally by solvers, copied from Restriction.Distributions, not set directly by user, not serialized.

◆ InterfaceUriString

string? ZeroInstall.Model.Requirements.InterfaceUriString
getset

Used for XML serialization.

See also
InterfaceUri

◆ LanguagesString

string ZeroInstall.Model.Requirements.LanguagesString
getset

Used for XML and JSON serialization.

See also
Languages

◆ OSString

string ZeroInstall.Model.Requirements.OSString
getset

Used for XML and JSON serialization.

See also
Architecture

◆ Source

bool ZeroInstall.Model.Requirements.Source
getset

Used for XML and JSON serialization.

See also
Architecture

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