Browse Source

CheckIgnoreField now properly handles internal fields.

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

4
src/Generator/AST/Utils.cs

@ -60,7 +60,7 @@ namespace CppSharp.AST @@ -60,7 +60,7 @@ 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;
@ -68,7 +68,7 @@ namespace CppSharp.AST @@ -68,7 +68,7 @@ namespace CppSharp.AST
if (field.Class.IsValueType && field.IsDeclared)
return false;
return !field.IsGenerated;
return !field.IsGenerated && (!useInternals || !field.IsInternal);
}
public static bool CheckIgnoreProperty(Property prop)

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

@ -761,7 +761,7 @@ namespace CppSharp.Generators.CSharp @@ -761,7 +761,7 @@ 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