`GIRepository` is used to manage repositories of namespaces.
Namespaces are represented on disk by type libraries (`.typelib` files).
The individual pieces of API within a type library are represented by subclasses of [class@GIRepository.BaseInfo]. These can be found
using methods like [method@GIRepository.Repository.find_by_name] or [method@GIRepository.Repository.get_info].
You are responsible for ensuring that the lifetime of the [class@GIRepository.Repository] exceeds that of the lifetime of any of its [
class@GIRepository.BaseInfo]s. This cannot be guaranteed by using internal references within libgirepository as that would affect
performance.
### Discovery of type libraries
`GIRepository` will typically look for a `girepository-1.0` directory under the library directory used when compiling
gobject-introspection. On a standard Linux system this will end up being `/usr/lib/girepository-1.0`.
It is possible to control the search paths programmatically, using [method@GIRepository.Repository.prepend_search_path]. It is also
possible to modify the search paths by using the `GI_TYPELIB_PATH` environment variable. The environment variable takes precedence over
the default search path and the [method@GIRepository.Repository.prepend_search_path] calls.
### Namespace ordering
In situations where namespaces may be searched in order, or returned in a list, the namespaces will be returned in alphabetical order,
with all fully loaded namespaces being returned before any lazily loaded ones (those loaded with `GI_REPOSITORY_LOAD_FLAG_LAZY`). This
allows for deterministic and reproducible results.
Similarly, if a symbol (such as a `GType` or error domain) is being searched for in the set of loaded namespaces, the namespaces will be
searched in that order. In particular, this means that a symbol which exists in two namespaces will always be returned from the
alphabetically-higher namespace. This should only happen in the case of `Gio` and `GioUnix`/`GioWin32`, which all refer to the same `.so`
file and expose overlapping sets of symbols. Symbols should always end up being resolved to `GioUnix` or `GioWin32` if they are platform
dependent, rather than `Gio` itself.
- public List<string> enumerate_versions (string namespace_)
Obtain an unordered list of versions (either currently loaded or
available) for namespace_ in this this.
- public EnumInfo find_by_error_domain (Quark domain)
Searches for the enum type corresponding to the given
Error domain.
- public BaseInfo find_by_gtype (Type gtype)
Searches all loaded namespaces for a particular
Type.
- public BaseInfo find_by_name (string namespace_, string name)
Searches for a particular entry in a namespace.
- public unowned string get_c_prefix (string namespace_)
This function returns the "C prefix", or the C level namespace
associated with the given introspection namespace.
- public string[] get_dependencies (string namespace_)
Retrieves all (transitive) versioned dependencies for namespace_
.
- public string[] get_immediate_dependencies (string namespace_)
Return an array of the immediate versioned dependencies for
namespace_.
- public BaseInfo get_info (string namespace_, int index)
This function returns a particular metadata entry in the given
namespace namespace_.
- public string[] get_loaded_namespaces ()
Return the list of currently loaded namespaces.
- public int get_n_infos (string namespace_)
This function returns the number of metadata entries in given
namespace namespace_.
- public void get_object_gtype_interfaces (Type gtype, out unowned InterfaceInfo[] interfaces_out)
Look up the implemented interfaces for gtype.
- public unowned string? get_shared_library (string namespace_)
This function returns a comma-separated list of paths to the shared C
libraries associated with the given namespace namespace_.
- public unowned string get_typelib_path (string namespace_)
If namespace namespace_ is loaded, return the full path
to the .
- public unowned string get_version (string namespace_)
This function returns the loaded version associated with the given
namespace namespace_.
- public bool is_registered (string namespace_, string? version)
Check whether a particular namespace (and optionally, a specific
version thereof) is currently loaded.
- public unowned string load_typelib (Typelib typelib, RepositoryLoadFlags flags) throws RepositoryError
TODO
- public unowned Typelib require (string namespace_, string? version, RepositoryLoadFlags flags) throws RepositoryError
Force the namespace namespace_ to be loaded if it isn't
already.
- public unowned Typelib require_private (string typelib_dir, string namespace_, string? version, RepositoryLoadFlags flags) throws Error
Force the namespace namespace_ to be loaded if it isn't
already.