1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-24 00:33:48 +02:00

put back the method

IBinaryParser.getBinary()

Clients still use it.
This commit is contained in:
Alain Magloire 2004-02-27 21:27:39 +00:00
parent 5fac1942cc
commit e2cd21ff38
10 changed files with 54 additions and 37 deletions

View file

@ -3,6 +3,25 @@
Added the ability for CView to update based on the translation unit working copy Added the ability for CView to update based on the translation unit working copy
if one exists. if one exists.
2004-02-27 Alain Magloire
By "popular" demand, put back
IBinaryParser.getBinary(IPath path)
method on the binary parser.
* model/org/eclpse/cdt/internal/core/model/CProject.java
* model/org/eclpse/cdt/internal/core/model/NullBinaryParser.java
* src/org/eclipse/cdt/core/IBinaryParser.java
* utils/org/eclipse/cdt/utils/coff/parser/PEParser.java
* utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java
Removed the unused ElfParsers id.
* model/org/eclipse/cdt/internal/core/model/parser/ElfParser.java
* model/org/eclipse/cdt/internal/core/model/parser/PEParser.java
* plugin.xml
2004-02-27 Alain Magloire 2004-02-27 Alain Magloire
Performance improvement in the IBinaryParser and Performance improvement in the IBinaryParser and

View file

@ -121,7 +121,7 @@ public class CProject extends CContainer implements ICProject {
if (binParser != null) { if (binParser != null) {
IBinaryFile bin; IBinaryFile bin;
try { try {
bin = binParser.getBinary(null, entry.getPath()); bin = binParser.getBinary(entry.getPath());
if (bin.getType() == IBinaryFile.ARCHIVE) { if (bin.getType() == IBinaryFile.ARCHIVE) {
lib = new LibraryReferenceArchive(cproject, entry, (IBinaryArchive)bin); lib = new LibraryReferenceArchive(cproject, entry, (IBinaryArchive)bin);
} else { } else {

View file

@ -6,6 +6,7 @@ package org.eclipse.cdt.internal.core.model;
*/ */
import java.io.IOException; import java.io.IOException;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.IBinaryParser;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
@ -21,6 +22,13 @@ public class NullBinaryParser implements IBinaryParser {
throw new IOException(CCorePlugin.getResourceString("CoreModel.NullBinaryParser.Not_binary_file")); //$NON-NLS-1$ throw new IOException(CCorePlugin.getResourceString("CoreModel.NullBinaryParser.Not_binary_file")); //$NON-NLS-1$
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IBinaryParser#getBinary(org.eclipse.core.runtime.IPath)
*/
public IBinaryFile getBinary(IPath path) throws IOException {
throw new IOException(CCorePlugin.getResourceString("CoreModel.NullBinaryParser.Not_binary_file")); //$NON-NLS-1$
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.IBinaryParser#getFormat() * @see org.eclipse.cdt.core.IBinaryParser#getFormat()
*/ */

View file

@ -1,19 +0,0 @@
/**********************************************************************
* Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.model.parser;
/**
* Implementation moved to org.eclipse.cdt.utils.elf.parser.ElfParser
* But this class is still provided for backward compatibility.
*/
public class ElfParser extends org.eclipse.cdt.utils.elf.parser.ElfParser {
}

View file

@ -1,14 +0,0 @@
package org.eclipse.cdt.internal.core.model.parser;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
/**
* Implementation moved to org.eclipse.cdt.utils.coff.parser.PEParser
* But this class is still provided for backward compatibility.
*/
public class PEParser extends org.eclipse.cdt.utils.coff.parser.PEParser {
}

View file

@ -51,7 +51,7 @@
point="org.eclipse.cdt.core.BinaryParser"> point="org.eclipse.cdt.core.BinaryParser">
<cextension> <cextension>
<run <run
class="org.eclipse.cdt.internal.core.model.parser.ElfParser"> class="org.eclipse.cdt.utils.elf.parser.ElfParser">
</run> </run>
</cextension> </cextension>
</extension> </extension>
@ -71,7 +71,7 @@
point="org.eclipse.cdt.core.BinaryParser"> point="org.eclipse.cdt.core.BinaryParser">
<cextension> <cextension>
<run <run
class="org.eclipse.cdt.internal.core.model.parser.PEParser"> class="org.eclipse.cdt.utils.coff.parser.PEParser">
</run> </run>
</cextension> </cextension>
</extension> </extension>

View file

@ -100,6 +100,15 @@ public interface IBinaryParser {
*/ */
IBinaryFile getBinary(byte[] hints, IPath path) throws IOException; IBinaryFile getBinary(byte[] hints, IPath path) throws IOException;
/**
* Creates an IBinaryFile.
*
* @param path
* @return
* @throws IOException
*/
IBinaryFile getBinary(IPath path) throws IOException;
/** /**
* Returns the name of the Format. * Returns the name of the Format.
* @return * @return

View file

@ -26,6 +26,13 @@ import org.eclipse.core.runtime.IPath;
*/ */
public class PEParser extends AbstractCExtension implements IBinaryParser { public class PEParser extends AbstractCExtension implements IBinaryParser {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IBinaryParser#getBinary(org.eclipse.core.runtime.IPath)
*/
public IBinaryFile getBinary(IPath path) throws IOException {
return getBinary(null, path);
}
/** /**
* @see org.eclipse.cdt.core.model.IBinaryParser#getBinary(IFile) * @see org.eclipse.cdt.core.model.IBinaryParser#getBinary(IFile)
*/ */

View file

@ -20,7 +20,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.utils.debug.DebugType;
import org.eclipse.cdt.utils.debug.DebugUnknownType; import org.eclipse.cdt.utils.debug.DebugUnknownType;
import org.eclipse.cdt.utils.debug.IDebugEntryRequestor; import org.eclipse.cdt.utils.debug.IDebugEntryRequestor;
import org.eclipse.cdt.utils.debug.tools.DebugSym; import org.eclipse.cdt.utils.debug.tools.DebugSym;

View file

@ -24,6 +24,14 @@ import org.eclipse.core.runtime.IPath;
*/ */
public class ElfParser extends AbstractCExtension implements IBinaryParser { public class ElfParser extends AbstractCExtension implements IBinaryParser {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IBinaryParser#getBinary(org.eclipse.core.runtime.IPath)
*/
public IBinaryFile getBinary(IPath path) throws IOException {
return getBinary(null, path);
}
public IBinaryFile getBinary(byte[] hints, IPath path) throws IOException { public IBinaryFile getBinary(byte[] hints, IPath path) throws IOException {
if (path == null) { if (path == null) {
throw new IOException("path is null"); throw new IOException("path is null");