Browse Source

Reworked the CLI headers enum generation to use blocks.

pull/34/merge
triton 12 years ago
parent
commit
2df3d0d260
  1. 11
      src/Generator/Generators/CLI/CLIHeadersTemplate.cs

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

@ -578,12 +578,19 @@ namespace CppSharp.Generators.CLI @@ -578,12 +578,19 @@ namespace CppSharp.Generators.CLI
if (@enum.Ignore || @enum.IsIncomplete)
return;
PushBlock(CLIBlockKind.Enum, @enum);
GenerateDeclarationCommon(@enum);
if (@enum.Modifiers.HasFlag(Enumeration.EnumModifiers.Flags))
WriteLine("[System::Flags]");
Write("public enum struct {0}", SafeIdentifier(@enum.Name));
// A nested class cannot have an assembly access specifier as part
// of its declaration.
if (@enum.Namespace is Namespace)
Write("public ");
Write("enum struct {0}", SafeIdentifier(@enum.Name));
var typeName = TypePrinter.VisitPrimitiveType(@enum.BuiltinType.Type,
new TypeQualifiers());
@ -613,6 +620,8 @@ namespace CppSharp.Generators.CLI @@ -613,6 +620,8 @@ namespace CppSharp.Generators.CLI
NewLine();
WriteLine("};");
PopBlock(NewLineKind.BeforeNextBlock);
}
}
}

Loading…
Cancel
Save