public static List<String> translateIncludePaths(IProject project, List<String> sumIncludes) { // first check if cygpath translation is needed at all boolean translationNeeded = false; if (Platform.getOS().equals(Platform.OS_WIN32)) { for (Iterator<String> i = sumIncludes.iterator(); i.hasNext(); ) { String include = i.next(); if (include.startsWith("/")) { // $NON-NLS-1$ translationNeeded = true; break; } } } if (!translationNeeded) { return sumIncludes; } List<String> translatedIncludePaths = new ArrayList<String>(); for (Iterator<String> i = sumIncludes.iterator(); i.hasNext(); ) { String includePath = i.next(); String translatedPath = Cygwin.cygwinToWindowsPath(includePath); translatedIncludePaths.add(translatedPath); } return translatedIncludePaths; }
public static IPath convertCygpath(IPath path) { String pathStr = path.toPortableString(); String newPathStr = Cygwin.cygwinToWindowsPath(pathStr); IPath newPath = Path.fromPortableString(newPathStr); return newPath; }