Browse Source

CheckIgnoreField now properly handles internal fields.

pull/244/head
marcos henrich 11 years ago
parent
commit
b5fc658888
  1. 8
      src/Generator/AST/Utils.cs
  2. 6
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

8
src/Generator/AST/Utils.cs

@ -60,15 +60,15 @@ namespace CppSharp.AST @@ -60,15 +60,15 @@ namespace CppSharp.AST
return false;
}
public static bool CheckIgnoreField(Field field)
public static bool CheckIgnoreField(Field field, bool useInternals = false)
{
if (field.Access == AccessSpecifier.Private)
return true;
if (field.Class.IsValueType && field.IsDeclared)
return false;
return !field.IsGenerated;
return false;
return !field.IsGenerated && (!useInternals || !field.IsInternal);
}
public static bool CheckIgnoreProperty(Property prop)

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

@ -222,7 +222,7 @@ namespace CppSharp.Generators.CSharp @@ -222,7 +222,7 @@ namespace CppSharp.Generators.CSharp
// Generate all the internal function declarations.
foreach (var function in context.Functions)
{
{
if (!function.IsInternal) continue;
GenerateInternalFunction(function);
@ -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);
}
}

Loading…
Cancel
Save