[xbuild] DirectoryScanner.HasWildcard - new method
[mono.git] / mcs / class / Microsoft.Build.Engine / Microsoft.Build.BuildEngine / DirectoryScanner.cs
index d16cbcf4a3d0a0e457520d5dff9adc64afdc61f9..d9c7345c4657dd93beae390b1d5b165402ccbe62 100644 (file)
@@ -83,7 +83,7 @@ namespace Microsoft.Build.BuildEngine {
                        FileInfo[] fileInfo;
 
                        string name = include_item.ItemSpec;
-                       if (name.IndexOf ('?') == -1 && name.IndexOf ('*') == -1) {
+                       if (!HasWildcard (name)) {
                                if (!excludedItems.ContainsKey (Path.GetFullPath(name)))
                                        includedItems.Add (include_item);
                        } else {
@@ -210,6 +210,11 @@ namespace Microsoft.Build.BuildEngine {
                                return fi;
                        }
                }
+
+               public static bool HasWildcard (string expression)
+               {
+                       return expression.IndexOf ('?') >= 0 || expression.IndexOf ('*') >= 0;
+               }
                
                public DirectoryInfo BaseDirectory {
                        get { return baseDirectory; }