[fpc-pascal]Mapping Object Pascal Classes to C++ Classes
olivier.coursiere at laposte.net
Thu Nov 14 02:00:29 CET 2002
>> Afaik you're one of the BeFPC people, right?
>Yeah, except I'm on hiatus from that project. There are two French
>up at the moment, and they are wrapping the API directly with a
>approach to that I started with. I want to wrap the API in a VCL/LCL
>using a flattened universal API. This will get picked up at some point
>new year. The groundwork is there, but I have to make it more generic.
I am one of the french guys ;-)
>The other guys have written a class mapper of sorts. I haven't really
>keeping up with them.
In fact, the class mapper is not yet finished.
Our tool is an automated C++ class flattener, but it is specifically
for the C++ API of BeOS :
- no C++ exception
- no template
- few multi-inheritance
- support of hooks to answer to system events (optional and maybe a
It should also work on other systems if your API respect the above
(with some minor change i think).
We have a proof of concept tool that generate the C/C++ part of the
This tool is based on stubgen and is written in C.
Curently, i am writing a new tool (codegen) that will also generate the
How it works :
codegen use a XML description of the header and a basic typmap file.
It will generate pascal and C/C++ glue code.
It use the "flat" way, but it also generate a pascal class to wrap C
(each C++ classe will have a corresponding pascal one)
The XML description is generated with headertoxml. This tool use the
stubgen parser in a shared object (stubgen.so). I pack stubgen in
a shared object to write most of the code in pascal.
More informations (sources) at
in those directories :
>Supporting FPC would be cool too.
This is in my TODO's list too but i have no time yet because of the
More information about the fpc-pascal