Class ModelUtils
Provides utility methods for interface and feed URIs.
Namespace: ZeroInstall.Model
Assembly: ZeroInstall.Model.dll
Syntax
public static class ModelUtils : Object
Properties
Version
The version of Zero Install feed model (used for compatibility checks).
Declaration
public static ImplementationVersion Version { get; }
Property Value
Type | Description |
---|---|
ImplementationVersion |
Methods
ContainsTemplateVariables(String)
Determines whether a string contains a template variable (a substring enclosed in curly brackets, e.g {var}).
Declaration
public static bool ContainsTemplateVariables(string value)
Parameters
Type | Name | Description |
---|---|---|
String | value |
Returns
Type | Description |
---|---|
Boolean |
GetAbsoluteHref(Uri, String)
Turns a relative HREF into an absolute one, using the file containing the reference as the base.
Declaration
public static Uri GetAbsoluteHref(Uri href, string source)
Parameters
Type | Name | Description |
---|---|---|
Uri | href | The potentially relative HREF; will remain untouched if absolute. |
String | source | The file containing the reference; can be |
Returns
Type | Description |
---|---|
Uri | An absolute HREF. |
Exceptions
Type | Condition |
---|---|
UriFormatException |
|
GetAbsoluteHref(Uri, FeedUri)
Turns a relative HREF into an absolute one, using the file containing the reference as the base.
Declaration
public static Uri GetAbsoluteHref(Uri href, FeedUri source = null)
Parameters
Type | Name | Description |
---|---|---|
Uri | href | The potentially relative HREF; will remain untouched if absolute. |
FeedUri | source | The file containing the reference; can be |
Returns
Type | Description |
---|---|
Uri | An absolute HREF. |
Exceptions
Type | Condition |
---|---|
UriFormatException |
|
GetAbsolutePath(String, String)
Turns a relative path into an absolute one, using the file containing the reference as the base.
Declaration
public static string GetAbsolutePath(string path, string source)
Parameters
Type | Name | Description |
---|---|---|
String | path | The potentially relative path; will remain untouched if absolute. |
String | source | The file containing the reference; can be |
Returns
Type | Description |
---|---|
String | An absolute path. |
Exceptions
Type | Condition |
---|---|
UriFormatException |
|
GetAbsolutePath(String, FeedUri)
Turns a relative path into an absolute one, using the file containing the reference as the base.
Declaration
public static string GetAbsolutePath(string path, FeedUri source = null)
Parameters
Type | Name | Description |
---|---|---|
String | path | The potentially relative path; will remain untouched if absolute. |
FeedUri | source | The file containing the reference; can be |
Returns
Type | Description |
---|---|
String | An absolute path. |
Exceptions
Type | Condition |
---|---|
UriFormatException |
|