Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2002-11-25 05:54:23 +0000
committerAlain Magloire2002-11-25 05:54:23 +0000
commit56d92428d922d4268614d68a092bd62ddf65b6bd (patch)
tree9cea05dd29f45f0a1035aac8b512dfd2ad84e20c
parent0a52804874568dafa0ce0bca6adb985115670217 (diff)
downloadorg.eclipse.cdt-56d92428d922d4268614d68a092bd62ddf65b6bd.tar.gz
org.eclipse.cdt-56d92428d922d4268614d68a092bd62ddf65b6bd.tar.xz
org.eclipse.cdt-56d92428d922d4268614d68a092bd62ddf65b6bd.zip
New methods getBinaryParser()
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java42
1 files changed, 41 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java
index 869b49bc0a7..6527f93fd5b 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java
@@ -6,12 +6,14 @@ package org.eclipse.cdt.core;
*/
import java.text.MessageFormat;
+import java.util.ArrayList;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.cdt.core.builder.ICBuilder;
import org.eclipse.cdt.core.index.IndexModel;
import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.model.IBinaryParser;
import org.eclipse.cdt.core.resources.IConsole;
import org.eclipse.cdt.internal.core.CDescriptorManager;
import org.eclipse.core.resources.IProject;
@@ -152,11 +154,49 @@ public class CCorePlugin extends Plugin {
}
};
}
-
+
public IConsole getConsole() throws CoreException {
return getConsole(null);
}
+
+ public String[] getBinaryParserFormats() {
+ ArrayList list = new ArrayList();
+ IExtensionPoint extensionPoint = getDescriptor().getExtensionPoint("BinaryParser");
+ if (extensionPoint != null) {
+ IExtension[] extensions = extensionPoint.getExtensions();
+ for(int i = 0; i < extensions.length; i++){
+ IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
+ for( int j = 0; j < configElements.length; j++ ) {
+ String attr = configElements[j].getAttribute("format");
+ if (attr != null) {
+ list.add(attr);
+ }
+ }
+ }
+ }
+ return (String[])list.toArray(new String[0]);
+ }
+ public IBinaryParser getBinaryParser(String format) {
+ try {
+ IExtensionPoint extensionPoint = getDescriptor().getExtensionPoint("BinaryParser");
+ if (extensionPoint != null) {
+ IExtension[] extensions = extensionPoint.getExtensions();
+ for(int i = 0; i < extensions.length; i++){
+ IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
+ for( int j = 0; j < configElements.length; j++ ) {
+ String attr = configElements[j].getAttribute("format");
+ if (attr != null && attr.equalsIgnoreCase(format)) {
+ return (IBinaryParser)configElements[j].createExecutableExtension("class");
+ }
+ }
+ }
+ }
+ } catch (CoreException e) {
+ }
+ return null;
+ }
+
public CoreModel getCoreModel() {
return CoreModel.getDefault();
}

Back to the top