Browse Source

Use the AST utils methods to check for ignored declarations.

pull/12/merge
triton 13 years ago
parent
commit
300b8508a0
  1. 7
      src/Generator/Generators/CLI/CLIHeadersTemplate.cs
  2. 11
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

7
src/Generator/Generators/CLI/CLIHeadersTemplate.cs

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using CppSharp.AST;
using CppSharp.Types; using CppSharp.Types;
namespace CppSharp.Generators.CLI namespace CppSharp.Generators.CLI
@ -347,7 +348,7 @@ namespace CppSharp.Generators.CLI
PushIndent(); PushIndent();
foreach (var field in @class.Fields) foreach (var field in @class.Fields)
{ {
if (CheckIgnoreField(@class, field)) continue; if (Utils.CheckIgnoreField(@class, field)) continue;
GenerateDeclarationCommon(field); GenerateDeclarationCommon(field);
if (@class.IsUnion) if (@class.IsUnion)
@ -404,7 +405,7 @@ namespace CppSharp.Generators.CLI
var staticMethods = new List<Method>(); var staticMethods = new List<Method>();
foreach (var method in @class.Methods) foreach (var method in @class.Methods)
{ {
if (CheckIgnoreMethod(@class, method)) if (Utils.CheckIgnoreMethod(@class, method))
continue; continue;
if (method.IsConstructor) if (method.IsConstructor)
@ -482,7 +483,7 @@ namespace CppSharp.Generators.CLI
PushIndent(); PushIndent();
foreach (var field in @class.Fields) foreach (var field in @class.Fields)
{ {
if (CheckIgnoreField(@class, field)) if (Utils.CheckIgnoreField(@class, field))
continue; continue;
GenerateDeclarationCommon(field); GenerateDeclarationCommon(field);

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

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using CppSharp.AST;
namespace CppSharp.Generators.CSharp namespace CppSharp.Generators.CSharp
{ {
@ -350,7 +351,7 @@ namespace CppSharp.Generators.CSharp
foreach (var method in @class.Methods) foreach (var method in @class.Methods)
{ {
if (CheckIgnoreMethod(@class, method)) if (Utils.CheckIgnoreMethod(@class, method))
continue; continue;
if (method.IsConstructor) if (method.IsConstructor)
@ -408,7 +409,7 @@ namespace CppSharp.Generators.CSharp
foreach (var field in @class.Fields) foreach (var field in @class.Fields)
{ {
if (CheckIgnoreField(@class, field)) continue; if (Utils.CheckIgnoreField(@class, field)) continue;
var nativeField = string.Format("{0}->{1}", var nativeField = string.Format("{0}->{1}",
Helpers.GeneratedIdentifier("ptr"), field.OriginalName); Helpers.GeneratedIdentifier("ptr"), field.OriginalName);
@ -558,7 +559,7 @@ namespace CppSharp.Generators.CSharp
foreach (var field in @class.Fields) foreach (var field in @class.Fields)
{ {
if (CheckIgnoreField(@class, field)) continue; if (Utils.CheckIgnoreField(@class, field)) continue;
NewLineIfNeeded(); NewLineIfNeeded();
@ -755,7 +756,7 @@ namespace CppSharp.Generators.CSharp
var staticMethods = new List<Method>(); var staticMethods = new List<Method>();
foreach (var method in @class.Methods) foreach (var method in @class.Methods)
{ {
if (CheckIgnoreMethod(@class, method)) if (Utils.CheckIgnoreMethod(@class, method))
continue; continue;
if (method.IsConstructor) if (method.IsConstructor)
@ -953,7 +954,7 @@ namespace CppSharp.Generators.CSharp
foreach (var ctor in @class.Constructors) foreach (var ctor in @class.Constructors)
{ {
if (CheckIgnoreMethod(@class, ctor)) if (Utils.CheckIgnoreMethod(@class, ctor))
continue; continue;
NewLineIfNeeded(); NewLineIfNeeded();

Loading…
Cancel
Save