Browse Source

Added a block kind for an interface.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/68/head
Dimitar Dobrev 13 years ago
parent
commit
ef53ca17d3
  1. 7
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

7
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -92,6 +92,7 @@ namespace CppSharp.Generators.CSharp
public const int Field = FIRST + 14; public const int Field = FIRST + 14;
public const int VTableDelegate = FIRST + 16; public const int VTableDelegate = FIRST + 16;
public const int Region = FIRST + 17; public const int Region = FIRST + 17;
public const int Interface = FIRST + 18;
} }
public class CSharpTextTemplate : Template public class CSharpTextTemplate : Template
@ -363,7 +364,7 @@ namespace CppSharp.Generators.CSharp
if (@class.Ignore || @class.IsIncomplete) if (@class.Ignore || @class.IsIncomplete)
return; return;
PushBlock(CSharpBlockKind.Class); PushBlock(CSharpBlockKind.Interface);
GenerateDeclarationCommon(@class); GenerateDeclarationCommon(@class);
GenerateClassProlog(@class); GenerateClassProlog(@class);
@ -385,8 +386,7 @@ namespace CppSharp.Generators.CSharp
Write(FormatMethodParameters(method.Parameters)); Write(FormatMethodParameters(method.Parameters));
Write(");"); WriteLine(");");
NewLine();
PopBlock(NewLineKind.BeforeNextBlock); PopBlock(NewLineKind.BeforeNextBlock);
} }
@ -987,6 +987,7 @@ namespace CppSharp.Generators.CSharp
{ {
PushBlock(CSharpBlockKind.Property); PushBlock(CSharpBlockKind.Property);
var type = prop.Type; 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()) if (prop.Parameters.Count > 0 && prop.Type.IsPointerToPrimitiveType())
type = ((PointerType) prop.Type).Pointee; type = ((PointerType) prop.Type).Pointee;

Loading…
Cancel
Save