Eclipse CDT
Pre-release 3.0

org.eclipse.cdt.core.model
Interface ISourceReference

All Known Subinterfaces:
IBinaryFunction, IBinaryVariable, IDeclaration, IEnumeration, IField, IFunction, IFunctionDeclaration, IFunctionTemplate, IFunctionTemplateDeclaration, IInclude, IMacro, IMember, IMethod, IMethodDeclaration, IMethodTemplate, IMethodTemplateDeclaration, INamespace, IStructure, IStructureDeclaration, IStructureTemplate, IStructureTemplateDeclaration, ITranslationUnit, ITypeDef, IUsing, IVariable, IVariableDeclaration, IWorkingCopy

public interface ISourceReference

Common protocol for C elements that have associated source code.

Note: For IBinary, IArchive and other members derived from a binary type, the implementation returns source iff the element has attached source code and debuging information.


Method Summary
 String getSource()
          Returns the source code associated with this element.
 ISourceRange getSourceRange()
          Returns the source range associated with this element.
 ITranslationUnit getTranslationUnit()
          Returns the translation unit in which this member is declared, or null if this member is not declared in a translation unit (for example, a binary type).
 

Method Detail

getSource

String getSource()
                 throws CModelException
Returns the source code associated with this element.

For binary files, this returns the source of the entire translation unit associated with the binary file (if there is one).

Returns:
the source code, or null if this element has no associated source code
Throws:
CModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource

getSourceRange

ISourceRange getSourceRange()
                            throws CModelException
Returns the source range associated with this element.

For binary files, this returns the range of the entire translation unit associated with the binary file (if there is one).

Returns:
the source range, or null if if this element has no associated source code
Throws:
CModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource

getTranslationUnit

ITranslationUnit getTranslationUnit()
Returns the translation unit in which this member is declared, or null if this member is not declared in a translation unit (for example, a binary type).

Returns:
Throws:
CModelException

Eclipse CDT
Pre-release 3.0

Copyright (c) IBM Corp. and others 2004. All Rights Reserved.