From 6ef578cd6a961fb75c3f461c12244b92480928b7 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Thu, 19 Sep 2013 19:39:36 +0300 Subject: [PATCH] Removed the generation of protected members of interfaces. Signed-off-by: Dimitar Dobrev --- src/Generator/Driver.cs | 2 +- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Generator/Driver.cs b/src/Generator/Driver.cs index afe02b60..c16252d1 100644 --- a/src/Generator/Driver.cs +++ b/src/Generator/Driver.cs @@ -144,7 +144,6 @@ namespace CppSharp TranslationUnitPasses.AddPass(new CheckAmbiguousFunctions()); TranslationUnitPasses.AddPass(new CheckOperatorsOverloadsPass()); TranslationUnitPasses.AddPass(new CheckVirtualOverrideReturnCovariance()); - TranslationUnitPasses.AddPass(new MultipleInheritancePass()); Generator.SetupPasses(); TranslationUnitPasses.AddPass(new FieldToPropertyPass()); @@ -154,6 +153,7 @@ namespace CppSharp TranslationUnitPasses.AddPass(new CheckDuplicatedNamesPass()); if (Options.GenerateAbstractImpls) TranslationUnitPasses.AddPass(new GenerateAbstractImplementationsPass()); + TranslationUnitPasses.AddPass(new MultipleInheritancePass()); } public void ProcessCode() diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index b12af4bd..57c6bb7a 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -387,7 +387,8 @@ namespace CppSharp.Generators.CSharp GenerateDeclContext(@class); - foreach (var method in @class.Methods.Where(m => !ASTUtils.CheckIgnoreMethod(m))) + foreach (var method in @class.Methods.Where(m => !ASTUtils.CheckIgnoreMethod(m) && + m.Access == AccessSpecifier.Public)) { PushBlock(CSharpBlockKind.Method); GenerateDeclarationCommon(method); @@ -1034,7 +1035,7 @@ namespace CppSharp.Generators.CSharp private string GetPropertyName(Property prop) { return prop.Parameters.Count == 0 ? SafeIdentifier(prop.Name) - : string.Format("this[{0}]", this.FormatMethodParameters(prop.Parameters)); + : string.Format("this[{0}]", FormatMethodParameters(prop.Parameters)); } private void GenerateVariable(Class @class, Type type, Variable variable) @@ -1627,8 +1628,7 @@ namespace CppSharp.Generators.CSharp if (Driver.Options.GenerateAbstractImpls && method.IsPure) Write("abstract "); - var functionName = method.IsOperator ? - Operators.GetOperatorIdentifier(method.OperatorKind) : method.Name; + var functionName = GetFunctionIdentifier(method); if (method.IsConstructor || method.IsDestructor) Write("{0}(", functionName);