mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
added CoreModelUtil class
This commit is contained in:
parent
2153d2d6ec
commit
709d5dd050
2 changed files with 41 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue