Friday, March 1, 2013

Xml file generation almost done

This week I improved the XML generation code (the resulting files are .api - the same as the old OccWrapper.api file) and the conversion program to:
* have better output for the templates
* convert types
* merge all generated files per package (will merge into one file eventually, but it's easier to check everything if they're split)
* add IsRef attributes
* parse methods and transform them into properties, with the corresponding XML attributes and children
* handle static methods and properties

With these changes, the NaroHost program doesn't need any changes - the .api file that it receives as input is correctly formatted and it can generate all the files as before. I've also created a little program that compares the files NaroHost generates using the old and new .api files (for now only the resulting .cs files) - since the new .api files cover all OpenCASCADE methods and classes, we have extra methods and new files and a regular line by line comparison wouldn't work. My tool splits the file in methods and DllImports and compares these, and for the .gp package, the results are good, with only two types of differences:
* the old code generated only getters or setters for some properties and the new one sometimes generates both. I will need to refine the code to cover these cases, as well
* empty Constructors were added when the old .xml file didn't have any parameterless constructors. If the new one adds constructors with no parameters, those aren't added anymore

The time needed run OCWrappersExt, the conversion program and NaroHost is under 10 minutes.

On Monday I will continue checking the .cpp and .h files and check the other packages.

No comments: