Browse Source

Merge pull request #355 from ddobrev/master

Removed redundant "new" key-words in generated C# code
pull/356/head
João Matos 11 years ago
parent
commit
a1e5b36f6c
  1. 10
      src/AST/Class.cs
  2. 34
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs
  3. 8
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs
  4. 2
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Sources.cs
  5. 2
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs
  6. 34
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs
  7. 8
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs
  8. 2
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Sources.cs
  9. 2
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs
  10. 34
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs
  11. 8
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs
  12. 2
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Sources.cs
  13. 2
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs
  14. 10
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

10
src/AST/Class.cs

@ -161,6 +161,16 @@ namespace CppSharp.AST @@ -161,6 +161,16 @@ namespace CppSharp.AST
}
}
public bool HasGeneratedBase
{
get
{
return HasBaseClass && !IsValueType
&& !Bases[0].Class.IsValueType
&& Bases[0].Class.IsGenerated;
}
}
public Class OriginalClass { get; set; }
public bool IsValueType

34
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs

@ -251,7 +251,7 @@ namespace CppSharp @@ -251,7 +251,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Type __CreateInstance(global::System.IntPtr native)
public static Type __CreateInstance(global::System.IntPtr native)
{
return new Type((Type.Internal*) native);
}
@ -351,7 +351,7 @@ namespace CppSharp @@ -351,7 +351,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new TypeQualifiers __CreateInstance(global::System.IntPtr native)
public static TypeQualifiers __CreateInstance(global::System.IntPtr native)
{
return new TypeQualifiers((TypeQualifiers.Internal*) native);
}
@ -466,7 +466,7 @@ namespace CppSharp @@ -466,7 +466,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new QualifiedType __CreateInstance(global::System.IntPtr native)
public static QualifiedType __CreateInstance(global::System.IntPtr native)
{
return new QualifiedType((QualifiedType.Internal*) native);
}
@ -1443,7 +1443,7 @@ namespace CppSharp @@ -1443,7 +1443,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new TemplateArgument __CreateInstance(global::System.IntPtr native)
public static TemplateArgument __CreateInstance(global::System.IntPtr native)
{
return new TemplateArgument((TemplateArgument.Internal*) native);
}
@ -1745,7 +1745,7 @@ namespace CppSharp @@ -1745,7 +1745,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new TemplateParameter __CreateInstance(global::System.IntPtr native)
public static TemplateParameter __CreateInstance(global::System.IntPtr native)
{
return new TemplateParameter((TemplateParameter.Internal*) native);
}
@ -2404,7 +2404,7 @@ namespace CppSharp @@ -2404,7 +2404,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new VTableComponent __CreateInstance(global::System.IntPtr native)
public static VTableComponent __CreateInstance(global::System.IntPtr native)
{
return new VTableComponent((VTableComponent.Internal*) native);
}
@ -2539,7 +2539,7 @@ namespace CppSharp @@ -2539,7 +2539,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new VTableLayout __CreateInstance(global::System.IntPtr native)
public static VTableLayout __CreateInstance(global::System.IntPtr native)
{
return new VTableLayout((VTableLayout.Internal*) native);
}
@ -2649,7 +2649,7 @@ namespace CppSharp @@ -2649,7 +2649,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new VFTableInfo __CreateInstance(global::System.IntPtr native)
public static VFTableInfo __CreateInstance(global::System.IntPtr native)
{
return new VFTableInfo((VFTableInfo.Internal*) native);
}
@ -2821,7 +2821,7 @@ namespace CppSharp @@ -2821,7 +2821,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ClassLayout __CreateInstance(global::System.IntPtr native)
public static ClassLayout __CreateInstance(global::System.IntPtr native)
{
return new ClassLayout((ClassLayout.Internal*) native);
}
@ -3094,7 +3094,7 @@ namespace CppSharp @@ -3094,7 +3094,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Declaration __CreateInstance(global::System.IntPtr native)
public static Declaration __CreateInstance(global::System.IntPtr native)
{
return new Declaration((Declaration.Internal*) native);
}
@ -3942,7 +3942,7 @@ namespace CppSharp @@ -3942,7 +3942,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Statement __CreateInstance(global::System.IntPtr native)
public static Statement __CreateInstance(global::System.IntPtr native)
{
return new Statement((Statement.Internal*) native);
}
@ -5497,7 +5497,7 @@ namespace CppSharp @@ -5497,7 +5497,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new BaseClassSpecifier __CreateInstance(global::System.IntPtr native)
public static BaseClassSpecifier __CreateInstance(global::System.IntPtr native)
{
return new BaseClassSpecifier((BaseClassSpecifier.Internal*) native);
}
@ -7152,7 +7152,7 @@ namespace CppSharp @@ -7152,7 +7152,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native)
public static FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native)
{
return new FunctionTemplateSpecialization((FunctionTemplateSpecialization.Internal*) native);
}
@ -8033,7 +8033,7 @@ namespace CppSharp @@ -8033,7 +8033,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new NativeLibrary __CreateInstance(global::System.IntPtr native)
public static NativeLibrary __CreateInstance(global::System.IntPtr native)
{
return new NativeLibrary((NativeLibrary.Internal*) native);
}
@ -8212,7 +8212,7 @@ namespace CppSharp @@ -8212,7 +8212,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ASTContext __CreateInstance(global::System.IntPtr native)
public static ASTContext __CreateInstance(global::System.IntPtr native)
{
return new ASTContext((ASTContext.Internal*) native);
}
@ -8308,7 +8308,7 @@ namespace CppSharp @@ -8308,7 +8308,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Comment __CreateInstance(global::System.IntPtr native)
public static Comment __CreateInstance(global::System.IntPtr native)
{
return new Comment((Comment.Internal*) native);
}
@ -8482,7 +8482,7 @@ namespace CppSharp @@ -8482,7 +8482,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new RawComment __CreateInstance(global::System.IntPtr native)
public static RawComment __CreateInstance(global::System.IntPtr native)
{
return new RawComment((RawComment.Internal*) native);
}

8
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs

@ -234,7 +234,7 @@ namespace CppSharp @@ -234,7 +234,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserOptions __CreateInstance(global::System.IntPtr native)
public static ParserOptions __CreateInstance(global::System.IntPtr native)
{
return new ParserOptions((ParserOptions.Internal*) native);
}
@ -656,7 +656,7 @@ namespace CppSharp @@ -656,7 +656,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserDiagnostic __CreateInstance(global::System.IntPtr native)
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native)
{
return new ParserDiagnostic((ParserDiagnostic.Internal*) native);
}
@ -838,7 +838,7 @@ namespace CppSharp @@ -838,7 +838,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserResult __CreateInstance(global::System.IntPtr native)
public static ParserResult __CreateInstance(global::System.IntPtr native)
{
return new ParserResult((ParserResult.Internal*) native);
}
@ -986,7 +986,7 @@ namespace CppSharp @@ -986,7 +986,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ClangParser __CreateInstance(global::System.IntPtr native)
public static ClangParser __CreateInstance(global::System.IntPtr native)
{
return new ClangParser((ClangParser.Internal*) native);
}

2
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Sources.cs

@ -34,7 +34,7 @@ namespace CppSharp @@ -34,7 +34,7 @@ namespace CppSharp
internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
}
public static new SourceLocation __CreateInstance(global::System.IntPtr native)
public static SourceLocation __CreateInstance(global::System.IntPtr native)
{
return new SourceLocation((SourceLocation.Internal*) native);
}

2
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs

@ -174,7 +174,7 @@ namespace CppSharp @@ -174,7 +174,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserTargetInfo __CreateInstance(global::System.IntPtr native)
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native)
{
return new ParserTargetInfo((ParserTargetInfo.Internal*) native);
}

34
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs

@ -251,7 +251,7 @@ namespace CppSharp @@ -251,7 +251,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Type __CreateInstance(global::System.IntPtr native)
public static Type __CreateInstance(global::System.IntPtr native)
{
return new Type((Type.Internal*) native);
}
@ -351,7 +351,7 @@ namespace CppSharp @@ -351,7 +351,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new TypeQualifiers __CreateInstance(global::System.IntPtr native)
public static TypeQualifiers __CreateInstance(global::System.IntPtr native)
{
return new TypeQualifiers((TypeQualifiers.Internal*) native);
}
@ -466,7 +466,7 @@ namespace CppSharp @@ -466,7 +466,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new QualifiedType __CreateInstance(global::System.IntPtr native)
public static QualifiedType __CreateInstance(global::System.IntPtr native)
{
return new QualifiedType((QualifiedType.Internal*) native);
}
@ -1443,7 +1443,7 @@ namespace CppSharp @@ -1443,7 +1443,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new TemplateArgument __CreateInstance(global::System.IntPtr native)
public static TemplateArgument __CreateInstance(global::System.IntPtr native)
{
return new TemplateArgument((TemplateArgument.Internal*) native);
}
@ -1745,7 +1745,7 @@ namespace CppSharp @@ -1745,7 +1745,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new TemplateParameter __CreateInstance(global::System.IntPtr native)
public static TemplateParameter __CreateInstance(global::System.IntPtr native)
{
return new TemplateParameter((TemplateParameter.Internal*) native);
}
@ -2404,7 +2404,7 @@ namespace CppSharp @@ -2404,7 +2404,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new VTableComponent __CreateInstance(global::System.IntPtr native)
public static VTableComponent __CreateInstance(global::System.IntPtr native)
{
return new VTableComponent((VTableComponent.Internal*) native);
}
@ -2539,7 +2539,7 @@ namespace CppSharp @@ -2539,7 +2539,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new VTableLayout __CreateInstance(global::System.IntPtr native)
public static VTableLayout __CreateInstance(global::System.IntPtr native)
{
return new VTableLayout((VTableLayout.Internal*) native);
}
@ -2649,7 +2649,7 @@ namespace CppSharp @@ -2649,7 +2649,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new VFTableInfo __CreateInstance(global::System.IntPtr native)
public static VFTableInfo __CreateInstance(global::System.IntPtr native)
{
return new VFTableInfo((VFTableInfo.Internal*) native);
}
@ -2821,7 +2821,7 @@ namespace CppSharp @@ -2821,7 +2821,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ClassLayout __CreateInstance(global::System.IntPtr native)
public static ClassLayout __CreateInstance(global::System.IntPtr native)
{
return new ClassLayout((ClassLayout.Internal*) native);
}
@ -3094,7 +3094,7 @@ namespace CppSharp @@ -3094,7 +3094,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Declaration __CreateInstance(global::System.IntPtr native)
public static Declaration __CreateInstance(global::System.IntPtr native)
{
return new Declaration((Declaration.Internal*) native);
}
@ -3942,7 +3942,7 @@ namespace CppSharp @@ -3942,7 +3942,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Statement __CreateInstance(global::System.IntPtr native)
public static Statement __CreateInstance(global::System.IntPtr native)
{
return new Statement((Statement.Internal*) native);
}
@ -5497,7 +5497,7 @@ namespace CppSharp @@ -5497,7 +5497,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new BaseClassSpecifier __CreateInstance(global::System.IntPtr native)
public static BaseClassSpecifier __CreateInstance(global::System.IntPtr native)
{
return new BaseClassSpecifier((BaseClassSpecifier.Internal*) native);
}
@ -7152,7 +7152,7 @@ namespace CppSharp @@ -7152,7 +7152,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native)
public static FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native)
{
return new FunctionTemplateSpecialization((FunctionTemplateSpecialization.Internal*) native);
}
@ -8033,7 +8033,7 @@ namespace CppSharp @@ -8033,7 +8033,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new NativeLibrary __CreateInstance(global::System.IntPtr native)
public static NativeLibrary __CreateInstance(global::System.IntPtr native)
{
return new NativeLibrary((NativeLibrary.Internal*) native);
}
@ -8212,7 +8212,7 @@ namespace CppSharp @@ -8212,7 +8212,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ASTContext __CreateInstance(global::System.IntPtr native)
public static ASTContext __CreateInstance(global::System.IntPtr native)
{
return new ASTContext((ASTContext.Internal*) native);
}
@ -8308,7 +8308,7 @@ namespace CppSharp @@ -8308,7 +8308,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Comment __CreateInstance(global::System.IntPtr native)
public static Comment __CreateInstance(global::System.IntPtr native)
{
return new Comment((Comment.Internal*) native);
}
@ -8482,7 +8482,7 @@ namespace CppSharp @@ -8482,7 +8482,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new RawComment __CreateInstance(global::System.IntPtr native)
public static RawComment __CreateInstance(global::System.IntPtr native)
{
return new RawComment((RawComment.Internal*) native);
}

8
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs

@ -234,7 +234,7 @@ namespace CppSharp @@ -234,7 +234,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserOptions __CreateInstance(global::System.IntPtr native)
public static ParserOptions __CreateInstance(global::System.IntPtr native)
{
return new ParserOptions((ParserOptions.Internal*) native);
}
@ -656,7 +656,7 @@ namespace CppSharp @@ -656,7 +656,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserDiagnostic __CreateInstance(global::System.IntPtr native)
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native)
{
return new ParserDiagnostic((ParserDiagnostic.Internal*) native);
}
@ -838,7 +838,7 @@ namespace CppSharp @@ -838,7 +838,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserResult __CreateInstance(global::System.IntPtr native)
public static ParserResult __CreateInstance(global::System.IntPtr native)
{
return new ParserResult((ParserResult.Internal*) native);
}
@ -986,7 +986,7 @@ namespace CppSharp @@ -986,7 +986,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ClangParser __CreateInstance(global::System.IntPtr native)
public static ClangParser __CreateInstance(global::System.IntPtr native)
{
return new ClangParser((ClangParser.Internal*) native);
}

2
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Sources.cs

@ -34,7 +34,7 @@ namespace CppSharp @@ -34,7 +34,7 @@ namespace CppSharp
internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
}
public static new SourceLocation __CreateInstance(global::System.IntPtr native)
public static SourceLocation __CreateInstance(global::System.IntPtr native)
{
return new SourceLocation((SourceLocation.Internal*) native);
}

2
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs

@ -174,7 +174,7 @@ namespace CppSharp @@ -174,7 +174,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserTargetInfo __CreateInstance(global::System.IntPtr native)
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native)
{
return new ParserTargetInfo((ParserTargetInfo.Internal*) native);
}

34
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs

@ -251,7 +251,7 @@ namespace CppSharp @@ -251,7 +251,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Type __CreateInstance(global::System.IntPtr native)
public static Type __CreateInstance(global::System.IntPtr native)
{
return new Type((Type.Internal*) native);
}
@ -351,7 +351,7 @@ namespace CppSharp @@ -351,7 +351,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new TypeQualifiers __CreateInstance(global::System.IntPtr native)
public static TypeQualifiers __CreateInstance(global::System.IntPtr native)
{
return new TypeQualifiers((TypeQualifiers.Internal*) native);
}
@ -466,7 +466,7 @@ namespace CppSharp @@ -466,7 +466,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new QualifiedType __CreateInstance(global::System.IntPtr native)
public static QualifiedType __CreateInstance(global::System.IntPtr native)
{
return new QualifiedType((QualifiedType.Internal*) native);
}
@ -1443,7 +1443,7 @@ namespace CppSharp @@ -1443,7 +1443,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new TemplateArgument __CreateInstance(global::System.IntPtr native)
public static TemplateArgument __CreateInstance(global::System.IntPtr native)
{
return new TemplateArgument((TemplateArgument.Internal*) native);
}
@ -1745,7 +1745,7 @@ namespace CppSharp @@ -1745,7 +1745,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new TemplateParameter __CreateInstance(global::System.IntPtr native)
public static TemplateParameter __CreateInstance(global::System.IntPtr native)
{
return new TemplateParameter((TemplateParameter.Internal*) native);
}
@ -2404,7 +2404,7 @@ namespace CppSharp @@ -2404,7 +2404,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new VTableComponent __CreateInstance(global::System.IntPtr native)
public static VTableComponent __CreateInstance(global::System.IntPtr native)
{
return new VTableComponent((VTableComponent.Internal*) native);
}
@ -2539,7 +2539,7 @@ namespace CppSharp @@ -2539,7 +2539,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new VTableLayout __CreateInstance(global::System.IntPtr native)
public static VTableLayout __CreateInstance(global::System.IntPtr native)
{
return new VTableLayout((VTableLayout.Internal*) native);
}
@ -2648,7 +2648,7 @@ namespace CppSharp @@ -2648,7 +2648,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new VFTableInfo __CreateInstance(global::System.IntPtr native)
public static VFTableInfo __CreateInstance(global::System.IntPtr native)
{
return new VFTableInfo((VFTableInfo.Internal*) native);
}
@ -2820,7 +2820,7 @@ namespace CppSharp @@ -2820,7 +2820,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ClassLayout __CreateInstance(global::System.IntPtr native)
public static ClassLayout __CreateInstance(global::System.IntPtr native)
{
return new ClassLayout((ClassLayout.Internal*) native);
}
@ -3093,7 +3093,7 @@ namespace CppSharp @@ -3093,7 +3093,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Declaration __CreateInstance(global::System.IntPtr native)
public static Declaration __CreateInstance(global::System.IntPtr native)
{
return new Declaration((Declaration.Internal*) native);
}
@ -3941,7 +3941,7 @@ namespace CppSharp @@ -3941,7 +3941,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Statement __CreateInstance(global::System.IntPtr native)
public static Statement __CreateInstance(global::System.IntPtr native)
{
return new Statement((Statement.Internal*) native);
}
@ -5496,7 +5496,7 @@ namespace CppSharp @@ -5496,7 +5496,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new BaseClassSpecifier __CreateInstance(global::System.IntPtr native)
public static BaseClassSpecifier __CreateInstance(global::System.IntPtr native)
{
return new BaseClassSpecifier((BaseClassSpecifier.Internal*) native);
}
@ -7151,7 +7151,7 @@ namespace CppSharp @@ -7151,7 +7151,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native)
public static FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native)
{
return new FunctionTemplateSpecialization((FunctionTemplateSpecialization.Internal*) native);
}
@ -8032,7 +8032,7 @@ namespace CppSharp @@ -8032,7 +8032,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new NativeLibrary __CreateInstance(global::System.IntPtr native)
public static NativeLibrary __CreateInstance(global::System.IntPtr native)
{
return new NativeLibrary((NativeLibrary.Internal*) native);
}
@ -8211,7 +8211,7 @@ namespace CppSharp @@ -8211,7 +8211,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ASTContext __CreateInstance(global::System.IntPtr native)
public static ASTContext __CreateInstance(global::System.IntPtr native)
{
return new ASTContext((ASTContext.Internal*) native);
}
@ -8307,7 +8307,7 @@ namespace CppSharp @@ -8307,7 +8307,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new Comment __CreateInstance(global::System.IntPtr native)
public static Comment __CreateInstance(global::System.IntPtr native)
{
return new Comment((Comment.Internal*) native);
}
@ -8481,7 +8481,7 @@ namespace CppSharp @@ -8481,7 +8481,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new RawComment __CreateInstance(global::System.IntPtr native)
public static RawComment __CreateInstance(global::System.IntPtr native)
{
return new RawComment((RawComment.Internal*) native);
}

8
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs

@ -234,7 +234,7 @@ namespace CppSharp @@ -234,7 +234,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserOptions __CreateInstance(global::System.IntPtr native)
public static ParserOptions __CreateInstance(global::System.IntPtr native)
{
return new ParserOptions((ParserOptions.Internal*) native);
}
@ -656,7 +656,7 @@ namespace CppSharp @@ -656,7 +656,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserDiagnostic __CreateInstance(global::System.IntPtr native)
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native)
{
return new ParserDiagnostic((ParserDiagnostic.Internal*) native);
}
@ -838,7 +838,7 @@ namespace CppSharp @@ -838,7 +838,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserResult __CreateInstance(global::System.IntPtr native)
public static ParserResult __CreateInstance(global::System.IntPtr native)
{
return new ParserResult((ParserResult.Internal*) native);
}
@ -986,7 +986,7 @@ namespace CppSharp @@ -986,7 +986,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ClangParser __CreateInstance(global::System.IntPtr native)
public static ClangParser __CreateInstance(global::System.IntPtr native)
{
return new ClangParser((ClangParser.Internal*) native);
}

2
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Sources.cs

@ -34,7 +34,7 @@ namespace CppSharp @@ -34,7 +34,7 @@ namespace CppSharp
internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
}
public static new SourceLocation __CreateInstance(global::System.IntPtr native)
public static SourceLocation __CreateInstance(global::System.IntPtr native)
{
return new SourceLocation((SourceLocation.Internal*) native);
}

2
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs

@ -174,7 +174,7 @@ namespace CppSharp @@ -174,7 +174,7 @@ namespace CppSharp
private readonly bool __ownsNativeInstance;
public static new ParserTargetInfo __CreateInstance(global::System.IntPtr native)
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native)
{
return new ParserTargetInfo((ParserTargetInfo.Internal*) native);
}

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

@ -744,9 +744,7 @@ namespace CppSharp.Generators.CSharp @@ -744,9 +744,7 @@ namespace CppSharp.Generators.CSharp
var bases = new List<string>();
var needsBase = @class.HasBaseClass && !@class.IsValueType && @class.IsGenerated
&& !@class.Bases[0].Class.IsValueType
&& @class.Bases[0].Class.IsGenerated;
var needsBase = @class.HasGeneratedBase;
if (needsBase)
{
@ -1903,11 +1901,13 @@ namespace CppSharp.Generators.CSharp @@ -1903,11 +1901,13 @@ namespace CppSharp.Generators.CSharp
if (!@class.IsAbstract)
{
PushBlock(CSharpBlockKind.Method);
WriteLine("public static new {0} {1}(global::System.IntPtr native)", safeIdentifier, Helpers.CreateInstanceIdentifier);
WriteLine("public static {0}{1} {2}(global::System.IntPtr native)",
@class.HasGeneratedBase && !@class.BaseClass.IsAbstract ? "new " : string.Empty,
safeIdentifier, Helpers.CreateInstanceIdentifier);
WriteStartBraceIndent();
WriteLine("return new {0}(({1}.Internal*) native);", safeIdentifier, className);
WriteCloseBraceIndent();
PopBlock(NewLineKind.BeforeNextBlock);
PopBlock(NewLineKind.BeforeNextBlock);
}
GenerateNativeConstructorByValue(@class, className, safeIdentifier);

Loading…
Cancel
Save