• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ICLanguageSettingEntry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry的典型用法代码示例。如果您正苦于以下问题:Java ICLanguageSettingEntry类的具体用法?Java ICLanguageSettingEntry怎么用?Java ICLanguageSettingEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ICLanguageSettingEntry类属于org.eclipse.cdt.core.settings.model包,在下文中一共展示了ICLanguageSettingEntry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: processArgument

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
protected final int processArgument(List<ICLanguageSettingEntry> returnedEntries, String args,
    NameValueOptionMatcher[] optionMatchers) {
  for (NameValueOptionMatcher oMatcher : optionMatchers) {
    final Matcher matcher = oMatcher.matcher;

    matcher.reset(args);
    if (matcher.lookingAt()) {
      final String name = matcher.group(oMatcher.nameGroup);
      final String value = matcher.group(oMatcher.valueGroup);
      final ICLanguageSettingEntry entry = CDataUtil.createCMacroEntry(name, value,
          ICSettingEntry.BUILTIN | ICSettingEntry.READONLY);
      returnedEntries.add(entry);
      final int end = matcher.end();
      return end;
    }
  }
  return 0;// no input consumed
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:19,代码来源:ToolArgumentParsers.java


示例2: processCommandLine

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
/**
 * Processes the command-line of an entry from a {@code compile_commands.json}
 * file by trying the specified detector and stores a
 * {@link ICLanguageSettingEntry} for the file found in the specified map.
 *
 * @param storage
 *          where to store language settings
 * @param cmdlineParser
 *          the tool detector and its tool option parsers
 * @param sourceFile
 *          the source file resource corresponding to the source file being
 *          processed by the tool
 * @param cwd
 *          the current working directory of the compiler at its invocation
 * @param line
 *          the command line to process
 */
private void processCommandLine(TimestampedLanguageSettingsStorage storage, IToolCommandlineParser cmdlineParser,
    IFile sourceFile, IPath cwd, String line) {
  line = ToolCommandlineParser.trimLeadingWS(line);
  final List<ICLanguageSettingEntry> entries = cmdlineParser.processArgs(cwd, line);
  // attach settings to sourceFile resource...
  if (entries != null && entries.size() > 0) {
    for (ICLanguageSettingEntry entry : entries) {
      if (entry.getKind() == ICSettingEntry.INCLUDE_PATH) {
        /*
         * compile_commands.json holds entries per-file only and does not
         * contain per-project or per-folder entries. For include dirs, ALSO
         * add these entries to the project resource to make them show up in
         * the UI in the includes folder...
         */
        storage.setSettingEntries((String) null, cmdlineParser.getLanguageId(), entries);
      }
    }
    storage.setSettingEntries(sourceFile, cmdlineParser.getLanguageId(), entries);
  }
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:38,代码来源:CompileCommandsJsonParser.java


示例3: processLine

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
@Override
  public boolean processLine(String line) {
    // try each tool..
    for (Entry<Matcher, IToolCommandlineParser> entry : currentBuildOutputToolParsers.entrySet()) {
      final Matcher cmdDetector = entry.getKey();
      cmdDetector.reset(line);
      if (cmdDetector.lookingAt()) {
        // found a matching tool parser
        String args = line.substring(cmdDetector.end());
        args = ToolCommandlineParser.trimLeadingWS(args);
        final IToolCommandlineParser botp = entry.getValue();
        final IPath cwd= URIUtil.toPath(cwdTracker.getWorkingDirectoryURI());
        final List<ICLanguageSettingEntry> entries = botp.processArgs(cwd, args);
        // attach settings to project...
        if (entries != null && entries.size() > 0) {
          super.setSettingEntries(currentCfgDescription, currentProject, botp.getLanguageId(), entries);
        }
        return true; // skip other build output parsers
      }
    }
//    System.out.println(line);
    return false;
  }
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:24,代码来源:CmakeBuildOutputParser.java


示例4: testProcessArgument_RelativePath

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
/**
 * Test method for
 * {@link de.marw.cmake.cdt.language.settings.providers.ToolArgumentParsers.IncludePath_C_POSIX#processArgument(java.util.List, IPath, java.lang.String)}
 * .
 */
@Test
public final void testProcessArgument_RelativePath() {
  final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
      + " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
  List<ICLanguageSettingEntry> entries = new ArrayList<>();
  ICLanguageSettingEntry parsed;

  String name = "a/relative/Include/Path";
  IPath cwd= new Path("/compiler/working/dir");
  entries.clear();
  assertEquals(2 + name.length(),
      testee.processArgument(entries, cwd, "-I" + name + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  String absPath = cwd.append(name).toString();
  assertEquals("name", absPath, parsed.getName());
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:24,代码来源:IncludePath_C_POSIXTest.java


示例5: setIncludePaths

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
public static void setIncludePaths(IProject project, List<String> includePaths) {
	configureIndexerToIncludeAllReferencedHeaders(project);
	
	ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescription(project);
	ICLanguageSettingEntry[] entries = IncludePathString2ICLanguageSettingEntryArray(includePaths);
	
	// Set include paths for all configurations in the CDT project
	for(ICConfigurationDescription confDesc : projectDescription.getConfigurations()) {
		IConfiguration configuration = ManagedBuildManager.getConfigurationForDescription(confDesc);
		CConfigurationData Cconfigdata = configuration.getConfigurationData();
        CFolderData rootFolderData = Cconfigdata.getRootFolderData();
        CLanguageData[] languageDatas = rootFolderData.getLanguageDatas();
        
        for(CLanguageData languageData : languageDatas) {
        	languageData.setEntries(ICLanguageSettingEntry.INCLUDE_PATH, entries);
        }
	}
	
	try {
		CoreModel.getDefault().setProjectDescription(project, projectDescription);
	} catch (CoreException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
开发者ID:ffmmjj,项目名称:uefi_edk2_wizards_plugin,代码行数:26,代码来源:ProjectSettingsManager.java


示例6: getSymbols

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
/**
 * Gets all the macros from the current configuration.
 * 
 * @param onlyUserDefined
 *            if true, only user-defined macros are returned, otherwise only
 *            system-defined.
 * @return all macros in a list
 */
protected Collection<Symbol> getSymbols(boolean onlyUserDefined) {
	Collection<Symbol> symbols = new LinkedList<Symbol>();
	for (ICLanguageSetting languageSetting : languageSettings) {
		ICLanguageSettingEntry[] macroSettings = languageSetting
				.getSettingEntries(ICSettingEntry.MACRO);
		for (ICLanguageSettingEntry macroSetting : macroSettings) {

			// only regard user-specified include paths or only
			// system include paths
			if ((!macroSetting.isBuiltIn() && onlyUserDefined)
					|| (macroSetting.isBuiltIn() && !onlyUserDefined)) {
				Symbol symbol = new Symbol(macroSetting.getName(),
						macroSetting.getValue(), true,
						macroSetting.isBuiltIn());
				symbols.add(symbol);
			}
		}
	}
	return symbols;
}
 
开发者ID:kwin,项目名称:cppcheclipse,代码行数:29,代码来源:ToolchainSettings.java


示例7: createSourcePathEntry

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
private ICSourceEntry createSourcePathEntry(final String path, final Set<String> excludes, final int flags) {
	IPath[] exclusionPatterns = null;
	if (excludes.size() > 0) {
		exclusionPatterns = new IPath[excludes.size()];
		int i = 0;
		for (String exclude : excludes) {
			exclusionPatterns[i] = Path.fromOSString(exclude);
			++i;
		}
		logger.debug("Excludes for source path " + path + ": " + Arrays.deepToString(exclusionPatterns));
	}
	final IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
	final File file = new File(path);
	if (!file.isAbsolute()) {
		return (ICSourceEntry) CDataUtil.createEntry(ICLanguageSettingEntry.SOURCE_PATH, path, null, exclusionPatterns, ICSettingEntry.VALUE_WORKSPACE_PATH
				| flags);
	} else {
		IContainer container = workspace.getContainerForLocation(Path.fromOSString(path));
		if (container == null) {
			return (ICSourceEntry) CDataUtil.createEntry(ICLanguageSettingEntry.SOURCE_PATH, path, null, exclusionPatterns, flags);
		} else {
			return (ICSourceEntry) CDataUtil.createEntry(ICLanguageSettingEntry.SOURCE_PATH, container.getFullPath().toOSString(), null, exclusionPatterns,
					ICSettingEntry.VALUE_WORKSPACE_PATH | flags);
		}
	}
}
 
开发者ID:maven-nar,项目名称:m2e-nar,代码行数:27,代码来源:AbstractSettingsSynchroniser.java


示例8: processArgs

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
@Override
public List<ICLanguageSettingEntry> processArgs(IPath cwd, String args) {
  this.entries = new ArrayList<>();
  this.cwd = Objects.requireNonNull(cwd, "cwd");

  ParserHandler ph = new ParserHandler();
  ph.parseArguments(responseFileArgumentParser, args);
  return entries;
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:10,代码来源:ToolCommandlineParser.java


示例9: getSettingEntries

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
@Override
public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc,
    String languageId) {
  if (cfgDescription == null || rc == null) {
    // speed up, we do not provide global (workspace) lang settings..
    return null;
  }
  return storage.getSettingEntries(cfgDescription, rc, languageId);
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:10,代码来源:CompileCommandsJsonParser.java


示例10: setSettingEntries

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
/**
 * Sets language settings entries for this storages.
 *
 * @param rc
 *          resource such as file or folder or project. If {@code null} the
 *          entries are considered to be being defined as project-level
 *          entries for child resources.
 * @param languageId
 *          language id. Must not be {@code null}
 * @param entries
 *          language settings entries to set.
 */
public void setSettingEntries(IResource rc, String languageId, List<ICLanguageSettingEntry> entries) {
  /*
   * compile_commands.json holds entries per-file only and does not contain
   * per-project or per-folder entries. So we map the latter as project
   * entries (=> null) to make the UI show the include directories we
   * detected.
   */
  String rcPath = null;
  if (rc != null && rc.getType() == IResource.FILE) {
    rcPath = rc.getProjectRelativePath().toString();
  }
  super.setSettingEntries(rcPath, languageId, entries);
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:26,代码来源:CompileCommandsJsonParser.java


示例11: testProcessArgument

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
/**
 * Test method for
 * {@link de.marw.cmake.cdt.language.settings.providers.ToolArgumentParsers.MacroUndefine_C_POSIX#processArgument(java.util.List, IPath, java.lang.String)}
 * .
 */
@Test
public final void testProcessArgument() {
  final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
      + " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
  List<ICLanguageSettingEntry> entries = new ArrayList<>();
  ICLanguageSettingEntry parsed;
  final IPath cwd= new Path("");

  String name = "FOO";
  // -UFOO
  entries.clear();
  assertEquals(2 + name.length(),
      testee.processArgument(entries, cwd, "-U" + name + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("kind", ICSettingEntry.UNDEFINED, (parsed.getFlags()&ICSettingEntry.UNDEFINED));
  assertEquals("name", name, parsed.getName());
  assertEquals("value", "", parsed.getValue());
  // -U  FOO
  entries.clear();
  assertEquals(2 +2+ name.length(),
      testee.processArgument(entries, cwd, "-U  " + name + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("kind", ICSettingEntry.UNDEFINED, (parsed.getFlags()&ICSettingEntry.UNDEFINED));
  assertEquals("name", name, parsed.getName());
  assertEquals("value", "", parsed.getValue());
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:36,代码来源:MacroUndefine_C_POSIXTest.java


示例12: testProcessArgument_WS

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
/**
 * Test method for
 * {@link de.marw.cmake.cdt.language.settings.providers.ToolArgumentParsers.IncludePath_C_POSIX#processArgument(java.util.List, IPath, java.lang.String)}
 */
@Test
public final void testProcessArgument_WS() {
  final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
      + " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
  List<ICLanguageSettingEntry> entries = new ArrayList<>();
  ICLanguageSettingEntry parsed;
  final IPath cwd= new Path("");

  String name = "/ye olde/In clu de/Pa the";
  // -isystem   '/ye olde/In clu de/Pa the'
  entries.clear();
  assertEquals(8 + name.length() + 3 + 2,
      testee.processArgument(entries, cwd, "-isystem   " + "'" + name + "'" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  // -isystem   "/ye olde/In clu de/Pa the"
  entries.clear();
  assertEquals(8 + name.length() + 3 + 2,
      testee.processArgument(entries, cwd, "-isystem   " + "\"" + name + "\"" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());

  name = "A:an\\In CLU  de/Pat h";
  // -isystem   'A:an\In CLU  de/Pat h'
  entries.clear();
  assertEquals(8 + name.length() +3 + 2,
      testee.processArgument(entries, cwd, "-isystem   " + "\"" + name + "\"" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:41,代码来源:SystemIncludePath_C_Test.java


示例13: IncludePathString2ICLanguageSettingEntryArray

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
private static ICLanguageSettingEntry[] IncludePathString2ICLanguageSettingEntryArray(List<String> paths) {
	List<ICLanguageSettingEntry> entries = new ArrayList<>();
	ICLanguageSettingEntry[] entriesArray = new ICLanguageSettingEntry[paths.size()];
	
	for(String path : paths) {
		entries.add(new CIncludePathEntry(path, ICSettingEntry.LOCAL));
	}
	entries.toArray(entriesArray);
	
	return entriesArray;
}
 
开发者ID:ffmmjj,项目名称:uefi_edk2_wizards_plugin,代码行数:12,代码来源:ProjectSettingsManager.java


示例14: getSettingEntries

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {

		//		PerProjectSettings projSettings = null;
		if(cfgDescription == null || rc == null) {
			return null;
		}
		
		IProject proj = rc.getProject();
		CMakeSettings cms = Activator.getDefault().getSettings();
		if(proj != null) {
			CompileCmdsHandler cmdHdl = cms.getCompileCmds(proj, cfgDescription.getName());
			if(cmdHdl != null) {
				try {
					ProjectScope ps = new ProjectScope(proj);
					IEclipsePreferences prefs = ps.getNode( Activator.getId() );
					
					String key = "LangSetProv/" + cmdHdl.getFilename();
					Long value = prefs.getLong(key, 0);

					Long current_ts = cmdHdl.getFileModTime();

					
					if( value.longValue() != current_ts.longValue() ) {
						parseCompileComands(proj, cfgDescription, cmdHdl );

						prefs.putLong(key, current_ts);
						prefs.flush();
					}
				} catch (org.osgi.service.prefs.BackingStoreException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}

	
		List<ICLanguageSettingEntry> entries = null;
		entries = m_commandParser.getSettingEntries(cfgDescription, rc, languageId);
		return entries;
	}
 
开发者ID:rungemar,项目名称:cmake4cdt,代码行数:41,代码来源:CMakeLangSetProvider.java


示例15: testResponseFileArgumentParser_At

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
@Test
public final void testResponseFileArgumentParser_At() throws Exception {

  ToolCommandlineParser testee = new ToolCommandlineParser("egal", new ResponseFileArgumentParsers.At(),
      new ToolArgumentParsers.IncludePath_C_POSIX(), new ToolArgumentParsers.MacroDefine_C_POSIX());

  List<ICLanguageSettingEntry> entries;

  final String more = " -g -MMD  -o CMakeFiles/execut1.dir/util1.c.o"
      + " -c /testprojects/C-subsrc/src/src-sub/main.c";
  ICLanguageSettingEntry parsed;

  // generate response file
  final java.nio.file.Path dirP = Files.createTempDirectory("rfpt");
  final java.nio.file.Path cwdP = dirP.getParent();
  final java.nio.file.Path relRspP = dirP.getFileName().resolve(Paths.get("response.file.txt"));
  final java.nio.file.Path absRspP = cwdP.resolve(relRspP);

  final String incDirName = "an/include/dir";
  final String def1Name = "def1";
  final String def2Name = "def2";
  final String defName = "DEF_ON_COMMANDLINE";

  try (PrintWriter rspFilePw = new PrintWriter(
      Files.newOutputStream(absRspP, StandardOpenOption.WRITE, StandardOpenOption.CREATE));) {
    rspFilePw.printf(" -D%s=234 -I%s -D%s=987", def1Name, incDirName, def2Name);
    rspFilePw.close();
  }
  // @a/response/file.txt
  entries = testee.processArgs(new Path(cwdP.toString()), "@" + relRspP.toString() + " -D" + defName + more);
  assertEquals("#entries", 4, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", def1Name, parsed.getName());
  parsed = entries.get(1);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", cwdP.resolve(incDirName).toString(), parsed.getName());
  parsed = entries.get(2);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", def2Name, parsed.getName());
  parsed = entries.get(3);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", defName, parsed.getName());


   // @ a/response.file.txt
  entries = testee.processArgs(new Path(cwdP.toString()), "@ " + relRspP.toString() + " -D" + defName + more);
  assertEquals("#entries", 4, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", def1Name, parsed.getName());
  parsed = entries.get(1);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", cwdP.resolve(incDirName).toString(), parsed.getName());
  parsed = entries.get(2);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", def2Name, parsed.getName());
  parsed = entries.get(3);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", defName, parsed.getName());

  Files.delete(absRspP);
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:64,代码来源:ToolCommandlineParserTest.java


示例16: processArgs

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
@Override
public List<ICLanguageSettingEntry> processArgs(IPath cwd, String args) {
  return null;
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:5,代码来源:CmakeBuildOutputParser.java


示例17: testProcessArgument

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
/**
 * Test method for
 * {@link ToolArgumentParsers.MacroDefine_C_POSIX#processArgument}.
 */
@Test
public final void testProcessArgument() {
  final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
      + " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
  List<ICLanguageSettingEntry> entries = new ArrayList<>();
  ICLanguageSettingEntry parsed;

  final IPath cwd= new Path("");

  // -DFOO
  String name = "FOO";
  entries.clear();
  assertEquals(2 + name.length(),
      testee.processArgument(entries, cwd, "-D" + name + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  assertEquals("value", "", parsed.getValue());
  // -D'FOO'
  entries.clear();
  assertEquals(2 + name.length() + 2,
      testee.processArgument(entries, cwd, "-D" + "'" + name + "'" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  assertEquals("value", "", parsed.getValue());
  // -D"FOO"
  entries.clear();
  assertEquals(2 + name.length() + 2,
      testee.processArgument(entries, cwd, "-D" + "\"" + name + "\"" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  assertEquals("value", "", parsed.getValue());
  // -D   FOO
  entries.clear();
  assertEquals(2 + name.length() + 3,
      testee.processArgument(entries, cwd, "-D   " + name + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  assertEquals("value", "", parsed.getValue());
  // -D   'FOO'
  entries.clear();
  assertEquals(2 + name.length() + 2 + 3,
      testee.processArgument(entries, cwd, "-D   " + "'" + name + "'" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  assertEquals("value", "", parsed.getValue());
  // -D   "FOO"
  entries.clear();
  assertEquals(2 + name.length() + 2 + 3,
      testee.processArgument(entries, cwd, "-D   " + "\"" + name + "\"" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  assertEquals("value", "", parsed.getValue());
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:70,代码来源:MacroDefine_C_POSIXTest.java


示例18: testProcessArgument

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
@Test
public final void testProcessArgument() {
  final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
      + " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
  List<ICLanguageSettingEntry> entries = new ArrayList<>();
  ICLanguageSettingEntry parsed;
  final IPath cwd= new Path("");

  String name = "/an/Include/Path";

  // -isystem   /an/Include/Path
  entries.clear();
  assertEquals(8 + name.length() + 3,
      testee.processArgument(entries, cwd, "-isystem   " + name + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  // -isystem   '/an/Include/Path'
  entries.clear();
  assertEquals(8 + name.length() + 3 + 2,
      testee.processArgument(entries, cwd, "-isystem   " + "'" + name + "'" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  // -isystem   "/an/Include/Path"
  entries.clear();
  assertEquals(8 + name.length() + 3 + 2,
      testee.processArgument(entries, cwd, "-isystem   " + "\"" + name + "\"" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());

  name = "A:an\\Include/Path";
  // -isystemA:an\Include/Path
  entries.clear();
  assertEquals(8 + 1+ name.length(),
      testee.processArgument(entries, cwd, "-isystem " + name + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:46,代码来源:SystemIncludePath_C_Test.java


示例19: testProcessArgument

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
/**
 * Test method for
 * {@link de.marw.cmake.cdt.language.settings.providers.ToolArgumentParsers.IncludePath_C_POSIX#processArgument(java.util.List, IPath, java.lang.String)}
 * .
 */
@Test
public final void testProcessArgument() {
  final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
      + " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
  List<ICLanguageSettingEntry> entries = new ArrayList<>();
  ICLanguageSettingEntry parsed;

  String name = "/an/Include/Path";
  IPath cwd= new Path("");
  // -I/an/Include/Path
  entries.clear();
  assertEquals(2 + name.length(),
      testee.processArgument(entries, cwd, "-I" + name + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  // -I'/an/Include/Path'
  entries.clear();
  assertEquals(2 + name.length() + 2,
      testee.processArgument(entries, cwd, "-I" + "'" + name + "'" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  // -I"/an/Include/Path"
  entries.clear();
  assertEquals(2 + name.length() + 2,
      testee.processArgument(entries, cwd, "-I" + "\"" + name + "\"" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());

  // -I   /an/Include/Path
  entries.clear();
  assertEquals(2 + name.length() + 3,
      testee.processArgument(entries, cwd, "-I   " + name + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  // -I   '/an/Include/Path'
  entries.clear();
  assertEquals(2 + name.length() + 3 + 2,
      testee.processArgument(entries, cwd, "-I   " + "'" + name + "'" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  // -I   "/an/Include/Path"
  entries.clear();
  assertEquals(2 + name.length() + 3 + 2,
      testee.processArgument(entries, cwd, "-I   " + "\"" + name + "\"" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());

  name = "A:an\\Include/Path";
  // -IA:an\Include/Path
  entries.clear();
  assertEquals(2 + name.length(),
      testee.processArgument(entries, cwd, "-I" + name + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:75,代码来源:IncludePath_C_POSIXTest.java


示例20: testProcessArgument_WS

import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; //导入依赖的package包/类
/**
 * Test method for
 * {@link de.marw.cmake.cdt.language.settings.providers.ToolArgumentParsers.IncludePath_C_POSIX#processArgument(java.util.List, IPath, java.lang.String)}
 */
@Test
public final void testProcessArgument_WS() {
  final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
      + " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
  List<ICLanguageSettingEntry> entries = new ArrayList<>();
  ICLanguageSettingEntry parsed;

  String name = "/ye olde/In clu de/Pa the";
  IPath cwd= new Path("");
  // -I'/ye olde/In clu de/Pa the'
  entries.clear();
  assertEquals(2 + name.length() + 2,
      testee.processArgument(entries, cwd, "-I" + "'" + name + "'" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  // -I"/ye olde/In clu de/Pa the"
  entries.clear();
  assertEquals(2 + name.length() + 2,
      testee.processArgument(entries, cwd, "-I" + "\"" + name + "\"" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());

  // -I   '/ye olde/In clu de/Pa the'
  entries.clear();
  assertEquals(2 + name.length() + 3 + 2,
      testee.processArgument(entries, cwd, "-I   " + "'" + name + "'" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
  // -I   "/ye olde/In clu de/Pa the"
  entries.clear();
  assertEquals(2 + name.length() + 3 + 2,
      testee.processArgument(entries, cwd, "-I   " + "\"" + name + "\"" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());

  name = "A:an\\In CLU  de/Pat h";
  // -I'A:an\In CLU  de/Pat h'
  entries.clear();
  assertEquals(2 + name.length() + 2,
      testee.processArgument(entries, cwd, "-I" + "\"" + name + "\"" + more));
  assertEquals("#entries", 1, entries.size());
  parsed = entries.get(0);
  assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
  assertEquals("name", name, parsed.getName());
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:58,代码来源:IncludePath_C_POSIXTest.java



注:本文中的org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Contains类代码示例发布时间:2022-05-23
下一篇:
Java Invalid类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap