public static void IgnoreFunctionsWithParameterTypeName(this ASTContext context, string matchTypeName)
 {
     foreach (TranslationUnit unit in context.TranslationUnits)
     {
         foreach (Function function in unit.Functions)
         {
             if (function.Parameters.Any(
                     p =>
             {
                 Type type = p.Type;
                 // depointer
                 if (type.IsPointer())
                 {
                     type = ((PointerType)type).Pointee;
                 }
                 string typeName;
                 if (type is TypedefType)
                 {
                     typeName = ((TypedefType)type).Declaration.Name;
                 }
                 else
                 {
                     typeName = type.ToString();
                 }
                 bool match = typeName == matchTypeName;
                 return(match);
             }))
             {
                 function.ExplicityIgnored = true;
             }
         }
     }
 }
Exemplo n.º 2
0
 public override string ToString()
 {
     return(Type.ToString());
 }