Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDavid Inglis2004-03-25 21:42:50 -0500
committerDavid Inglis2004-03-25 21:42:50 -0500
commit709d5dd050d7fcc8754289c63bac770fe344f944 (patch)
treeb2248c5ae480b3daf94d70b4e5a9abf864684556 /core
parent2153d2d6ecc99c4626e066c349ebacd8babe844c (diff)
downloadorg.eclipse.cdt-709d5dd050d7fcc8754289c63bac770fe344f944.tar.gz
org.eclipse.cdt-709d5dd050d7fcc8754289c63bac770fe344f944.tar.xz
org.eclipse.cdt-709d5dd050d7fcc8754289c63bac770fe344f944.zip
added CoreModelUtil class
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/ChangeLog6
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModelUtil.java35
2 files changed, 41 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog
index 43255f391c..0b149a878e 100644
--- a/core/org.eclipse.cdt.core/ChangeLog
+++ b/core/org.eclipse.cdt.core/ChangeLog
@@ -1,4 +1,10 @@
2004-03-25 David Inglis
+
+ Added util class for core model
+
+ * src/org/eclipse/cdt/core/model/CoreModelUtil.java
+
+2004-03-25 David Inglis
Update to allow non-owned projects and added better recovery of deleted .cdtprojects via nature id
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModelUtil.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModelUtil.java
new file mode 100644
index 0000000000..94ec252960
--- /dev/null
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModelUtil.java
@@ -0,0 +1,35 @@
+package org.eclipse.cdt.core.model;
+
+import org.eclipse.cdt.internal.core.CharOperation;
+import org.eclipse.core.runtime.IPath;
+
+public class CoreModelUtil {
+
+ public static boolean isExcludedPath(IPath resourcePath, IPath[] exclusionPatterns) {
+ char[] path = resourcePath.toString().toCharArray();
+ for (int i = 0, length = exclusionPatterns.length; i < length; i++) {
+ char[] pattern = exclusionPatterns[i].toString().toCharArray();
+ if (CharOperation.pathMatch(pattern, path, true, '/')) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /*
+ * Returns whether the given resource path matches one of the exclusion
+ * patterns.
+ *
+ * @see IPathEntry#getExclusionPatterns
+ */
+ public final static boolean isExcluded(IPath resourcePath, char[][] exclusionPatterns) {
+ if (exclusionPatterns == null)
+ return false;
+ char[] path = resourcePath.toString().toCharArray();
+ for (int i = 0, length = exclusionPatterns.length; i < length; i++)
+ if (CharOperation.pathMatch(exclusionPatterns[i], path, true, '/'))
+ return true;
+ return false;
+ }
+
+} \ No newline at end of file

Back to the top