Package org.eclipse.cdt.core.dom.ast
Interface IASTFileLocation
- All Superinterfaces:
IASTNodeLocation
- All Known Subinterfaces:
IASTImageLocation
Represents a node location that is directly in the source file.
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNodeLocation
EMPTY_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionReturns the inclusion statement that included this file, ornullfor a top-level file.intReturns the ending line number.The name of the file.intReturns the length of this location in terms of characters.intReturns the offset within the file where this location starts.intReturns the starting line number.Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNodeLocation
asFileLocation
-
Method Details
-
getFileName
String getFileName()The name of the file. Should not be null.- Returns:
- the name of the file
-
getNodeOffset
int getNodeOffset()Returns the offset within the file where this location starts.- Specified by:
getNodeOffsetin interfaceIASTNodeLocation
-
getNodeLength
int getNodeLength()Returns the length of this location in terms of characters.- Specified by:
getNodeLengthin interfaceIASTNodeLocation
-
getStartingLineNumber
int getStartingLineNumber()Returns the starting line number. Locations obtained via the index do not have line numbers and return0.- Returns:
- the 1-based line number, or
0if not applicable
-
getEndingLineNumber
int getEndingLineNumber()Returns the ending line number. Locations obtained via the index do not have line numbers and return0.- Returns:
- the 1-based line number, or
0if not applicable
-
getContextInclusionStatement
IASTPreprocessorIncludeStatement getContextInclusionStatement()Returns the inclusion statement that included this file, ornullfor a top-level file. Alsonullwhen the file location does not belong to an AST node, e.g. if it is obtained from a name in the index.- Since:
- 5.4
-