mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 21:35:40 +02:00
remove ICFile and ICResource.
This commit is contained in:
parent
48d23480f7
commit
523ed3b82d
7 changed files with 15 additions and 128 deletions
|
@ -1,13 +0,0 @@
|
||||||
package org.eclipse.cdt.core.model;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A C File Resource.
|
|
||||||
*/
|
|
||||||
public interface ICFile extends ICElement {
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
/*
|
|
||||||
* (c) Copyright QNX Software System Ltd. 2002.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.eclipse.cdt.core.model;
|
|
||||||
|
|
||||||
|
|
||||||
public interface ICResource extends IParent, ICElement, IOpenable {
|
|
||||||
}
|
|
|
@ -1,8 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Created on Mar 30, 2003
|
* (c) Copyright IBM Corp. 2000, 2001.
|
||||||
*
|
* All Rights Reserved.
|
||||||
* To change the template for this generated file go to
|
|
||||||
* Window>Preferences>Java>Code Generation>Code and Comments
|
|
||||||
*/
|
*/
|
||||||
package org.eclipse.cdt.internal.core.model;
|
package org.eclipse.cdt.internal.core.model;
|
||||||
|
|
||||||
|
@ -19,10 +17,6 @@ import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author alain
|
|
||||||
*
|
|
||||||
* To change the template for this generated type comment go to
|
|
||||||
* Window>Preferences>Java>Code Generation>Code and Comments
|
|
||||||
*/
|
*/
|
||||||
public class BinaryElement extends CElement implements IBinaryElement, ISourceManipulation, ISourceReference {
|
public class BinaryElement extends CElement implements IBinaryElement, ISourceManipulation, ISourceReference {
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,6 @@ import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.core.model.IFunction;
|
import org.eclipse.cdt.core.model.IFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author alain
|
|
||||||
*
|
|
||||||
* To change the template for this generated type comment go to
|
|
||||||
* Window>Preferences>Java>Code Generation>Code and Comments
|
|
||||||
*/
|
*/
|
||||||
public class BinaryFunction extends BinaryElement implements IFunction {
|
public class BinaryFunction extends BinaryElement implements IFunction {
|
||||||
|
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
package org.eclipse.cdt.internal.core.model;
|
|
||||||
/*
|
|
||||||
* (c) Copyright IBM Corp. 2000, 2001.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.CModelException;
|
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
|
||||||
import org.eclipse.cdt.core.model.ICFile;
|
|
||||||
import org.eclipse.core.resources.IFile;
|
|
||||||
import org.eclipse.core.resources.IResource;
|
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
|
||||||
|
|
||||||
public class CFile extends CElement implements ICFile {
|
|
||||||
|
|
||||||
IFile file;
|
|
||||||
|
|
||||||
IPath location;
|
|
||||||
|
|
||||||
public CFile(ICElement parent, IFile file){
|
|
||||||
//this (parent, file, ICElement.C_FILE);
|
|
||||||
this(parent, file, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public CFile(ICElement parent, IFile file, int type) {
|
|
||||||
this(parent, file, file.getLocation(), file.getName(), type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public CFile(ICElement parent, IFile file, String name, int type) {
|
|
||||||
this(parent, file, file.getLocation(), name, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public CFile(ICElement parent, IPath location, int type) {
|
|
||||||
this(parent, ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(location),
|
|
||||||
location, location.lastSegment(), type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public CFile(ICElement parent, IFile res, IPath location, String name, int type) {
|
|
||||||
super(parent, name, type);
|
|
||||||
this.location = location;
|
|
||||||
file = res;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IPath getLocation () {
|
|
||||||
return location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLocation(IPath location) {
|
|
||||||
this.location = location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IFile getFile () {
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected CFileInfo getCFileInfo() {
|
|
||||||
return (CFileInfo)getElementInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected CElementInfo createElementInfo () {
|
|
||||||
return new CFileInfo(this);
|
|
||||||
}
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.model.ICElement#getResource()
|
|
||||||
*/
|
|
||||||
public IResource getResource() {
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.model.ICElement#getUnderlyingResource()
|
|
||||||
*/
|
|
||||||
public IResource getUnderlyingResource() throws CModelException {
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -11,10 +11,6 @@ import org.eclipse.cdt.core.IBinaryParser;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author alain
|
|
||||||
*
|
|
||||||
* To change this generated comment go to
|
|
||||||
* Window>Preferences>Java>Code Generation>Code and Comments
|
|
||||||
*/
|
*/
|
||||||
public class NullBinaryParser implements IBinaryParser {
|
public class NullBinaryParser implements IBinaryParser {
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,14 @@ package org.eclipse.cdt.internal.core.model;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.eclipse.core.resources.IFile;
|
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
|
||||||
import org.eclipse.cdt.core.model.ISourceRange;
|
|
||||||
import org.eclipse.cdt.core.model.ICModelStatusConstants;
|
|
||||||
import org.eclipse.cdt.core.model.CModelException;
|
import org.eclipse.cdt.core.model.CModelException;
|
||||||
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
|
import org.eclipse.cdt.core.model.ICModelStatusConstants;
|
||||||
|
import org.eclipse.cdt.core.model.ISourceRange;
|
||||||
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
|
import org.eclipse.core.resources.IFile;
|
||||||
|
import org.eclipse.core.resources.IResource;
|
||||||
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Element info for ISourceReference elements.
|
* Element info for ISourceReference elements.
|
||||||
|
@ -46,10 +46,12 @@ class SourceManipulationInfo extends CElementInfo {
|
||||||
ITranslationUnit tu = getTranslationUnit();
|
ITranslationUnit tu = getTranslationUnit();
|
||||||
if (tu != null) {
|
if (tu != null) {
|
||||||
try {
|
try {
|
||||||
IFile file = ((CFile)tu).getFile();
|
IResource res = tu.getResource();
|
||||||
StringBuffer buffer = Util.getContent(file);
|
if (res != null && res instanceof IFile) {
|
||||||
|
StringBuffer buffer = Util.getContent((IFile)res);
|
||||||
return buffer.substring(getElement().getStartPos(),
|
return buffer.substring(getElement().getStartPos(),
|
||||||
getElement().getStartPos() + getElement().getLength());
|
getElement().getStartPos() + getElement().getLength());
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION);
|
throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue