rtconst class std::Pod

sys::Obj
  std::Pod

Pod represents a module of Types. Pods serve as a type namespace as well as unit of deployment and versioning.

config

Str? config(Str name, Str? defV := null)

Convenience for Env.config.

depends

List<Depend> depends()

Get the declared list of dependencies for this pod.

doc

Str? doc()

Return the fandoc chapter for this pod or null if not available. To get the summary string for the pod use:

pod.meta["pod.summary"]
file

File? file(Uri uri, Bool checked := true)

Look up a resource file in this pod. The URI must start with the Pod's uri or be path absolute. If the file cannot be found then return null or throw UnresolvedErr based on checked flag.

Examples:

Pod.find("icons").file(`/x16/cut.png`)
`fan://icons/x16/cut.png`.get
files

List<File> files()

List all the resource files contained by this pod. Resources are any files included in the pod's zip file excluding fcode files. The URI of these files is rooted by uri. Use file or Uri.get to lookup a resource file.

find

static Pod? find(Str name, Bool checked := true)

Find a pod by name. If the pod doesn't exist and checked is false then return null, otherwise throw UnknownPodErr.

flattenDepends

static List<Pod> flattenDepends(List<Pod> pods)

Expand a set of pods to include all their recurisve dependencies. This method is does not order them; see orderByDepends().

isImmutable

virtual override Bool isImmutable()

list

static List<Pod> list()

Get a list of all the pods installed. Note that currently this method will load all of the pods into memory, so it is an expensive operation.

load

static Pod load(InStream in)

Load a pod into memory from the specified input stream. The stream must contain a valid pod zip file with the all the definitions. The pod is completely loaded into memory and the input stream is closed. The pod cannot have resources. The pod name as defined by /pod.def must be uniquely named or Err is thrown.

locale

Str? locale(Str name, Str? defV := "pod::name")

Convenience for Env.locale using Locale.cur.

log

Log log()

Return the log for this pod's name. This is a convenience for Log.get(name).

meta

Map<Str,Str> meta()

Get the meta name/value pairs for this pod. See docLang.

name

Str name()

Simple name of the pod such as "sys".

of

static Pod? of(Obj obj)

Get the pod of the given instance which is convenience for Type.of(obj).pod. See Type.pod.

orderByDepends

static List<Pod> orderByDepends(List<Pod> pods)

Order a list of pods by their dependencies. This method does not flatten dependencies - see flattenDepends().

props

Map<Str,Str> props(Uri uri, Duration maxAge)

Convenience for Env.props.

toImmutable

virtual override Obj toImmutable()

toStr

virtual override Str toStr()

Always return name().

type

Type? type(Str name, Bool checked := true)

Find a type by name. If the type doesn't exist and checked is false then return null, otherwise throw UnknownTypeErr.

types

List<Type> types()

List of the all defined types.

uri

Uri uri()

Uri for this pod which is always "fan://{name}".

version

Version version()

Version number for this pod.