|
|
|
@ -223,7 +223,7 @@ namespace CppSharp.Generators.CSharp
@@ -223,7 +223,7 @@ namespace CppSharp.Generators.CSharp
|
|
|
|
|
// Generate all the internal function declarations.
|
|
|
|
|
foreach (var function in context.Functions) |
|
|
|
|
{ |
|
|
|
|
if (!function.IsInternal) continue; |
|
|
|
|
if (!function.IsGenerated && !function.IsInternal ) continue; |
|
|
|
|
|
|
|
|
|
GenerateInternalFunction(function); |
|
|
|
|
} |
|
|
|
@ -315,7 +315,7 @@ namespace CppSharp.Generators.CSharp
@@ -315,7 +315,7 @@ namespace CppSharp.Generators.CSharp
|
|
|
|
|
|
|
|
|
|
public void GenerateClass(Class @class) |
|
|
|
|
{ |
|
|
|
|
if (@class.IsIncomplete) |
|
|
|
|
if (!@class.IsGenerated || @class.IsIncomplete) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
PushBlock(CSharpBlockKind.Class); |
|
|
|
@ -331,7 +331,7 @@ namespace CppSharp.Generators.CSharp
@@ -331,7 +331,7 @@ namespace CppSharp.Generators.CSharp
|
|
|
|
|
GenerateClassInternals(@class); |
|
|
|
|
GenerateDeclContext(@class); |
|
|
|
|
|
|
|
|
|
if (!@class.IsGenerated || @class.IsDependent) |
|
|
|
|
if (@class.IsDependent) |
|
|
|
|
goto exit; |
|
|
|
|
|
|
|
|
|
if (ShouldGenerateClassNativeField(@class)) |
|
|
|
@ -706,7 +706,7 @@ namespace CppSharp.Generators.CSharp
@@ -706,7 +706,7 @@ namespace CppSharp.Generators.CSharp
|
|
|
|
|
if (@class.IsUnion) |
|
|
|
|
WriteLine("[StructLayout(LayoutKind.Explicit)]"); |
|
|
|
|
|
|
|
|
|
Write(!@class.IsGenerated ? "internal " : Helpers.GetAccess(@class.Access)); |
|
|
|
|
Write(@class.IsInternal ? "internal " : Helpers.GetAccess(@class.Access)); |
|
|
|
|
Write("unsafe "); |
|
|
|
|
|
|
|
|
|
if (Driver.Options.GenerateAbstractImpls && @class.IsAbstract) |
|
|
|
@ -760,8 +760,8 @@ namespace CppSharp.Generators.CSharp
@@ -760,8 +760,8 @@ namespace CppSharp.Generators.CSharp
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach (var field in @class.Fields) |
|
|
|
|
{ |
|
|
|
|
if (!nativeFields && ASTUtils.CheckIgnoreField(field)) continue; |
|
|
|
|
{ |
|
|
|
|
if (ASTUtils.CheckIgnoreField(field, nativeFields)) continue; |
|
|
|
|
action(field); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -788,13 +788,11 @@ namespace CppSharp.Generators.CSharp
@@ -788,13 +788,11 @@ namespace CppSharp.Generators.CSharp
|
|
|
|
|
if (field.Expression != null) |
|
|
|
|
{ |
|
|
|
|
var fieldValuePrinted = field.Expression.CSharpValue(ExpressionPrinter); |
|
|
|
|
Write("{0} {1} {2} = {3};", !field.IsGenerated ? "internal" : "public", |
|
|
|
|
fieldTypePrinted.Type, safeIdentifier, fieldValuePrinted); |
|
|
|
|
Write("public {0} {1} = {2};", fieldTypePrinted.Type, safeIdentifier, fieldValuePrinted); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Write("{0} {1} {2};", !field.IsGenerated ? "internal" : "public", |
|
|
|
|
fieldTypePrinted.Type, safeIdentifier); |
|
|
|
|
Write("public {0} {1};", fieldTypePrinted.Type, safeIdentifier); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|
@ -2659,7 +2657,7 @@ namespace CppSharp.Generators.CSharp
@@ -2659,7 +2657,7 @@ namespace CppSharp.Generators.CSharp
|
|
|
|
|
|
|
|
|
|
public void GenerateInternalFunction(Function function) |
|
|
|
|
{ |
|
|
|
|
if (!function.IsInternal || function.IsPure) |
|
|
|
|
if (function.IsPure) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if (function.OriginalFunction != null) |
|
|
|
|