project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/api/cpp/epoc/engine/preprocessor/BasicIncludeFileLocator.java
changeset 610 bfb3ab3f70f2
parent 0 fb279309251b
child 684 8e7900690341
equal deleted inserted replaced
609:bf7dbec89c47 610:bfb3ab3f70f2
    24 
    24 
    25 import java.io.File;
    25 import java.io.File;
    26 import java.io.IOException;
    26 import java.io.IOException;
    27 
    27 
    28 import com.nokia.carbide.cpp.epoc.engine.preprocessor.IIncludeFileLocator;
    28 import com.nokia.carbide.cpp.epoc.engine.preprocessor.IIncludeFileLocator;
       
    29 import com.nokia.cpp.internal.api.utils.core.HostOS;
    29 public class BasicIncludeFileLocator implements IIncludeFileLocator {
    30 public class BasicIncludeFileLocator implements IIncludeFileLocator {
    30 
    31 
    31 	private static final File[] NO_DIRS = new File[0];
    32 	private static final File[] NO_DIRS = new File[0];
    32 	
    33 	
    33 	private File[] userPaths;
    34 	private File[] userPaths;
    41 		this.userPaths = userPaths != null ? userPaths : NO_DIRS;
    42 		this.userPaths = userPaths != null ? userPaths : NO_DIRS;
    42 		this.systemPaths = systemPaths != null ? systemPaths : NO_DIRS;
    43 		this.systemPaths = systemPaths != null ? systemPaths : NO_DIRS;
    43 	}
    44 	}
    44 	
    45 	
    45 	public File findIncludeFile(String file, boolean isUser, File currentDir) {
    46 	public File findIncludeFile(String file, boolean isUser, File currentDir) {
       
    47 		if (HostOS.IS_UNIX) {
       
    48 			file = HostOS.convertPathToUnix(file);
       
    49 		}
       
    50 		
    46 		// see if the file exists as an absolute file
    51 		// see if the file exists as an absolute file
    47 		File theFile = new File(file);
    52 		File theFile = new File(file);
    48 		if (theFile.exists() && theFile.isFile() && theFile.isAbsolute())
    53 		if (theFile.exists() && theFile.isFile() && theFile.isAbsolute())
    49 			return canonical(theFile);
    54 			return canonical(theFile);
    50 
    55