Table of Contents

Class ModelUtils

Namespace
ZeroInstall.Model
Assembly
ZeroInstall.Model.dll

Provides utility methods for interface and feed URIs.

public static class ModelUtils
Inheritance
ModelUtils
Inherited Members

Properties

Version

The version of Zero Install feed model (used for compatibility checks).

public static ImplementationVersion Version { get; }

Property Value

ImplementationVersion

Methods

ContainsTemplateVariables(string)

Determines whether a string contains a template variable (a substring enclosed in curly brackets, e.g {var}).

public static bool ContainsTemplateVariables(string value)

Parameters

value string

Returns

bool

GetAbsoluteHref(Uri, string?)

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

public static Uri GetAbsoluteHref(Uri href, string? source)

Parameters

href Uri

The potentially relative HREF; will remain untouched if absolute.

source string

The file containing the reference; can be null.

Returns

Uri

An absolute HREF.

Exceptions

UriFormatException

href is a relative URI that cannot be resolved.

GetAbsoluteHref(Uri, FeedUri?)

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

public static Uri GetAbsoluteHref(Uri href, FeedUri? source = null)

Parameters

href Uri

The potentially relative HREF; will remain untouched if absolute.

source FeedUri

The file containing the reference; can be null.

Returns

Uri

An absolute HREF.

Exceptions

UriFormatException

href is a relative URI that cannot be resolved.

GetAbsolutePath(string, string?)

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

public static string GetAbsolutePath(string path, string? source)

Parameters

path string

The potentially relative path; will remain untouched if absolute.

source string

The file containing the reference; can be null.

Returns

string

An absolute path.

Exceptions

UriFormatException

path is a relative URI that cannot be resolved.

GetAbsolutePath(string, FeedUri?)

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

public static string GetAbsolutePath(string path, FeedUri? source = null)

Parameters

path string

The potentially relative path; will remain untouched if absolute.

source FeedUri

The file containing the reference; can be null.

Returns

string

An absolute path.

Exceptions

UriFormatException

path is a relative URI that cannot be resolved.