Up

module Selections

: sig

Handling selections XML documents. See: http://0install.net/selections-spec.html

Types

#
type selection = [
| `selection
] Element.t
#
type role = {
# iface
: General.iface_uri;
# source
: bool;
}
include Sigs.CORE_MODEL with type impl = selection and type command_name = string and type Role.t = role
include Sigs.SELECTIONS with type role := role and type command_name := command_name and type requirements := requirements and type impl := selection
#
type impl_source =
# | CacheSelection of Manifest.digest list
# | LocalSelection of string
# | PackageSelection

Selections documents

#
val create : Support.Qdom.element -> t

Load a selections document.

#
val load_selections : Support.Common.system -> Support.Common.filepath -> t

Create a selections value from a file (parse + create).

#
val root_role : t -> role

The role of the root selection.

#
val root_command : t -> string option

The command on root_role to run.

#
val root_sel : t -> selection

The selection for root_role.

#
val iter : (role -> selection -> unit) -> t -> unit

Iterate over the <selection> elements.

#
val equal : t -> t -> bool

Check whether the XML of two sets of selections are the same, ignoring whitespace.

#
val get_selected_ex : role -> t -> selection

Like get_selected, but raise an exception if not found.

#
val as_xml : t -> Support.Qdom.element

Convert a selections document to XML in the latest format.

Selection elements

#
val get_source : selection -> impl_source
#
val get_path : Support.Common.system -> Stores.stores -> selection -> Support.Common.filepath option

Look up this selection's directory.

Returns None for package implementations.
#
val get_feed : selection -> General.feed_url

Get the URL of the feed this selection came from.

#
val get_id : selection -> Feed_url.global_id

Get the globally unique ID of this selection (feed + ID)

#
val collect_bindings : t -> (role * Element.binding) list
end