Browse Source

Fixed wrong indenting in output by using the block API for fields.

pull/169/head
triton 12 years ago
parent
commit
74007bedd1
  1. 5
      src/Generator/Generators/CLI/CLIHeadersTemplate.cs
  2. 1
      src/Generator/Generators/CLI/CLITextTemplate.cs

5
src/Generator/Generators/CLI/CLIHeadersTemplate.cs

@ -271,7 +271,6 @@ namespace CppSharp.Generators.CLI @@ -271,7 +271,6 @@ namespace CppSharp.Generators.CLI
if (@class.Fields.Any())
{
PushBlock(CLIBlockKind.AccessSpecifier);
NewLine();
WriteLine("private:");
PopBlock(NewLineKind.IfNotEmpty);
@ -436,11 +435,15 @@ namespace CppSharp.Generators.CLI @@ -436,11 +435,15 @@ namespace CppSharp.Generators.CLI
private void GenerateField(Class @class, Field field)
{
PushBlock(CLIBlockKind.Field, field);
GenerateDeclarationCommon(field);
if (@class.IsUnion)
WriteLine("[System::Runtime::InteropServices::FieldOffset({0})]",
field.Offset);
WriteLine("{0} {1};", field.Type, SafeIdentifier(field.Name));
PopBlock(NewLineKind.Never);
}
public void GenerateClassEvents(Class @class)

1
src/Generator/Generators/CLI/CLITextTemplate.cs

@ -47,6 +47,7 @@ namespace CppSharp.Generators.CLI @@ -47,6 +47,7 @@ namespace CppSharp.Generators.CLI
public static int Finalizer = BlockKind.LAST + 18;
public static int AccessSpecifier = BlockKind.LAST + 19;
public static int Fields = BlockKind.LAST + 20;
public static int Field = BlockKind.LAST + 21;
}
/// <summary>

Loading…
Cancel
Save