I am using swig 4.0.x to wrap a c++ file.
Everything is working fine except I want to change the accessibility of the generated C# classes from public class to internal class.
So far what I have tried is this: In swig interface file
%module example
%{
#include "include/exampleapi.h"
%}
%typemap(csclassmodifiers) SWIGTYPE "internal class"
%pragma(csharp) moduleclassmodifiers="internal class"
%include <windows.i>
%include "include/exampleapi.h"
The above code seems to work for the module class (example) and some other files. But it is not changing the accessibility modifier of all the generated classes.
Particularly, classes whose name starts with public class SWIGTYPE_xxx (probably known as proxy classes? These classes contain internal members and have a private member with type private global::System.Runtime.InteropServices.HandleRef) .
How do I make them internal class?