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

Provides utility methods for interface and feed URIs. More...

Static Public Member Functions

static bool ContainsTemplateVariables (string value)
 Determines whether a string contains a template variable (a substring enclosed in curly brackets, e.g {var}).
 
static string GetAbsolutePath (string path, FeedUri? source=null)
 Turns a relative path into an absolute one, using the file containing the reference as the base. More...
 
static string GetAbsolutePath (string path, string? source)
 Turns a relative path into an absolute one, using the file containing the reference as the base. More...
 
static Uri GetAbsoluteHref (Uri href, FeedUri? source=null)
 Turns a relative HREF into an absolute one, using the file containing the reference as the base. More...
 
static Uri GetAbsoluteHref (Uri href, string? source)
 Turns a relative HREF into an absolute one, using the file containing the reference as the base. More...
 

Properties

static ImplementationVersion Version = new(AppInfo.CurrentLibrary.Version ?? "1.0.0-pre") [get]
 The version of Zero Install feed model (used for compatibility checks).
 

Detailed Description

Provides utility methods for interface and feed URIs.

Member Function Documentation

◆ GetAbsoluteHref() [1/2]

static Uri ZeroInstall.Model.ModelUtils.GetAbsoluteHref ( Uri  href,
FeedUri source = null 
)
inlinestatic

Turns a relative HREF into an absolute one, using the file containing the reference as the base.

Parameters
hrefThe potentially relative HREF; will remain untouched if absolute.
sourceThe file containing the reference; can be null.
Returns
An absolute HREF.
Exceptions
UriFormatExceptionhref is a relative URI that cannot be resolved.

◆ GetAbsoluteHref() [2/2]

static Uri ZeroInstall.Model.ModelUtils.GetAbsoluteHref ( Uri  href,
string?  source 
)
static

Turns a relative HREF into an absolute one, using the file containing the reference as the base.

Parameters
hrefThe potentially relative HREF; will remain untouched if absolute.
sourceThe file containing the reference; can be null.
Returns
An absolute HREF.
Exceptions
UriFormatExceptionhref is a relative URI that cannot be resolved.

◆ GetAbsolutePath() [1/2]

static string ZeroInstall.Model.ModelUtils.GetAbsolutePath ( string  path,
FeedUri source = null 
)
inlinestatic

Turns a relative path into an absolute one, using the file containing the reference as the base.

Parameters
pathThe potentially relative path; will remain untouched if absolute.
sourceThe file containing the reference; can be null.
Returns
An absolute path.
Exceptions
UriFormatExceptionpath is a relative URI that cannot be resolved.

◆ GetAbsolutePath() [2/2]

static string ZeroInstall.Model.ModelUtils.GetAbsolutePath ( string  path,
string?  source 
)
static

Turns a relative path into an absolute one, using the file containing the reference as the base.

Parameters
pathThe potentially relative path; will remain untouched if absolute.
sourceThe file containing the reference; can be null.
Returns
An absolute path.
Exceptions
UriFormatExceptionpath is a relative URI that cannot be resolved.

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