[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Removing ICFile and ICResource
|
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/ChangeLog,v
retrieving revision 1.80
diff -u -r1.80 ChangeLog
--- ChangeLog 31 Mar 2003 03:47:09 -0000 1.80
+++ ChangeLog 1 Apr 2003 16:54:36 -0000
@@ -1,3 +1,13 @@
+2003-04-01 Alain Magloire
+
+ Phasing out the classes ICResource and ICFile.
+ They were no longer part of the C Model.
+
+ * model/org/eclipse/cdt/core/model/ICFile.java:
+ * model/org/eclipse/cdt/core/mode/ICResource.java:
+ * model/org/eclipse/cdt/internal/core/model/CFile.java:
+ Removed.
+
2003-03-30 Alain Magloire
First phase of the rewrite on how we treat Binary/Archive in the CoreModel
Index: model/org/eclipse/cdt/core/model/ICFile.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/ICFile.java
diff -N model/org/eclipse/cdt/core/model/ICFile.java
--- model/org/eclipse/cdt/core/model/ICFile.java 27 Mar 2003 16:04:19 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -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 {
-}
Index: model/org/eclipse/cdt/core/model/ICResource.java
===================================================================
RCS file: model/org/eclipse/cdt/core/model/ICResource.java
diff -N model/org/eclipse/cdt/core/model/ICResource.java
--- model/org/eclipse/cdt/core/model/ICResource.java 27 Mar 2003 16:04:19 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -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 {
-}
Index: model/org/eclipse/cdt/internal/core/model/BinaryElement.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java,v
retrieving revision 1.1
diff -u -r1.1 BinaryElement.java
--- model/org/eclipse/cdt/internal/core/model/BinaryElement.java 31 Mar 2003 03:46:57 -0000 1.1
+++ model/org/eclipse/cdt/internal/core/model/BinaryElement.java 1 Apr 2003 16:54:36 -0000
@@ -1,8 +1,6 @@
/*
- * Created on Mar 30, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
*/
package org.eclipse.cdt.internal.core.model;
@@ -19,10 +17,6 @@
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 {
Index: model/org/eclipse/cdt/internal/core/model/BinaryFunction.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java,v
retrieving revision 1.1
diff -u -r1.1 BinaryFunction.java
--- model/org/eclipse/cdt/internal/core/model/BinaryFunction.java 31 Mar 2003 03:46:57 -0000 1.1
+++ model/org/eclipse/cdt/internal/core/model/BinaryFunction.java 1 Apr 2003 16:54:36 -0000
@@ -9,10 +9,6 @@
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 {
Index: model/org/eclipse/cdt/internal/core/model/CFile.java
===================================================================
RCS file: model/org/eclipse/cdt/internal/core/model/CFile.java
diff -N model/org/eclipse/cdt/internal/core/model/CFile.java
--- model/org/eclipse/cdt/internal/core/model/CFile.java 27 Mar 2003 17:33:05 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -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;
- }
-
-}
Index: model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java,v
retrieving revision 1.1
diff -u -r1.1 NullBinaryParser.java
--- model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java 28 Feb 2003 21:29:38 -0000 1.1
+++ model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java 1 Apr 2003 16:54:36 -0000
@@ -11,10 +11,6 @@
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 {
Index: model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java,v
retrieving revision 1.3
diff -u -r1.3 SourceManipulationInfo.java
--- model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java 27 Mar 2003 16:05:18 -0000 1.3
+++ model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java 1 Apr 2003 16:54:36 -0000
@@ -7,14 +7,14 @@
import java.io.IOException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-
+import org.eclipse.cdt.core.model.CModelException;
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.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.
@@ -46,10 +46,12 @@
ITranslationUnit tu = getTranslationUnit();
if (tu != null) {
try {
- IFile file = ((CFile)tu).getFile();
- StringBuffer buffer = Util.getContent(file);
- return buffer.substring(getElement().getStartPos(),
- getElement().getStartPos() + getElement().getLength());
+ IResource res = tu.getResource();
+ if (res != null && res instanceof IFile) {
+ StringBuffer buffer = Util.getContent((IFile)res);
+ return buffer.substring(getElement().getStartPos(),
+ getElement().getStartPos() + getElement().getLength());
+ }
} catch (IOException e) {
throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION);
}