1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Related to bug 169847, additional protected method for PDOMWriter.

This commit is contained in:
Markus Schorn 2007-03-27 08:43:53 +00:00
parent ea528b7933
commit 9ba29c31e8
2 changed files with 16 additions and 3 deletions

View file

@ -83,7 +83,8 @@ abstract public class PDOMWriter {
* Extracts symbols from the given ast and adds them to the index. It will * Extracts symbols from the given ast and adds them to the index. It will
* make calls to * make calls to
* {@link #needToUpdate(IIndexFileLocation)}, * {@link #needToUpdate(IIndexFileLocation)},
* {@link #postAddToIndex(IIndexFileLocation, IIndexFile)} and * {@link #postAddToIndex(IIndexFileLocation, IIndexFile)},
* {@link #getLastModified(IIndexFileLocation)} and
* {@link #findLocation(String)} to obtain further information. * {@link #findLocation(String)} to obtain further information.
* @since 4.0 * @since 4.0
*/ */
@ -253,7 +254,7 @@ abstract public class PDOMWriter {
} else { } else {
file= index.addFile(location); file= index.addFile(location);
} }
file.setTimestamp(EFS.getStore(location.getURI()).fetchInfo().getLastModified()); file.setTimestamp(getLastModified(location));
ArrayList[] lists= (ArrayList[]) symbolMap.get(location); ArrayList[] lists= (ArrayList[]) symbolMap.get(location);
if (lists != null) { if (lists != null) {
ArrayList list= lists[0]; ArrayList list= lists[0];
@ -293,4 +294,15 @@ abstract public class PDOMWriter {
fInfo.fTotalSourcesEstimate+= totalEstimate; fInfo.fTotalSourcesEstimate+= totalEstimate;
} }
} }
/**
* Obtains the timestamp of an index file location.
* @param location the location for which the timestamp is obtained.
* @return the timestamp.
* @throws CoreException
* @since 4.0
*/
protected long getLastModified(IIndexFileLocation location) throws CoreException {
return EFS.getStore(location.getURI()).fetchInfo().getLastModified();
}
} }

View file

@ -107,7 +107,8 @@ public abstract class PDOMIndexerTask extends PDOMWriter implements IPDOMIndexer
* {@link #createAST(ITranslationUnit, IProgressMonitor)}, * {@link #createAST(ITranslationUnit, IProgressMonitor)},
* {@link #needToUpdate(IIndexFileLocation)}, * {@link #needToUpdate(IIndexFileLocation)},
* {@link #addSymbols(IASTTranslationUnit, IWritableIndex, int, IProgressMonitor)} * {@link #addSymbols(IASTTranslationUnit, IWritableIndex, int, IProgressMonitor)}
* {@link #postAddToIndex(IIndexFileLocation, IIndexFile)} and * {@link #postAddToIndex(IIndexFileLocation, IIndexFile)},
* {@link #getLastModified(IIndexFileLocation)} and
* {@link #findLocation(String)} * {@link #findLocation(String)}
* @since 4.0 * @since 4.0
*/ */