org.kde.koala

Class KLibLoader

public class KLibLoader extends QObject

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.

Author: Torben Weis

See Also: KLibrary

UNKNOWN: The KLibLoader allows you to load libraries dynamically at runtime.

Constructor Summary
protected KLibLoader(Class dummy)
KLibLoader(QObject parent, String name)
KLibLoader(QObject parent)
KLibLoader()
Method Summary
StringclassName()
static voidcleanUp()
Internal Method, called by the KApplication destructor.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
KLibFactoryfactory(String libname)
Loads and initializes a library.
protected voidfinalize()
Deletes the wrapped C++ instance
static StringfindLibrary(String name, KInstanceInterface instance)
Helper method which looks for a library in the standard paths ("module" and "lib" resources).
static StringfindLibrary(String name)
booleanisDisposed()
Has the wrapped C++ instance been deleted?
StringlastErrorMessage()
Returns an error message that can be useful to debug the problem.
QMetaObjectmetaObject()
static KLibLoaderself()
Returns a pointer to the factory.
voidunloadLibrary(String libname)
Unloads the library with the given name.

Constructor Detail

KLibLoader

protected KLibLoader(Class dummy)

KLibLoader

public KLibLoader(QObject parent, String name)

KLibLoader

public KLibLoader(QObject parent)

KLibLoader

public KLibLoader()

Method Detail

className

public String className()

cleanUp

public static void cleanUp()
Internal Method, called by the KApplication destructor. Do not call it. This is what makes it possible to rely on ~KLibFactory being called in all cases, whether the library is unloaded while the application is running or when exiting.

UNKNOWN:

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

factory

public KLibFactory factory(String 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: KLibLoader

UNKNOWN: Loads and initializes a library.

finalize

protected void finalize()
Deletes the wrapped C++ instance

findLibrary

public static String findLibrary(String name, KInstanceInterface instance)
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

UNKNOWN: Helper method which looks for a library in the standard paths ("module" and "lib" resources).

findLibrary

public static String findLibrary(String name)

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

lastErrorMessage

public String lastErrorMessage()
Returns an error message that can be useful to debug the problem. Returns null 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 null if there was no error

UNKNOWN: Returns an error message that can be useful to debug the problem.

metaObject

public QMetaObject metaObject()

self

public static KLibLoader self()
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.

UNKNOWN: Returns a pointer to the factory.

unloadLibrary

public void unloadLibrary(String libname)
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.

UNKNOWN: Unloads the library with the given name.