class KLibLoader |
|
|
The KLibLoader allows you to load libraries dynamically at runtime. Dependent libraries are loaded automatically. KLibLoader follows the singleton pattern. You can not create multiple instances. Use self() to get a pointer to the loader.
See also KLibrary
Author Torben Weis |
|
|
Returns a translated error message for componentLoadingError componentLoadingError - the error code, as returned in the "error" output parameter of createInstance. |
|
Loads and initializes a library. Loading a library multiple times is handled gracefully. This is a convenience function that returns the factory immediately libname - This is the library name without extension. Usually that is something like "libkspread". The function will then search for a file named "libkspread.la" in the KDE library paths. The *.la files are created by libtool and contain important information especially about the libraries dependencies on other shared libs. Loading a "libfoo.so" could not solve the dependencies problem. You can, however, give a library name ending in ".so" (or whatever is used on your platform), and the library will be loaded without resolving dependencies. Use with caution. Returns the KPluginFactory, or 0 if the library does not exist or it does not have a factory See also library |
|
Helper method which looks for a library in the standard paths ("module" and "lib" resources). Made public for code that doesn't use KLibLoader itself, but still wants to open modules. libname - of the library. If it is not a path, the function searches in the "module" and "lib" resources. If there is no extension, ".la" will be appended. cData - a KComponentData used to get the standard paths |
|
This template allows to load the specified library and ask the factory to create an instance of the given template type.
libraryName - The library to open parent - The parent object (see QObject constructor) args - A list of string arguments, passed to the factory and possibly to the component (see KPluginFactory) error - Returns A pointer to the newly created object or a null pointer if the factory was unable to create an object of the given type. Internal for KApplication . Do not use . |
|
Returns an error message that can be useful to debug the problem. Returns QString() if the last call to library() was successful. You can call this function more than once. The error message is only reset by a new call to library(). Returns the last error message, or QString() if there was no error |
|
Loads and initializes a library. Loading a library multiple times is handled gracefully.
libname - This is the library name without extension. Usually that is something like "libkspread". The function will then search for a file named "libkspread.la" in the KDE library paths. The *.la files are created by libtool and contain important information especially about the libraries dependencies on other shared libs. Loading a "libfoo.so" could not solve the dependencies problem. You can, however, give a library name ending in ".so" (or whatever is used on your platform), and the library will be loaded without resolving dependencies. Use with caution. Returns KLibrary is invalid (0) when the library couldn't be dlopened. in such a case you can retrieve the error message by calling KLibLoader.lastErrorMessage() See also factory |
|
Returns a pointer to the factory. Use this function to get an instance of KLibLoader. Returns a pointer to the loader. If no loader exists until now then one is created. |
|
Unloads the library with the given name. libname - This is the library name without extension. Usually that is something like "libkspread". The function will then search for a file named "libkspread.la" in the KDE library paths. The *.la files are created by libtool and contain important information especially about the libraries dependencies on other shared libs. Loading a "libfoo.so" could not solve the dependencies problem. You can, however, give a library name ending in ".so" (or whatever is used on your platform), and the library will be loaded without resolving dependencies. Use with caution. |
|
ErrNoLibrary | - | ||
ErrNoFactory | - | ||
ErrNoComponent | - | ||
ErrServiceProvidesNoLibrary | - | ||
ErrNoServiceFound | - |