### Class

# GIRepository Repository

since: 2.80

#### Description

    final class GIRepository.Repository : GObject.Object
    {
      /* No available fields */
    }

`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 `GIBaseInfo`. These can be found using methods like `gi_repository_find_by_name()` or `gi_repository_get_info()`.

You are responsible for ensuring that the lifetime of the `GIRepository` exceeds that of the lifetime of any of its `GIBaseInfo`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 `gi_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 `gi_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.

Available since: 2.80

#### Ancestors

- GObject

#### Constructors

###### gi_repository_new

Create a new `GIRepository`.

since: 2.80

#### Functions

###### gi_repository_dump

Dump the introspection data from the types specified in `input_filename` to `output_filename`.

since: 2.80

###### gi_repository_error_quark

No description available.

###### gi_repository_get_option_group

Obtain the option group for girepository.

since: 2.80

#### Instance methods

###### gi_repository_enumerate_versions

Obtain an unordered list of versions (either currently loaded or available) for `namespace_` in this `repository`.

since: 2.80

###### gi_repository_find_by_error_domain

Searches for the enum type corresponding to the given `GError` domain.

since: 2.80

###### gi_repository_find_by_gtype

Searches all loaded namespaces for a particular `GType`.

since: 2.80

###### gi_repository_find_by_name

Searches for a particular entry in a namespace.

since: 2.80

###### gi_repository_get_c_prefix

This function returns the ‘C prefix’, or the C level namespace associated with the given introspection namespace.

since: 2.80

###### gi_repository_get_dependencies

Retrieves all (transitive) versioned dependencies for `namespace_`.

since: 2.80

###### gi_repository_get_immediate_dependencies

Return an array of the immediate versioned dependencies for `namespace_`. Returned strings are of the form `namespace-version`.

since: 2.80

###### gi_repository_get_info

This function returns a particular metadata entry in the given namespace `namespace_`.

since: 2.80

###### gi_repository_get_library_path

Returns the current search path `GIRepository` will use when loading shared libraries referenced by imported namespaces.

since: 2.80

###### gi_repository_get_loaded_namespaces

Return the list of currently loaded namespaces.

since: 2.80

###### gi_repository_get_n_infos

This function returns the number of metadata entries in given namespace `namespace_`.

since: 2.80

###### gi_repository_get_object_gtype_interfaces

Look up the implemented interfaces for `gtype`.

since: 2.80

###### gi_repository_get_search_path

Returns the current search path `GIRepository` will use when loading typelib files.

since: 2.80

###### gi_repository_get_shared_libraries

This function returns an array of paths to the shared C libraries associated with the given namespace `namespace_`.

since: 2.80

###### gi_repository_get_typelib_path

If namespace `namespace_` is loaded, return the full path to the .typelib file it was loaded from.

since: 2.80

###### gi_repository_get_version

This function returns the loaded version associated with the given namespace `namespace_`.

since: 2.80

###### gi_repository_is_registered

Check whether a particular namespace (and optionally, a specific version thereof) is currently loaded.

since: 2.80

###### gi_repository_load_typelib

Load the given `typelib` into the repository.

since: 2.80

###### gi_repository_prepend_library_path

Prepends `directory` to the search path that is used to search shared libraries referenced by imported namespaces.

since: 2.80

###### gi_repository_prepend_search_path

Prepends `directory` to the typelib search path.

since: 2.80

###### gi_repository_require

Force the namespace `namespace_` to be loaded if it isn’t already.

since: 2.80

###### gi_repository_require_private

Force the namespace `namespace_` to be loaded if it isn’t already.

since: 2.80

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GIRepositoryRepositoryClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.