Package org.eclipse.cdt.core.index

# Class URIRelativeLocationConverter

java.lang.Object
org.eclipse.cdt.core.index.URIRelativeLocationConverter

All Implemented Interfaces:
  `IIndexLocationConverter`

public class URIRelativeLocationConverter extends Object implements IIndexLocationConverter
A IIndexLocationConverter for converting relative paths within an index, by prefixing them with the supplied base URI.

Note: The supplied base URI must end with a forward slash
This location converter is internal-representation-compatible with ResourceContainerRelativeLocationConverter

Since:
  4.0

## Constructor Summary

Constructors
Constructor
Description
`URIRelativeLocationConverter(URI baseURI)`
Constructs an URIRelativeLocationConverter which will relative paths by prefixing the supplied base URI.

## Method Summary

Modifier and Type
Method
Description
`IIndexFileLocation`
`fromInternalFormat(String raw)`
Convert a raw string in an internal IIndexFragment implementation specific format to an IIndexFileLocation or null if the internal format could not be translated.
`String`
`toInternalFormat(IIndexFileLocation location)`
Convert a IIndexFileLocation to the internal IIndexFragment implementation specific format or null if the location could not be translated.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### URIRelativeLocationConverter

public URIRelativeLocationConverter(URI baseURI)
Constructs an URIRelativeLocationConverter which will relative paths by prefixing the supplied base URI.

Parameters:
  `baseURI` - the URI which will form the absolute base that relative paths are concatenated to. Note: It must end with a forward slash.

## Method Details

### fromInternalFormat

public IIndexFileLocation fromInternalFormat(String raw)
Description copied from interface: `IIndexLocationConverter`
Convert a raw string in an internal IIndexFragment implementation specific format to an IIndexFileLocation or null if the internal format could not be translated.

Specified by:
  `fromInternalFormat` in interface `IIndexLocationConverter`

### toInternalFormat

public String toInternalFormat(IIndexFileLocation location)
Description copied from interface: `IIndexLocationConverter`
Convert a IIndexFileLocation to the internal IIndexFragment implementation specific format or null if the location could not be translated.

Specified by:
  `toInternalFormat` in interface `IIndexLocationConverter`
Returns:
  an internal representation for the location specified