Browse Source

Merge pull request #173 from gpetrou/CppMarshalOption

Added default option to avoid generating ICppMarshal interface in the ou...
pull/186/head
João Matos 12 years ago
parent
commit
8c92be96f3
  1. 11
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  2. 2
      src/Generator/Options.cs

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

@ -370,7 +370,11 @@ namespace CppSharp.Generators.CSharp
PopBlock(NewLineKind.BeforeNextBlock); PopBlock(NewLineKind.BeforeNextBlock);
} }
GenerateClassMarshals(@class); if (Options.GenerateClassMarshals)
{
GenerateClassMarshals(@class);
}
GenerateClassConstructors(@class); GenerateClassConstructors(@class);
if (@class.IsUnion) if (@class.IsUnion)
@ -776,7 +780,10 @@ namespace CppSharp.Generators.CSharp
if (@class.IsRefType) if (@class.IsRefType)
bases.Add("IDisposable"); bases.Add("IDisposable");
bases.Add("CppSharp.Runtime.ICppMarshal"); if (Options.GenerateClassMarshals)
{
bases.Add("CppSharp.Runtime.ICppMarshal");
}
if (bases.Count > 0) if (bases.Count > 0)
Write(" : {0}", string.Join(", ", bases)); Write(" : {0}", string.Join(", ", bases));

2
src/Generator/Options.cs

@ -37,6 +37,7 @@ namespace CppSharp
GeneratorKind = GeneratorKind.CSharp; GeneratorKind = GeneratorKind.CSharp;
GenerateLibraryNamespace = true; GenerateLibraryNamespace = true;
GeneratePartialClasses = true; GeneratePartialClasses = true;
GenerateClassMarshals = false;
OutputInteropIncludes = true; OutputInteropIncludes = true;
MaxIndent = 80; MaxIndent = 80;
CommentPrefix = "///"; CommentPrefix = "///";
@ -94,6 +95,7 @@ namespace CppSharp
public bool GenerateInterfacesForMultipleInheritance; public bool GenerateInterfacesForMultipleInheritance;
public bool GenerateProperties; public bool GenerateProperties;
public bool GenerateInternalImports; public bool GenerateInternalImports;
public bool GenerateClassMarshals;
/// <summary> /// <summary>
/// Enable this option to enable generation of finalizers. /// Enable this option to enable generation of finalizers.

Loading…
Cancel
Save