Package org.eclipse.cdt.core.model
Interface ISourceReference
-
- All Known Subinterfaces:
IAsmLabel,IBinaryFunction,IBinaryVariable,IDeclaration,IEnumeration,IEnumerator,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 ISourceReferenceCommon protocol for C elements that have associated source code.Note: For
IBinary,IArchiveand other members derived from a binary type, the implementation returns source iff the element has attached source code and debugging information.- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetIndex()Allows to differentiate otherwise equal elements of the same file.StringgetSource()Returns the source code associated with this element.ISourceRangegetSourceRange()Returns the source range associated with this element.ITranslationUnitgetTranslationUnit()Returns the translation unit in which this member is declared, ornullif this member is not declared in a translation unit (for example, a binary type).booleanisActive()Returns whether this element is in active code.
-
-
-
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
nullif 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
nullif 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, ornullif this member is not declared in a translation unit (for example, a binary type).
-
isActive
boolean isActive()
Returns whether this element is in active code. Code is inactive when it is hidden by conditional compilation.- Since:
- 5.1
-
getIndex
int getIndex()
Allows to differentiate otherwise equal elements of the same file.- Since:
- 5.1
-
-