mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
2004-09-14 Alain Magloire
Try to find the function in the header. * model/org/eclipse/cdt/internal/core/model/BinaryElement.java * model/org/eclipse/cdt/internal/core/model/BinaryFunction.java * model/org/eclipse/cdt/internal/core/model/BinaryModule.java
This commit is contained in:
parent
8a6f84fc72
commit
ebecafa648
4 changed files with 20 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-09-14 Alain Magloire
|
||||
Try to find the function in the header.
|
||||
* model/org/eclipse/cdt/internal/core/model/BinaryElement.java
|
||||
* model/org/eclipse/cdt/internal/core/model/BinaryFunction.java
|
||||
* model/org/eclipse/cdt/internal/core/model/BinaryModule.java
|
||||
|
||||
2004-09-14 Alain Magloire
|
||||
|
||||
Define for the contentType extensions for
|
||||
|
|
|
@ -113,6 +113,9 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
|
|||
tu = (ITranslationUnit)e;
|
||||
}
|
||||
}
|
||||
// do not give up yet in C++ the methods may be inline in the headers
|
||||
ICProject cproject = getCProject();
|
||||
tu = mgr.createTranslationUnitFrom(cproject, path);
|
||||
} else {
|
||||
// TODO-model: handle non-absolute paths when finding source files
|
||||
// ??? assert()
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
|
||||
package org.eclipse.cdt.internal.core.model;
|
||||
|
||||
import org.eclipse.cdt.core.model.IBinaryFunction;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.IFunction;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class BinaryFunction extends BinaryElement implements IFunction {
|
||||
public class BinaryFunction extends BinaryElement implements IBinaryFunction {
|
||||
|
||||
public BinaryFunction(ICElement parent, String name, long a) {
|
||||
super(parent, name, ICElement.C_FUNCTION, a);
|
||||
|
|
|
@ -19,6 +19,7 @@ import org.eclipse.cdt.core.model.IBinaryElement;
|
|||
import org.eclipse.cdt.core.model.IBinaryModule;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
||||
|
@ -26,11 +27,11 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
|||
*/
|
||||
public class BinaryModule extends Parent implements IBinaryModule {
|
||||
|
||||
IPath path;
|
||||
IPath fPath;
|
||||
|
||||
public BinaryModule(Binary parent, IPath p) {
|
||||
super(parent, p.lastSegment(), ICElement.C_VCONTAINER);
|
||||
path = p;
|
||||
fPath = p;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -61,6 +62,11 @@ public class BinaryModule extends Parent implements IBinaryModule {
|
|||
* @see org.eclipse.cdt.core.model.ICElement#getResource()
|
||||
*/
|
||||
public IResource getResource() {
|
||||
IWorkspaceRoot root = getCModel().getWorkspace().getRoot();
|
||||
IPath path = getPath();
|
||||
if (path != null) {
|
||||
return root.getFileForLocation(fPath);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -82,7 +88,7 @@ public class BinaryModule extends Parent implements IBinaryModule {
|
|||
* @see org.eclipse.cdt.core.model.ICElement#getPath()
|
||||
*/
|
||||
public IPath getPath() {
|
||||
return path;
|
||||
return fPath;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
Loading…
Add table
Reference in a new issue