Browse Source

Made interface impls contain the interface as their original name-space.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/575/head
Dimitar Dobrev 10 years ago
parent
commit
4f574845fa
  1. 1
      src/AST/Declaration.cs
  2. 9
      src/Generator/Passes/MultipleInheritancePass.cs

1
src/AST/Declaration.cs

@ -328,6 +328,7 @@ namespace CppSharp.AST @@ -328,6 +328,7 @@ namespace CppSharp.AST
: this()
{
Namespace = declaration.Namespace;
OriginalNamespace = declaration.OriginalNamespace;
OriginalName = declaration.OriginalName;
name = declaration.Name;
Comment = declaration.Comment;

9
src/Generator/Passes/MultipleInheritancePass.cs

@ -199,7 +199,12 @@ namespace CppSharp.Passes @@ -199,7 +199,12 @@ namespace CppSharp.Passes
m.Parameters.SequenceEqual(method.Parameters.Where(p => !p.Ignore),
parameterTypeComparer)))
continue;
var impl = new Method(method) { Namespace = @class, OriginalFunction = method.OriginalFunction };
var impl = new Method(method)
{
Namespace = @class,
OriginalNamespace = @interface,
OriginalFunction = method.OriginalFunction
};
var rootBaseMethod = @class.GetBaseMethod(method, true);
if (rootBaseMethod != null && rootBaseMethod.IsDeclared)
impl.ExplicitInterfaceImpl = @interface;
@ -213,7 +218,7 @@ namespace CppSharp.Passes @@ -213,7 +218,7 @@ namespace CppSharp.Passes
{
foreach (var property in @interface.Properties.Where(p => p.Name != Helpers.InstanceIdentifier))
{
var impl = new Property(property) { Namespace = @class };
var impl = new Property(property) { Namespace = @class, OriginalNamespace = @interface };
var rootBaseProperty = @class.GetBaseProperty(property, true);
if (rootBaseProperty != null && rootBaseProperty.IsDeclared)
impl.ExplicitInterfaceImpl = @interface;

Loading…
Cancel
Save