From ef53ca17d33e803e4b6b301f86b2988b57c41f20 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Fri, 20 Sep 2013 18:40:29 +0300 Subject: [PATCH] Added a block kind for an interface. Signed-off-by: Dimitar Dobrev --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 486994b5..4f0c7b3c 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -92,6 +92,7 @@ namespace CppSharp.Generators.CSharp public const int Field = FIRST + 14; public const int VTableDelegate = FIRST + 16; public const int Region = FIRST + 17; + public const int Interface = FIRST + 18; } public class CSharpTextTemplate : Template @@ -363,7 +364,7 @@ namespace CppSharp.Generators.CSharp if (@class.Ignore || @class.IsIncomplete) return; - PushBlock(CSharpBlockKind.Class); + PushBlock(CSharpBlockKind.Interface); GenerateDeclarationCommon(@class); GenerateClassProlog(@class); @@ -385,8 +386,7 @@ namespace CppSharp.Generators.CSharp Write(FormatMethodParameters(method.Parameters)); - Write(");"); - NewLine(); + WriteLine(");"); PopBlock(NewLineKind.BeforeNextBlock); } @@ -987,6 +987,7 @@ namespace CppSharp.Generators.CSharp { PushBlock(CSharpBlockKind.Property); var type = prop.Type; + // if it's an indexer that returns an address use the real type because there is a setter anyway if (prop.Parameters.Count > 0 && prop.Type.IsPointerToPrimitiveType()) type = ((PointerType) prop.Type).Pointee;