Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Getting translation unit from ICProject

Hi,
Can someone tell me how to get ITranslationUnit from an ICproject?
The project contain multiple C files and is indexed. However, I am just unable to get the translation unit for the files in the project.

Here is the code I am using

IPath filePath = new Path("\\Test Project 10\\src\\Arrays.c");
ICElement element = icdtProject.findElement(filePath);
ITranslationUnit unit = (ITranslationUnit)element;

This throws exception in line 2. However, Arrays.c is one of the file in the project. I will be extremely thankful if someone helps in this case.


Thanks

Regards,
Muhammad Hamiz Ahmed

Back to the top