KLibLoader Class Reference
The KLibLoader allows you to load libraries dynamically at runtime.
More...
#include <klibloader.h>
Inheritance diagram for KLibLoader:
[legend]Collaboration diagram for KLibLoader:
[legend]List of all members.
Detailed Description
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 <weis@kde.org>
Definition at line 142 of file klibloader.h.
Constructor & Destructor Documentation
|
You should NEVER destruct an instance of KLibLoader until you know what you are doing.
This will release the loaded libraries. Definition at line 319 of file klibloader.cpp.
References endl(). |
Member Function Documentation
KLibFactory * KLibLoader::factory |
( |
const char * |
libname |
) |
|
|
|
Loads and initializes a library.
Loading a library multiple times is handled gracefully.
This is a convenience function that returns the factory immediately - Parameters:
-
| 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 KLibFactory, or 0 if the library does not exist or it does not have a factory
- See also:
- library
Definition at line 479 of file klibloader.cpp.
References KLibrary::factory(), and library(). |
KLibrary * KLibLoader::library |
( |
const char * |
libname |
) |
[virtual] |
|
|
Loads and initializes a library.
Loading a library multiple times is handled gracefully.
- Parameters:
-
| 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
Definition at line 393 of file klibloader.cpp.
References endl(), and findLibrary().
Referenced by factory(), and globalLibrary(). |
KLibrary * KLibLoader::globalLibrary |
( |
const char * |
name |
) |
|
|
|
Loads and initializes a library.
Loading a library multiple times is handled gracefully. The library is loaded such that the symbols are globally accessible so libraries with dependencies can be loaded sequentially.
- Parameters:
-
| name | 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:
- KLibrariy 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
Definition at line 377 of file klibloader.cpp.
References endl(), and library(). |
void KLibLoader::unloadLibrary |
( |
const char * |
libname |
) |
[virtual] |
|
|
Unloads the library with the given name.
- Parameters:
-
| 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. Definition at line 462 of file klibloader.cpp.
Referenced by KLibrary::unload(). |
QString KLibLoader::findLibrary |
( |
const char * |
name, |
|
|
const KInstance * |
instance = KGlobal::instance() |
|
) |
[static] |
|
|
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. - Parameters:
-
| name | 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. |
| instance | a KInstance used to get the standard paths |
Definition at line 352 of file klibloader.cpp.
References KInstance::dirs(), endl(), and KStandardDirs::findResource().
Referenced by library(). |
The documentation for this class was generated from the following files:
This file is part of the documentation for kdecore Library Version 3.3.1.