public class IndexLocationFactory extends Object
Constructor and Description |
---|
IndexLocationFactory() |
Modifier and Type | Method and Description |
---|---|
static org.eclipse.core.runtime.IPath |
getAbsolutePath(IIndexFileLocation location)
Returns the absolute file path of a location, or
null
if the location is not a file-system path. |
static IIndexFileLocation |
getExternalIFL(org.eclipse.core.runtime.IPath absolutePath)
Returns an IIndexFileLocation for the specified absolute path, with no associated full path.
|
static IIndexFileLocation |
getExternalIFL(String absolutePath)
Returns an IIndexFileLocation for the specified absolute path, with no associated full path.
|
static IIndexFileLocation |
getIFL(ITranslationUnit tu)
Returns
a workspace IIndexFileLocation if the translation unit has an associated resource
an external IIndexFileLocation if the translation unit does not have an associated resource
null, in any other case
|
static IIndexFileLocation |
getIFLExpensive(ICProject cproject,
String absolutePath)
Returns an IIndexFileLocation by searching the workspace for resources that are mapped
onto the specified absolute path.
|
static IIndexFileLocation |
getIFLExpensive(String absolutePath)
Equivalent to the overloaded form with the ICProject parameter set to null
|
static org.eclipse.core.runtime.IPath |
getPath(IIndexFileLocation location)
Returns
the full path if this IIndexFileLocation is within the workspace root
the absolute path if this IIndexFileLocation is URI based and corresponds
to a location on the local file system
otherwise, null
|
static IIndexFileLocation |
getWorkspaceIFL(org.eclipse.core.resources.IFile file)
Returns an IIndexFileLocation for the specified workspace file, or
null
if it does not have a location. |
public static org.eclipse.core.runtime.IPath getPath(IIndexFileLocation location)
location
- public static org.eclipse.core.runtime.IPath getAbsolutePath(IIndexFileLocation location)
null
if the location is not a file-system path.public static IIndexFileLocation getIFLExpensive(String absolutePath)
getIFLExpensive(ICProject, String)
public static IIndexFileLocation getIFLExpensive(ICProject cproject, String absolutePath)
If such a resource exists, an IIndexFileLocation that contains both the resource location URI, and the resources full path is created.
Otherwise, an IIndexFileLocation which contains the absolute path in URI form is returned.
N.B. As this searches the workspace, following links and potentially reading from alternate file systems, this method may be expensive.
cproject
- the ICProject to prefer when resolving external includes to workspace
resources (may be null)absolutePath
- public static IIndexFileLocation getExternalIFL(String absolutePath)
absolutePath
- public static IIndexFileLocation getExternalIFL(org.eclipse.core.runtime.IPath absolutePath)
absolutePath
- public static IIndexFileLocation getWorkspaceIFL(org.eclipse.core.resources.IFile file)
null
if it does not have a location.file
- public static IIndexFileLocation getIFL(ITranslationUnit tu)
tu
- Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.