How to use QPluginLoader to view methods inside library
-
Hi All,
I have created the library file libtest.so.
I need to view the classes and methods present inside library.
Is there any way to get those method names through QPluginLoader / QLibraryThanks,
Kamatchi -
There are ways to see, what a library exports.
If there is a way to reconstuct the object structure, I don't know.
Doping this via QPluginLoader / QLibrary is not possible.
Both are used to load libraries. QPluginLoader for plugins, QLibary in gerenal (QPluginLoader uses QLiabry internally).
With QLibarary, you can find methods in a lib, but not list them. -
If you look at the source code of QPluginLoader, it shows:
it loads a library with QLibrary
it resolves a specific function with QLibrary::resolve
it calls that function, which be definition returns a QObject pointer
If all this is compiled with RTTI, you can use RTTI functions to get the real class names
If the returned classes have correct Qt meta info, you can usethe QMetaInfo API to retreive class names. -
Not using pure Qt. Take a look at tools like nm (part of "binutils":http://www.gnu.org/software/binutils/).