CIndex

org.eclipse.cdt.core.CIndex

4.0

This extension point groups extensions to the index functionality in CDT

<!ELEMENT extension (ExportProjectProvider | ReadOnlyPDOMProvider)+>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT ExportProjectProvider EMPTY>

<!ATTLIST ExportProjectProvider

class CDATA #REQUIRED>

ExportProjectProvider

This subelement of CIndex allows contribution of alternate IExportProjectProvider implementations. These can then be referenced by fully qualified class name in the command line tool (see option -pprovider).

Invoking the application as a headless application This example ant file shows how to invoke the tool headlessly, the same approach would work from a shell or batch file.

<project name=

"Generate PDOM"

default=

"generate"

>

<target name=

"generate"

>

<!-- This script shows how to invoke the default project provider (ExternalExportProjectProvider) -->

<property name=

"pprovider"

value=

"org.eclipse.cdt.core.index.export.ExternalExportProjectProvider"

/>

<property name=

"target"

value=

"C:\ExportedPDOMs\acmeSDK_2_5.pdom"

/>

<!-- Where the output pdom is to go -->

<property name=

"source"

value=

"E:\AcmeSDK\v2.5\inc"

/>

<!-- e.g. the directory to source content from -->

<property name=

"id"

value=

"com.acme.mysdk.v2.5"

/>

<!-- the id to store in the generate pdom -->

<property name=

"eclipse.home"

value=

"C:\eclipse"

/>

<!-- e.g. The eclipse installation to use. This installation must contain CDT 4.0+ plugins -->

<java classname=

"org.eclipse.equinox.launcher.Main"

>

<classpath>

<fileset dir=

"${eclipse.home}/plugins"

>

<include name=

"*equinox.launcher*.jar"

/>

</fileset>

</classpath>

<arg value=

"-nosplash"

/>

<arg value=

"-exitdata"

/>

<arg value=

"-application"

/>

<arg value=

"org.eclipse.cdt.core.GeneratePDOM"

/>

<arg value=

"-pprovider"

/>

<arg value=

"${pprovider}"

/>

<arg value=

"-source"

/>

<arg value=

"${source}"

/>

<arg value=

"-target"

/>

<arg value=

"${target}"

/>

<arg value=

"-id"

/>

<arg value=

"${id}"

/>

</java>

</target>

</project>

Invoking the tool via an Eclipse Launch Configuration

Specify "org.eclipse.cdt.core.GeneratePDOM" as the application to launch

In the Argument tabs provide (for example) -target C:\ExportedPDOMs\acmeSDK_2_5.pdom -source E:\AcmeSDK\v2.5\inc -include E:\this.h -id com.acme.mysdk.v2.5



<!ELEMENT ReadOnlyPDOMProvider EMPTY>

<!ATTLIST ReadOnlyPDOMProvider

class CDATA #REQUIRED>

ReadOnlyPDOMProvider

This subelement of CIndex allows ISVs to contribute read-only prebuilt PDOM files to the CDT Index. The only information needed is the fully qualified class name of an implementatin of org.eclipse.cdt.core.index.IOfflinePDOMProvider. This implementation will be consulted during the eclipse session for the appropriate read-only content to make add to the logical index. The logical index is accessible via the org.eclipse.core.index.IIndex API. An example of contributing a prebuilt read-only pdom:

<CIndex>

<ReadOnlyPDOMProvider class=

"com.acme.ide.index.AcmeSDKProvider"

/>

</CIndex>

and the corresponding implementation
package com.acme.ide.index.sdk;

import org.eclipse.core.index.provider.IReadOnlyPDOMProvider;
import org.eclipse.core.index.provider.IPDOMDescriptor;
import org.eclipse.core.index.IIndexLocationConverter;
import org.eclipse.core.index.URIRelativeLocationConverter;

public class AcmeSDKProvider implements IReadOnlyPDOMProvider {
    public boolean providesFor(ICProject project) {
        // e.g. decide by looking for acme project nature
        return AcmeNature.isAcmeProject(project);
    }

    public IPDOMDescriptor[] getDescriptors(ICProject cproject, ICConfigurationDescription config) {
        final IPath sdkBase = AcmeSDKAPI.getSDKBase(cproject, config);
        return new IPDOMDescriptor[] { new IPDOMDescriptor() {
            public IIndexLocationConverter getIndexLocationConverter() {
                return new URIRelativeLocationConverter(URIUtil.toURI(sdkBase));
            }
            public IPath getLocation() {
                IPath path = sdkBase.append(AcmeSDKAPI.getPrebuiltPDOMFilename(config));
                return path;
            }
        }};
    }
}



See subelement documentation

Index content provided by ISVs under this extension point will be accessible via the logical index org.eclipse.core.index.IIndex API For export functionality, see package org.eclipse.cdt.core.index.export

[Enter information about supplied implementation of this extension point.]