c2cs
c2cs copied to clipboard
Ability to remap pointer types
Currently remapping is only evaluated on element types (e.g. remapping someType will apply the same remapping to someType*)
Allow defining remapping of pointer types separately from element type.
This can be particularly useful for safe pointer management in C#. A common use case would be to remap someType* to a class inheriting SafeHandle (e.g. SomeTypeHandle : SafeHandle) that the user defines for managing the pointer.
Secondary improvement here - prioritize user remappings to defaults. Some types are default remapped ((char* to CString for example). If a user defines a different remapping from this, it should prefer the user's remapping.
Makes sense; sounds like this would go well with the idea of trying to work on right now: C# plugin. Use a C# library to control generating C# code rather than a config file. This would help with automating custom wrappers as custom C# code can be written to help transform the bindings into a desired wrapper.
I found a way forward to implement this. It requires some major refactoring however... I'll be working on it when I can.