Browse Source

Allow the users to overwrite CppSharp type maps.

pull/983/merge
Franco Sinisi 5 years ago committed by João Matos
parent
commit
669596fc51
  1. 7
      src/Generator/Types/TypeMapDatabase.cs

7
src/Generator/Types/TypeMapDatabase.cs

@ -46,7 +46,12 @@ namespace CppSharp.Types @@ -46,7 +46,12 @@ namespace CppSharp.Types
var typeMap = (TypeMap) Activator.CreateInstance(type);
typeMap.Context = bindingContext;
typeMap.TypeMapDatabase = this;
this.TypeMaps[attr.Type] = typeMap;
// Custom types won't be overwritten by CppSharp ones.
if (!TypeMaps.ContainsKey(attr.Type))
{
TypeMaps.Add(attr.Type, typeMap);
}
}
}
}

Loading…
Cancel
Save