@Override public List<FSPath> getUserIncludePaths() { return CndFileUtils.toFSPathList(CndFileUtils.getLocalFileSystem(), this.usrIncludes); }
@Override public List<FSPath> getSystemIncludePaths() { return CndFileUtils.toFSPathList(CndFileUtils.getLocalFileSystem(), this.sysIncludes); }
private APTIncludeHandler getIncludeHandler(FileObject fo) { FileSystem localFS = CndFileUtils.getLocalFileSystem(); List<FSPath> systemIncludes = CndFileUtils.toFSPathList(localFS, getSystemIncludes()); List<IncludeDirEntry> sysIncludes = sysAPTData.getIncludes(systemIncludes.toString(), systemIncludes); // NOI18N List<String> qInc = getQuoteIncludePaths(); if (isPathsRelCurFile()) { qInc = new ArrayList<>(getQuoteIncludePaths().size()); for (Iterator<String> it = getQuoteIncludePaths().iterator(); it.hasNext();) { String path = it.next(); if (CndPathUtilities.isPathAbsolute(path)) { qInc.add(path); } else { FileObject dirFO = fo.getParent(); FileObject pathFile = dirFO.getFileObject(path); if (pathFile != null && pathFile.isValid()) { path = pathFile.getPath(); qInc.add(path); } } } } StartEntry startEntry = new StartEntry(localFS, fo.getPath(), getProject().getUIDKey()); List<IncludeDirEntry> userIncludes = userPathStorage.get(qInc.toString(), CndFileUtils.toFSPathList(localFS, qInc)); return APTHandlersSupport.createIncludeHandler(startEntry, sysIncludes, userIncludes, Collections.<String>emptyList(), null); }
/** * Returns a list <String> of compiler defined include paths used when parsing 'orpan' source files. * @return a list <String> of compiler defined include paths. * A path is always an absolute path. * Include paths are not prefixed with the compiler include path option (usually -I). */ /* * Return C++ settings **/ @Override public List<FSPath> getSystemIncludePaths() { ArrayList<FSPath> vec = new ArrayList<>(); MakeConfiguration makeConfiguration = getMakeConfiguration(); if (makeConfiguration != null) { CompilerSet compilerSet = makeConfiguration.getCompilerSet().getCompilerSet(); if (compilerSet == null) { return vec; } AbstractCompiler compiler = (AbstractCompiler) compilerSet.getTool(PredefinedToolKind.CCCompiler); if (compiler != null) { FileSystem compilerFS = FileSystemProvider.getFileSystem(compiler.getExecutionEnvironment()); vec.addAll(CndFileUtils.toFSPathList(compilerFS, compiler.getSystemIncludeDirectories())); } } return vec; }
@Override public List<FSPath> getSystemIncludePaths() { List<FSPath> vec = new ArrayList<>(); MakeConfiguration makeConfiguration = getMakeConfiguration(); ItemConfiguration itemConfiguration = getItemConfiguration(makeConfiguration);//ItemConfiguration)makeConfiguration.getAuxObject(ItemConfiguration.getId(getPath())); if (itemConfiguration == null || !itemConfiguration.isCompilerToolConfiguration()) { // FIXUP: sometimes itemConfiguration is null (should not happen) return vec; } CompilerSet compilerSet = makeConfiguration.getCompilerSet().getCompilerSet(); if (compilerSet == null) { return vec; } AbstractCompiler compiler = (AbstractCompiler) compilerSet.getTool(itemConfiguration.getTool()); BasicCompilerConfiguration compilerConfiguration = itemConfiguration.getCompilerConfiguration(); if (compilerConfiguration instanceof CCCCompilerConfiguration) { // Get include paths from compiler if (compiler != null && compiler.getPath() != null && compiler.getPath().length() > 0) { FileSystem fs = FileSystemProvider.getFileSystem(compiler.getExecutionEnvironment()); if (makeConfiguration.isMakefileConfiguration()) { vec.addAll(CndFileUtils.toFSPathList(fs, compiler.getSystemIncludeDirectories(getImportantFlags()))); } else { String importantFlags = SPI_ACCESSOR.getImportantFlags(compilerConfiguration, compiler, makeConfiguration); vec.addAll(CndFileUtils.toFSPathList(fs, compiler.getSystemIncludeDirectories(importantFlags))); } } } return SPI_ACCESSOR.expandIncludePaths(vec, compilerConfiguration, compiler, makeConfiguration); }
usrMacros.addAll(prototype.getUserMacroDefinitions()); } else { sysIncludes.addAll(CndFileUtils.toFSPathList(fs, DefaultSystemSettings.getDefault().getSystemIncludes(lang, impl))); sysMacros.addAll(DefaultSystemSettings.getDefault().getSystemMacros(lang, impl));