GIRepositoryRepository

自:2.80

描述 [源]

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

GIRepository 用于管理命名空间存储库。命名空间在磁盘上由类型库(.typelib 文件)表示。

类型库中的 API 的独立部分由 GIBaseInfo 的子类表示。可以通过如 gi_repository_find_by_name()gi_repository_get_info() 这样的方法找到。

您负责确保 GIRepository 的生命周期超过任何 GIBaseInfo

类型库发现

GIRepository 通常会在编译 gobject-introspection 时使用的库目录下查找名为 girepository-1.0 的目录。在一个标准的 Linux 系统上这将是 /usr/lib/girepository-1.0

可以通过调用 gi_repository_prepend_search_path() 来程序化地控制搜索路径。也可以通过使用 GI_TYPELIB_PATH 环境变量来修改搜索路径。环境变量优先于默认搜索路径和 gi_repository_prepend_search_path() 调用。

命名空间排序

在可能按顺序搜索命名空间或以列表形式返回的场合,命名空间将按字典顺序返回,完全载入的命名空间将在懒惰载入的(带有 GI_REPOSITORY_LOAD_FLAG_LAZY)之前返回。这允许得到确定性和可重复的结果。

同样,如果在加载的命名空间集中搜索符号(如 GType 或错误域),将按该顺序搜索命名空间。特别是,这意味着如果符号存在于两个命名空间中,它总是从字典序较高的命名空间返回。这仅在 GioGioUnix/GioWin32 的情况下发生,它们都引用相同的 .so 文件并公开重叠的符号集。如果符号是平台相关的,则应始终将符号解决到 GioUnixGioWin32,而不是 Gio 本身。

自:2.80

祖先

构造函数

gi_repository_new

创建一个新的 GIRepository

自:2.80

函数

gi_repository_dump

input_filename 中指定的类型从中指定的 output_filename 中转储内省数据。

自:2.80

gi_repository_error_quark
无描述信息。

gi_repository_get_option_group

获取 girepository 的选项组。

自:2.80

实例方法

gi_repository_enumerate_versions

获取此 repositorynamespace_ 的版本的无序列表(当前加载的或可用的)。

自:2.80

gi_repository_find_by_error_domain

搜索与给定 GError 域相对应的枚举类型。

自:2.80

gi_repository_find_by_gtype

搜索所有已加载的命名空间中的特定 GType

自:2.80

gi_repository_find_by_name

在命名空间中搜索特定条目。

自:2.80

gi_repository_get_c_prefix

此函数返回 C 前缀,或与给定的内省命名空间关联的 C 级命名空间。

自:2.80

gi_repository_get_dependencies

检索 namespace_ 的所有(传递性)已版本化的依赖项。

自:2.80

gi_repository_get_immediate_dependencies

返回与 namespace_ 的直接版本化依赖项的数组。返回的字符串形式为 namespace-version

自:2.80

gi_repository_get_info

此函数返回给定命名空间 namespace_ 中的特定元数据条目。

自:2.80

gi_repository_get_library_path

返回 GIRepository 在加载由导入的命名空间引用的共享库时将使用的当前搜索路径。

自:2.80

gi_repository_get_loaded_namespaces

返回当前已加载的命名空间列表。

自:2.80

gi_repository_get_n_infos

此函数返回给定命名空间 namespace_ 中的元数据条目数量。

自:2.80

gi_repository_get_object_gtype_interfaces

查找实现 gtype 的接口。

自:2.80

gi_repository_get_search_path

返回 GIRepository 在加载类型库文件时将使用的当前搜索路径。

自:2.80

gi_repository_get_shared_libraries

此函数返回与给定命名空间 namespace_ 关联的共享 C 库的路径数组。

自:2.80

gi_repository_get_typelib_path

如果命名空间 namespace_ 已加载,返回从其中加载的 .typelib 文件的完整路径。

自:2.80

gi_repository_get_version

此函数返回与给定命名空间 namespace_ 关联的已加载版本。

自:2.80

gi_repository_is_registered

检查特定命名空间(以及可选地,其特定版本)是否当前已加载。

自:2.80

gi_repository_load_typelib

将给定的 typelib 加载到仓库中。

自:2.80

gi_repository_prepend_library_path

directory 预先添加到用于搜索由导入的命名空间引用的共享库的搜索路径。

自:2.80

gi_repository_prepend_search_path

directory 预先添加到类型库搜索路径。

自:2.80

gi_repository_require

如果 namespace_ 没有加载,则强制加载命名空间。

自:2.80

gi_repository_require_private

如果 namespace_ 没有加载,则强制加载命名空间。

自:2.80

继承自 GObject 的方法(43)

请参阅 GObject 以获取方法列表的完整信息。

信号

GObject 继承的信号(1)
GObject::notify

当对象中的一个属性通过 g_object_set_property()、g_object_set() 等方式设置其值时,notify 信号将被触发。

类结构

struct GIRepositoryRepositoryClass {
  GObjectClass parent_class;
  
}

无描述信息。

类成员
parent_class: GObjectClass

无描述信息。