Browse Source

Fixed the IgnoreHeadersWithName helper to be more robust by checking for patterns against the file path and include paths.

pull/1/head
triton 12 years ago
parent
commit
aed949e4dd
  1. 18
      src/Generator/Library.cs

18
src/Generator/Library.cs

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using CppSharp.Generators;
namespace CppSharp namespace CppSharp
{ {
@ -310,14 +309,19 @@ namespace CppSharp
public static void IgnoreHeadersWithName(this Library library, string pattern) public static void IgnoreHeadersWithName(this Library library, string pattern)
{ {
var modules = library.TranslationUnits.FindAll( var units = library.TranslationUnits.FindAll(m =>
m => Regex.Match(m.FilePath, pattern).Success); {
var hasMatch = Regex.Match(m.FilePath, pattern).Success;
if (m.IncludePath != null)
hasMatch |= Regex.Match(m.IncludePath, pattern).Success;
return hasMatch;
});
foreach (var module in modules) foreach (var unit in units)
{ {
module.IsGenerated = false; unit.IsGenerated = false;
module.IsProcessed = true; unit.IsProcessed = true;
module.ExplicityIgnored = true; unit.ExplicityIgnored = true;
} }
} }

Loading…
Cancel
Save