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

A feed contains all the information required to download and execute an application. More...

Inheritance diagram for ZeroInstall.Model.Feed:
ZeroInstall.Model.XmlUnknown ZeroInstall.Model.IElementContainer ZeroInstall.Model.ISummaryContainer ZeroInstall.Model.IIconContainer NanoByte.Common.ICloneable< Feed > ZeroInstall.Model.IDescriptionContainer

Public Member Functions

EntryPointGetEntryPoint (string? command)
 Returns the first EntryPoint referencing a specific Command. More...
 
string GetBestName (CultureInfo language, string? command)
 Returns the best matching name for a specific Command/EntryPoint. More...
 
string? GetBestSummary (CultureInfo language, string? command)
 Returns the best matching summary for a specific Command/EntryPoint. Will fall back to Summaries. More...
 
IconGetBestIcon (string mimeType, string? command)
 Returns the best matching icon for a specific Command/EntryPoint. Will fall back to Icons. More...
 
void Normalize (FeedUri? feedUri=null)
 Prepares the feed for solver processing. Flattens inheritance structures, Converts legacy elements, sets default values, etc.. Do not call it if you plan on serializing the feed again since it may loose some of its structure. More...
 
void ResolveInternalReferences ()
 Resolves references between elements within the Feed. More...
 
void Strip ()
 Strips the feed down to the application metadata removing specific Implementations.
 
Feed Clone ()
 Creates a deep copy of this Feed instance. More...
 
override string ToString ()
 Returns the feed/interface in the form "Name (Uri)". Not safe for parsing!
 
bool Equals (Feed? other)
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 
- Public Member Functions inherited from ZeroInstall.Model.XmlUnknown
string ToShortXml ()
 Returns a shortened XML representation (with attributes but without child elements). More...
 
override int GetHashCode ()
 
- Public Member Functions inherited from NanoByte.Common.ICloneable< Feed >
Feed Clone ()
 

Public Attributes

string? SchemaLocation = XsiSchemaLocation
 Provides XML Editors with location hints for XSD files.
 
- Public Attributes inherited from ZeroInstall.Model.XmlUnknown
XmlAttribute?[] UnknownAttributes
 Contains any unknown additional XML attributes.
 
XmlElement?[] UnknownElements
 Contains any unknown additional XML elements.
 

Static Public Attributes

const string XmlNamespace = "http://zero-install.sourceforge.net/2004/injector/interface"
 The XML namespace used for storing feed/interface-related data.
 
const string XsdLocation = "https://docs.0install.net/specifications/feed.xsd"
 The URI to retrieve an XSD containing the XML Schema information for this class in serialized form.
 
const string XsiSchemaLocation
 Provides XML Editors with location hints for XSD files. More...
 

Properties

FeedUriUri [getset]
 This attribute is only needed for remote feeds (fetched via HTTP). The value must exactly match the expected URL, to prevent an attacker replacing one correctly-signed feed with another (e.g., returning a feed for the shred program when the user asked for the backup program).
 
FeedUriCatalogUri [getset]
 The URI of the Catalog this feed was stored within. Used as an implementation detail; not part of the official feed format!
 
ImplementationVersionMinInjectorVersion [getset]
 This attribute gives the oldest version of the injector that can read this file. Older versions will tell the user to upgrade if they are asked to read the file. Versions prior to 0.20 do not perform this check, however. If the attribute is not present, the file can be read by all versions.
 
string Name = default! [getset]
 A short name to identify the interface (e.g. "Foo").
 
LocalizableStringCollection Summaries = new() [get]
 
LocalizableStringCollection Descriptions = new() [get]
 
UriHomepage [getset]
 The main website of the application.
 
List< IconIcons = new() [get]
 Zero or more icons representing the application. Used in the Catalog GUI as well as for desktop icons, menu entries, etc..
 
List< CategoryCategories = new() [get]
 A list of well-known categories the applications fits into. May influence the placement in the application menu.
 
bool NeedsTerminal [getset]
 If true, indicates that the program requires a terminal in order to run. Graphical launchers should therefore run this program in a suitable terminal emulator.
 
string? UriString [getset]
 Used for XML serialization and PropertyGrid. More...
 
string??? CatalogUriString [getset]
 Used for XML serialization and PropertyGrid. More...
 
string??? MinInjectorVersionString [getset]
 Used for XML serialization. More...
 
string??? HomepageString [getset]
 Used for XML serialization and PropertyGrid. More...
 
string?? NeedsTerminalString [getset]
 Used for XML serialization. More...
 
List< FeedReferenceFeeds = new() [get]
 Zero ore more additional feeds containing implementations of this interface.
 
List< InterfaceReferenceFeedFor = new() [get]
 The implementations in this feed are implementations of the given interface. This is used when adding a third-party feed.
 
InterfaceReferenceReplacedBy [getset]
 This interface Uri of the feed has been replaced by the given interface. Any references to the old URI should be updated to use the new one. More...
 
List< ElementElements = new() [get]
 A list of Groups and Implementations contained within this interface.
 
List< EntryPointEntryPoints = new() [get]
 A list of EntryPoints for starting this interface.
 
List< CapabilityListCapabilityLists = new() [get]
 A set of Capability lists for different architectures.
 
IEnumerable< ImplementationImplementations [get]
 A flat list of all Implementations contained in this feed. More...
 
Implementation this[string id] [get]
 Returns the Implementation with a specific ID string. More...
 
- Properties inherited from ZeroInstall.Model.IElementContainer
List< ElementElements [get]
 A list of Groups and Implementations contained within this element.
 
- Properties inherited from ZeroInstall.Model.ISummaryContainer
LocalizableStringCollection Summaries [get]
 Short one-line descriptions for different languages; the first word should not be upper-case unless it is a proper noun (e.g. "cures all ills").
 
- Properties inherited from ZeroInstall.Model.IDescriptionContainer
LocalizableStringCollection Descriptions [get]
 Full descriptions for different languages, which can be several paragraphs long.
 
- Properties inherited from ZeroInstall.Model.IIconContainer
List< IconIcons [get]
 Zero or more icons.
 

Additional Inherited Members

- Protected Member Functions inherited from ZeroInstall.Model.XmlUnknown
void EnsureAttribute (object? value, string attributeName)
 Ensures that a value deserialized from an XML attribute is set (not null). More...
 
void EnsureAttributeSafeID (string? value, string attributeName)
 Ensures that a value deserialized from an XML attribute is set (not null) and only contains alphanumeric characters, spaces ( ), dots (.), underscores (_), hyphens (-) and plus signs (+). More...
 
bool Equals (XmlUnknown? other)
 

Detailed Description

A feed contains all the information required to download and execute an application.

See also: https://docs.0install.net/specifications/feed/

Member Function Documentation

◆ Clone()

Feed ZeroInstall.Model.Feed.Clone ( )
inline

Creates a deep copy of this Feed instance.

Returns
The new copy of the Feed.

◆ GetBestIcon()

Icon? ZeroInstall.Model.Feed.GetBestIcon ( string  mimeType,
string?  command 
)

Returns the best matching icon for a specific Command/EntryPoint. Will fall back to Icons.

Parameters
mimeTypeThe Icon.MimeType to try to find. Will only return exact matches.
commandThe name of the command the icon should represent; null is equivalent to Command.NameRun.
Returns
The best matching icon that was found or null if no matching icon was found.

◆ GetBestName()

string ZeroInstall.Model.Feed.GetBestName ( CultureInfo  language,
string?  command 
)

Returns the best matching name for a specific Command/EntryPoint.

Parameters
languageThe language to look for; use CultureInfo.InvariantCulture for none.
commandThe name of the command the name should represent; null is equivalent to Command.NameRun.
Returns
The best matching name that was found.

◆ GetBestSummary()

string? ZeroInstall.Model.Feed.GetBestSummary ( CultureInfo  language,
string?  command 
)

Returns the best matching summary for a specific Command/EntryPoint. Will fall back to Summaries.

Parameters
languageThe language to look for; use CultureInfo.InvariantCulture for none.
commandThe name of the command the summary should represent; null is equivalent to Command.NameRun.
Returns
The best matching summary that was found; null if no matching summary was found.

◆ GetEntryPoint()

EntryPoint? ZeroInstall.Model.Feed.GetEntryPoint ( string?  command)

Returns the first EntryPoint referencing a specific Command.

Parameters
commandThe command name to search for; null is equivalent to Command.NameRun.
Returns
The identified EntryPoint; null no matching one was found.

◆ Normalize()

void ZeroInstall.Model.Feed.Normalize ( FeedUri feedUri = null)
inline

Prepares the feed for solver processing. Flattens inheritance structures, Converts legacy elements, sets default values, etc.. Do not call it if you plan on serializing the feed again since it may loose some of its structure.

Parameters
feedUriThe feed the data was originally loaded from.
Exceptions
InvalidDataExceptionA required property is not set or invalid.

◆ ResolveInternalReferences()

void ZeroInstall.Model.Feed.ResolveInternalReferences ( )
inline

Resolves references between elements within the Feed.

Exceptions
InvalidDataExceptionA reference could not be resolved.

This method should be called instead of Normalize if you plan on serializing the feed again since it preservers the structure.

Member Data Documentation

◆ XsiSchemaLocation

const string ZeroInstall.Model.Feed.XsiSchemaLocation
static
Initial value:
= XmlNamespace + " " + XsdLocation + " " +
CapabilityList.XmlNamespace + " " + CapabilityList.XsdLocation
const string XmlNamespace
The XML namespace used for storing feed/interface-related data.
Definition: Feed.cs:38
const string XsdLocation
The URI to retrieve an XSD containing the XML Schema information for this class in serialized form.
Definition: Feed.cs:43

Provides XML Editors with location hints for XSD files.

Property Documentation

◆ CatalogUriString

string??? ZeroInstall.Model.Feed.CatalogUriString
getset

Used for XML serialization and PropertyGrid.

See also
CatalogUri

◆ HomepageString

string??? ZeroInstall.Model.Feed.HomepageString
getset

Used for XML serialization and PropertyGrid.

See also
Homepage

◆ Implementations

IEnumerable<Implementation> ZeroInstall.Model.Feed.Implementations
get

A flat list of all Implementations contained in this feed.

If this is used before Normalize has been called, incomplete Implementations may be returned, because the Group inheritance structure has not been resolved.

◆ MinInjectorVersionString

string??? ZeroInstall.Model.Feed.MinInjectorVersionString
getset

Used for XML serialization.

See also
MinInjectorVersion

◆ NeedsTerminalString

string?? ZeroInstall.Model.Feed.NeedsTerminalString
getset

Used for XML serialization.

See also
NeedsTerminal

◆ ReplacedBy

InterfaceReference? ZeroInstall.Model.Feed.ReplacedBy
getset

This interface Uri of the feed has been replaced by the given interface. Any references to the old URI should be updated to use the new one.

See also
ImplementationBase.ManifestDigest

◆ this[string id]

Implementation ZeroInstall.Model.Feed.this[string id]
get

Returns the Implementation with a specific ID string.

Parameters
idThe ImplementationBase.ID to look for.
Returns
The identified Implementation.
Exceptions
KeyNotFoundExceptionNo Implementation matching id was found in Elements.

If this is used before Normalize has been called, incomplete Implementations may be returned, because the Group inheritance structure has not been resolved.

◆ UriString

string? ZeroInstall.Model.Feed.UriString
getset

Used for XML serialization and PropertyGrid.

See also
Uri

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