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

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

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

Loading…
Cancel
Save