class KLibrary

Represents a dynamically loaded library. More...

Definition#include <klibloader.h>
InheritsQObject (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

KLibrary allows you to look up symbols of the shared library.

 KLibrary ( const QString& libname, const QString& filename, void * handle )

KLibrary

Don't create KLibrary objects on your own. Instead use KLibLoader.

QString  name ()

name

[const]

Returns the name of the library.

Returns: The name of the library like "libkspread".

QString  fileName ()

fileName

[const]

Returns the file name of the library.

Returns: The filename of the library, for example "/opt/kde2&/lib/libkspread.la"

KLibFactory*  factory ()

factory

Returns the factory of the library.

Returns: The factory of the library if there is any, otherwise 0

void*  symbol ( const char* name )

symbol

[const]

Looks up a symbol from the library. This is a very low level function that you usually don't want to use. Usually you should check using hasSymbol() whether the symbol actually exists, otherwise a warning will be printed.

Parameters:
namethe name of the symbol to look up

Returns: the address of the symbol, or 0 if it does not exist

See also: hasSymbol

bool  hasSymbol ( const char* name )

hasSymbol

[const]

Looks up a symbol from the library. This is a very low level function that you usually don't want to use. Unlike symbol(), this method doesn't warn if the symbol doesn't exist, so if the symbol might or might not exist, better use hasSymbol() before symbol().

Parameters:
namethe name of the symbol to check

Returns: true if the symbol exists

void  unload ()

unload

[const]

Unloads the library. This typically results in the deletion of this object. You should not reference its pointer after calling this function.