Browse Source

Fixed generation of nested declarations in classes (part 2).

pull/68/merge
triton 12 years ago
parent
commit
79d8528625
  1. 10
      src/Generator/Generators/CLI/CLISourcesTemplate.cs

10
src/Generator/Generators/CLI/CLISourcesTemplate.cs

@ -44,7 +44,7 @@ namespace CppSharp.Generators.CLI @@ -44,7 +44,7 @@ namespace CppSharp.Generators.CLI
NewLine();
PopBlock();
GenerateNamespace(TranslationUnit);
GenerateDeclContext(TranslationUnit);
PushBlock(BlockKind.Footer);
PopBlock();
@ -75,7 +75,7 @@ namespace CppSharp.Generators.CLI @@ -75,7 +75,7 @@ namespace CppSharp.Generators.CLI
PopBlock();
}
private void GenerateNamespace(Namespace @namespace)
private void GenerateDeclContext(DeclarationContext @namespace)
{
PushBlock(CLIBlockKind.Namespace);
foreach (var @class in @namespace.Classes)
@ -103,7 +103,7 @@ namespace CppSharp.Generators.CLI @@ -103,7 +103,7 @@ namespace CppSharp.Generators.CLI
}
foreach(var childNamespace in @namespace.Namespaces)
GenerateNamespace(childNamespace);
GenerateDeclContext(childNamespace);
PopBlock();
}
@ -112,6 +112,8 @@ namespace CppSharp.Generators.CLI @@ -112,6 +112,8 @@ namespace CppSharp.Generators.CLI
{
PushBlock(CLIBlockKind.Class);
GenerateDeclContext(@class);
// Output a default constructor that takes the native pointer.
GenerateClassConstructor(@class, isIntPtr: false);
GenerateClassConstructor(@class, isIntPtr: true);
@ -690,7 +692,7 @@ namespace CppSharp.Generators.CLI @@ -690,7 +692,7 @@ namespace CppSharp.Generators.CLI
}
}
public void GenerateFunction(Function function, Namespace @namespace)
public void GenerateFunction(Function function, DeclarationContext @namespace)
{
if (function.Ignore)
return;

Loading…
Cancel
Save