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

Represents a feed or interface URI or local path. Unlike System.Uri this class only accepts HTTP(S) URLs and absolute local paths. More...

Inheritance diagram for ZeroInstall.Model.FeedUri:

Public Member Functions

 FeedUri (Uri value)
 Creates a feed URI from an existing Uri. More...
 
 FeedUri (FeedUri value)
 Passing a FeedUri instance into the FeedUri constructor does nothing useful. Just use the original object.
 
 FeedUri ([Localizable(false)] string value)
 Creates a feed URI from a string. More...
 
new string Escape ()
 Escapes the identifier using URL encoding.
 
string PrettyEscape ()
 Escapes the identifier using URL encoding except for slashes (encoded as #) and colons (left as-is on POSIX systems).
 
string[] EscapeComponent ()
 Convert the identifier to a list of path components. e.g. "http://example.com/foo.xml" becomes ["http", "example.com", "foo.xml"], while "/root/feed.xml" becomes ["file", "root__feed.xml"]. The number of components is determined by the scheme (three for http, two for file). Uses [underscore_escape] to escape each component.
 
override string ToString ()
 Returns a string representation of the URI, not adhering to the escaping rules of RFC 2396. Not safe for parsing!
 
string ToStringRfc ()
 An alternate version of ToString that produces results escaped according to RFC 2396. Safe for parsing!
 
bool Equals (FeedUri? other)
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 

Static Public Member Functions

static string Escape (string value)
 Escapes an identifier using URL encoding.
 
static new FeedUri Unescape (string escaped)
 Unescapes an identifier using URL encoding. More...
 
static string PrettyEscape (string value)
 Escapes an identifier using URL encoding except for slashes (encoded as #) and colons (left as-is on POSIX systems).
 
static FeedUri PrettyUnescape (string escaped)
 Unescapes an identifier using URL encoding except for slashes (encoded as #).
 
static bool operator== (FeedUri? left, FeedUri? right)
 
static bool operator!= (FeedUri? left, FeedUri? right)
 

Static Public Attributes

const string FakePrefix = "fake:"
 This is prepended to a FeedUri if it is meant for demo data and should not be used to actually fetch a feed. More...
 
const string FromDistributionPrefix = "distribution:"
 This is prepended to ImplementationSelection.FromFeed if data was pulled from a native package manager rather than the feed itself. More...
 

Properties

bool IsFake [get]
 Indicates whether this is a fake identifier meant for demo data and should not be used to actually fetch a feed. More...
 
bool IsFromDistribution [get]
 Indicates that an ImplementationSelection was generated with data from a native package manager rather than the feed itself. More...
 

Detailed Description

Represents a feed or interface URI or local path. Unlike System.Uri this class only accepts HTTP(S) URLs and absolute local paths.

Constructor & Destructor Documentation

◆ FeedUri() [1/2]

ZeroInstall.Model.FeedUri.FeedUri ( Uri  value)
inline

Creates a feed URI from an existing Uri.

Parameters
valueAn existing Uri.
Exceptions
UriFormatExceptionvalue is not a valid HTTP(S) URL or an absolute local path.

◆ FeedUri() [2/2]

ZeroInstall.Model.FeedUri.FeedUri ( [Localizable(false)] string  value)
inline

Creates a feed URI from a string.

Parameters
valueA string to parse as an HTTP(S) URL or an absolute local path.
Exceptions
UriFormatExceptionvalue is not a valid HTTP(S) URL or an absolute local path.

Member Function Documentation

◆ Unescape()

static new FeedUri ZeroInstall.Model.FeedUri.Unescape ( string  escaped)
inlinestatic

Unescapes an identifier using URL encoding.

Exceptions
UriFormatExceptionThe unescaped string is not a valid HTTP(S) URL or an absolute local path.

Member Data Documentation

◆ FakePrefix

const string ZeroInstall.Model.FeedUri.FakePrefix = "fake:"
static

This is prepended to a FeedUri if it is meant for demo data and should not be used to actually fetch a feed.

See also
IsFake

◆ FromDistributionPrefix

const string ZeroInstall.Model.FeedUri.FromDistributionPrefix = "distribution:"
static

This is prepended to ImplementationSelection.FromFeed if data was pulled from a native package manager rather than the feed itself.

See also
PackageImplementation, IsFromDistribution

Property Documentation

◆ IsFake

bool ZeroInstall.Model.FeedUri.IsFake
get

Indicates whether this is a fake identifier meant for demo data and should not be used to actually fetch a feed.

See also
FakePrefix

◆ IsFromDistribution

bool ZeroInstall.Model.FeedUri.IsFromDistribution
get

Indicates that an ImplementationSelection was generated with data from a native package manager rather than the feed itself.

See also
FromDistributionPrefix

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