Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- dump
- enumerateVersions
- errorQuark
- findByErrorDomain
- findByGtype
- findByName
- getCPrefix
- getDefault
- getDependencies
- getImmediateDependencies
- getInfo
- getLoadedNamespaces
- getNInfos
- getSearchPath
- getSharedLibrary
- getTypelibPath
- getVersion
- isRegistered
- loadTypelib
- prependLibraryPath
- prependSearchPath
- require
- requirePrivate
Repository
is used to manage repositories of namespaces. Namespaces
are represented on disk by type libraries (.typelib files).
- newtype Repository = Repository (ManagedPtr Repository)
- class GObject o => IsRepository o
- toRepository :: (MonadIO m, IsRepository o) => o -> m Repository
- noRepository :: Maybe Repository
- repositoryDump :: (HasCallStack, MonadIO m) => Text -> m ()
- repositoryEnumerateVersions :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m [Text]
- repositoryErrorQuark :: (HasCallStack, MonadIO m) => m Word32
- repositoryFindByErrorDomain :: (HasCallStack, MonadIO m, IsRepository a) => a -> Word32 -> m BaseInfo
- repositoryFindByGtype :: (HasCallStack, MonadIO m, IsRepository a) => a -> GType -> m BaseInfo
- repositoryFindByName :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> Text -> m BaseInfo
- repositoryGetCPrefix :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m Text
- repositoryGetDefault :: (HasCallStack, MonadIO m) => m Repository
- repositoryGetDependencies :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m [Text]
- repositoryGetImmediateDependencies :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m [Text]
- repositoryGetInfo :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> Int32 -> m BaseInfo
- repositoryGetLoadedNamespaces :: (HasCallStack, MonadIO m, IsRepository a) => a -> m [Text]
- repositoryGetNInfos :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m Int32
- repositoryGetSearchPath :: (HasCallStack, MonadIO m) => m [[Char]]
- repositoryGetSharedLibrary :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m Text
- repositoryGetTypelibPath :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m Text
- repositoryGetVersion :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m Text
- repositoryIsRegistered :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> Maybe Text -> m Bool
- repositoryLoadTypelib :: (HasCallStack, MonadIO m, IsRepository a) => a -> Typelib -> [RepositoryLoadFlags] -> m Text
- repositoryPrependLibraryPath :: (HasCallStack, MonadIO m) => Text -> m ()
- repositoryPrependSearchPath :: (HasCallStack, MonadIO m) => [Char] -> m ()
- repositoryRequire :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> Maybe Text -> [RepositoryLoadFlags] -> m Typelib
- repositoryRequirePrivate :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> Text -> Maybe Text -> [RepositoryLoadFlags] -> m Typelib
Exported types
newtype Repository Source #
class GObject o => IsRepository o Source #
toRepository :: (MonadIO m, IsRepository o) => o -> m Repository Source #
Methods
dump
:: (HasCallStack, MonadIO m) | |
=> Text | |
-> m () | (Can throw |
No description available in the introspection data.
enumerateVersions
repositoryEnumerateVersions Source #
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> m [Text] | Returns: the array of versions. |
Obtain an unordered list of versions (either currently loaded or
available) for namespace_
in this repository
.
errorQuark
repositoryErrorQuark :: (HasCallStack, MonadIO m) => m Word32 Source #
No description available in the introspection data.
findByErrorDomain
repositoryFindByErrorDomain Source #
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Word32 |
|
-> m BaseInfo | Returns: |
Searches for the enum type corresponding to the given GError
domain. Before calling this function for a particular namespace,
you must call repositoryRequire
once to load the namespace, or
otherwise ensure the namespace has already been loaded.
Since: 1.29.17
findByGtype
repositoryFindByGtype Source #
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> GType |
|
-> m BaseInfo | Returns: |
Searches all loaded namespaces for a particular GType
. Note that
in order to locate the metadata, the namespace corresponding to
the type must first have been loaded. There is currently no
mechanism for determining the namespace which corresponds to an
arbitrary GType - thus, this function will operate most reliably
when you know the GType to originate from be from a loaded namespace.
findByName
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m BaseInfo | Returns: |
Searches for a particular entry in a namespace. Before calling
this function for a particular namespace, you must call
repositoryRequire
once to load the namespace, or otherwise
ensure the namespace has already been loaded.
getCPrefix
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> m Text | Returns: C namespace prefix, or |
This function returns the "C prefix", or the C level namespace
associated with the given introspection namespace. Each C symbol
starts with this prefix, as well each GType
in the library.
Note: The namespace must have already been loaded using a function
such as repositoryRequire
before calling this function.
getDefault
:: (HasCallStack, MonadIO m) | |
=> m Repository | Returns: The global singleton |
Returns the singleton process-global default Repository
. It is
not currently supported to have multiple repositories in a
particular process, but this function is provided in the unlikely
eventuality that it would become possible, and as a convenience for
higher level language bindings to conform to the GObject method
call conventions.
All methods on Repository
also accept Nothing
as an instance
parameter to mean this default repository, which is usually more
convenient for C.
getDependencies
repositoryGetDependencies Source #
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> m [Text] | Returns: Zero-terminated string array of all versioned dependencies |
Return an array of all (transitive) versioned dependencies for
namespace_
. Returned strings are of the form
<code>namespace-version</code>.
Note: namespace_
must have already been loaded using a function
such as repositoryRequire
before calling this function.
To get only the immediate dependencies for namespace_
, use
repositoryGetImmediateDependencies
.
getImmediateDependencies
repositoryGetImmediateDependencies Source #
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> m [Text] | Returns: Zero-terminated string array of immediate versioned dependencies |
Return an array of the immediate versioned dependencies for namespace_
.
Returned strings are of the form <code>namespace-version</code>.
Note: namespace_
must have already been loaded using a function
such as repositoryRequire
before calling this function.
To get the transitive closure of dependencies for namespace_
, use
repositoryGetDependencies
.
Since: 1.44
getInfo
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> m BaseInfo | Returns: |
This function returns a particular metadata entry in the
given namespace namespace_
. The namespace must have
already been loaded before calling this function.
See repositoryGetNInfos
to find the maximum number of
entries.
getLoadedNamespaces
repositoryGetLoadedNamespaces Source #
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> m [Text] | Returns: List of namespaces |
Return the list of currently loaded namespaces.
getNInfos
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> m Int32 | Returns: number of metadata entries |
This function returns the number of metadata entries in
given namespace namespace_
. The namespace must have
already been loaded before calling this function.
getSearchPath
repositoryGetSearchPath Source #
:: (HasCallStack, MonadIO m) | |
=> m [[Char]] | Returns: |
Returns the current search path Repository
will use when loading
typelib files. The list is internal to GIRespository
and should not
be freed, nor should its string elements.
getSharedLibrary
repositoryGetSharedLibrary Source #
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> m Text | Returns: Comma-separated list of paths to shared libraries,
or |
This function returns a comma-separated list of paths to the
shared C libraries associated with the given namespace namespace_
.
There may be no shared library path associated, in which case this
function will return Nothing
.
Note: The namespace must have already been loaded using a function
such as repositoryRequire
before calling this function.
getTypelibPath
repositoryGetTypelibPath Source #
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> m Text | Returns: Filesystem path (or $lt;builtin$gt;) if successful, |
If namespace namespace_
is loaded, return the full path to the
.typelib file it was loaded from. If the typelib for
namespace namespace_
was included in a shared library, return
the special string "<builtin>".
getVersion
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> m Text | Returns: Loaded version |
This function returns the loaded version associated with the given
namespace namespace_
.
Note: The namespace must have already been loaded using a function
such as repositoryRequire
before calling this function.
isRegistered
repositoryIsRegistered Source #
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> Maybe Text |
|
-> m Bool | Returns: |
Check whether a particular namespace (and optionally, a specific
version thereof) is currently loaded. This function is likely to
only be useful in unusual circumstances; in order to act upon
metadata in the namespace, you should call repositoryRequire
instead which will ensure the namespace is loaded, and return as
quickly as this function will if it has already been loaded.
loadTypelib
repositoryLoadTypelib Source #
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Typelib |
|
-> [RepositoryLoadFlags] |
|
-> m Text | (Can throw |
TODO
prependLibraryPath
repositoryPrependLibraryPath :: (HasCallStack, MonadIO m) => Text -> m () Source #
No description available in the introspection data.
prependSearchPath
repositoryPrependSearchPath Source #
:: (HasCallStack, MonadIO m) | |
=> [Char] |
|
-> m () |
Prepends directory
to the typelib search path.
See repositoryGetSearchPath
.
require
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> Maybe Text |
|
-> [RepositoryLoadFlags] |
|
-> m Typelib | Returns: a pointer to the |
Force the namespace namespace_
to be loaded if it isn't already.
If namespace_
is not loaded, this function will search for a
".typelib" file using the repository search path. In addition, a
version version
of namespace may be specified. If version
is
not specified, the latest will be used.
requirePrivate
repositoryRequirePrivate Source #
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> Maybe Text |
|
-> [RepositoryLoadFlags] |
|
-> m Typelib | Returns: a pointer to the |
Force the namespace namespace_
to be loaded if it isn't already.
If namespace_
is not loaded, this function will search for a
".typelib" file within the private directory only. In addition, a
version version
of namespace should be specified. If version
is
not specified, the latest will be used.