Last update July 10, 2004

Dwith Swig /
Modifications



  • Remove some places where type "char*" was replaced by "string". I have retained "char*".
  • Add a means to put extra lines "import Classname;" into the D files for individual classes.
This is done using the SWIG %pragma(language) command. I have implemented that in the form of

%pragma(dmd) classimports="import classfilename;"

where classfilename will normally be the word class followed by the name of the class (.d is NOT needed).

  • I have also solved the resulting problem of the name of the class file (see /Problem).
  • Add a means of dealing with the things which SWIG deos not understand e.g. pointers. These are wrapped by SWIG in objects of name e.g. SWIGTYPE_p_uint which wraps a pointer to C++ type uint. For D this results in a class object of the same name SWIGTYPE_p_uint. The previous action was to put this in a file SWIGTYPE_p_uint.d. I have modified this to be classSWIGTYPE_p_uint.d for the same reason in the previous change.
  • Functions not in a class.
SWIG support a module command which names the output module. Any functions not in a class will be wrapped by D code in a file with the name of the module. If any of these functions make use of objects of any of the classes elsewhere in the wrapping operation, which is likely, the class files will also need to be imported to the module file. This is done with the command

%pragma(dmd) moduleimports="import classname;"

where classfilename will normally be the word class followed by the name of the class (.d is NOT needed).


FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: July 10, 2004 0:10 (diff))