mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 07:15:39 +02:00
@Override annotations.
This commit is contained in:
parent
5a1f9d47a9
commit
565f58e365
3 changed files with 61 additions and 26 deletions
|
@ -20,7 +20,6 @@ import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -82,6 +81,7 @@ public class CIndex implements IIndex {
|
||||||
this(fragments, fragments.length);
|
this(fragments, fragments.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexBinding findBinding(IName name) throws CoreException {
|
public IIndexBinding findBinding(IName name) throws CoreException {
|
||||||
if (name instanceof IIndexFragmentName) {
|
if (name instanceof IIndexFragmentName) {
|
||||||
return adaptBinding(((IIndexFragmentName) name).getBinding());
|
return adaptBinding(((IIndexFragmentName) name).getBinding());
|
||||||
|
@ -100,11 +100,13 @@ public class CIndex implements IIndex {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexBinding[] findBindings(Pattern pattern, boolean isFullyQualified, IndexFilter filter,
|
public IIndexBinding[] findBindings(Pattern pattern, boolean isFullyQualified, IndexFilter filter,
|
||||||
IProgressMonitor monitor) throws CoreException {
|
IProgressMonitor monitor) throws CoreException {
|
||||||
return findBindings(new Pattern[] { pattern }, isFullyQualified, filter, monitor);
|
return findBindings(new Pattern[] { pattern }, isFullyQualified, filter, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexBinding[] findBindings(Pattern[] patterns, boolean isFullyQualified, IndexFilter filter,
|
public IIndexBinding[] findBindings(Pattern[] patterns, boolean isFullyQualified, IndexFilter filter,
|
||||||
IProgressMonitor monitor) throws CoreException {
|
IProgressMonitor monitor) throws CoreException {
|
||||||
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
||||||
|
@ -134,6 +136,7 @@ public class CIndex implements IIndex {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexBinding[] findMacroContainers(Pattern pattern, IndexFilter filter, IProgressMonitor monitor)
|
public IIndexBinding[] findMacroContainers(Pattern pattern, IndexFilter filter, IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
||||||
|
@ -163,6 +166,7 @@ public class CIndex implements IIndex {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexName[] findNames(IBinding binding, int flags) throws CoreException {
|
public IIndexName[] findNames(IBinding binding, int flags) throws CoreException {
|
||||||
LinkedList<IIndexFragmentName> result= new LinkedList<IIndexFragmentName>();
|
LinkedList<IIndexFragmentName> result= new LinkedList<IIndexFragmentName>();
|
||||||
if (binding instanceof ICPPUsingDeclaration) {
|
if (binding instanceof ICPPUsingDeclaration) {
|
||||||
|
@ -195,18 +199,22 @@ public class CIndex implements IIndex {
|
||||||
return result.toArray(new IIndexName[result.size()]);
|
return result.toArray(new IIndexName[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexName[] findDeclarations(IBinding binding) throws CoreException {
|
public IIndexName[] findDeclarations(IBinding binding) throws CoreException {
|
||||||
return findNames(binding, FIND_DECLARATIONS_DEFINITIONS);
|
return findNames(binding, FIND_DECLARATIONS_DEFINITIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexName[] findDefinitions(IBinding binding) throws CoreException {
|
public IIndexName[] findDefinitions(IBinding binding) throws CoreException {
|
||||||
return findNames(binding, FIND_DEFINITIONS);
|
return findNames(binding, FIND_DEFINITIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexName[] findReferences(IBinding binding) throws CoreException {
|
public IIndexName[] findReferences(IBinding binding) throws CoreException {
|
||||||
return findNames(binding, FIND_REFERENCES);
|
return findNames(binding, FIND_REFERENCES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public IIndexFile getFile(int linkageID, IIndexFileLocation location) throws CoreException {
|
public IIndexFile getFile(int linkageID, IIndexFileLocation location) throws CoreException {
|
||||||
for (int i = 0; i < fPrimaryFragmentCount; i++) {
|
for (int i = 0; i < fPrimaryFragmentCount; i++) {
|
||||||
|
@ -218,6 +226,7 @@ public class CIndex implements IIndex {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFile getFile(int linkageID, IIndexFileLocation location,
|
public IIndexFile getFile(int linkageID, IIndexFileLocation location,
|
||||||
ISignificantMacros significantMacros) throws CoreException {
|
ISignificantMacros significantMacros) throws CoreException {
|
||||||
for (int i = 0; i < fPrimaryFragmentCount; i++) {
|
for (int i = 0; i < fPrimaryFragmentCount; i++) {
|
||||||
|
@ -229,6 +238,7 @@ public class CIndex implements IIndex {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFile[] getFiles(int linkageID, IIndexFileLocation location) throws CoreException {
|
public IIndexFile[] getFiles(int linkageID, IIndexFileLocation location) throws CoreException {
|
||||||
if (location == null) {
|
if (location == null) {
|
||||||
return IIndexFile.EMPTY_FILE_ARRAY;
|
return IIndexFile.EMPTY_FILE_ARRAY;
|
||||||
|
@ -252,6 +262,7 @@ public class CIndex implements IIndex {
|
||||||
return result.toArray(new IIndexFile[result.size()]);
|
return result.toArray(new IIndexFile[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFile[] getFiles(IIndexFileLocation location) throws CoreException {
|
public IIndexFile[] getFiles(IIndexFileLocation location) throws CoreException {
|
||||||
if (location == null) {
|
if (location == null) {
|
||||||
return IIndexFile.EMPTY_FILE_ARRAY;
|
return IIndexFile.EMPTY_FILE_ARRAY;
|
||||||
|
@ -274,6 +285,7 @@ public class CIndex implements IIndex {
|
||||||
return result.toArray(new IIndexFile[result.size()]);
|
return result.toArray(new IIndexFile[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFile resolveInclude(IIndexInclude include) throws CoreException {
|
public IIndexFile resolveInclude(IIndexInclude include) throws CoreException {
|
||||||
IIndexFragmentInclude fragmentInclude = (IIndexFragmentInclude) include;
|
IIndexFragmentInclude fragmentInclude = (IIndexFragmentInclude) include;
|
||||||
IIndexFragmentFile result= fragmentInclude.getIncludes();
|
IIndexFragmentFile result= fragmentInclude.getIncludes();
|
||||||
|
@ -287,10 +299,12 @@ public class CIndex implements IIndex {
|
||||||
return getFile(result.getLinkageID(), result.getLocation(), result.getSignificantMacros());
|
return getFile(result.getLinkageID(), result.getLocation(), result.getSignificantMacros());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexInclude[] findIncludedBy(IIndexFile file) throws CoreException {
|
public IIndexInclude[] findIncludedBy(IIndexFile file) throws CoreException {
|
||||||
return findIncludedBy(file, 0);
|
return findIncludedBy(file, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexInclude[] findIncludedBy(IIndexFile file, int depth) throws CoreException {
|
public IIndexInclude[] findIncludedBy(IIndexFile file, int depth) throws CoreException {
|
||||||
List<IIndexInclude> result= new ArrayList<IIndexInclude>();
|
List<IIndexInclude> result= new ArrayList<IIndexInclude>();
|
||||||
findIncludedBy(file.getLinkageID(), Collections.singletonList(file), result, depth,
|
findIncludedBy(file.getLinkageID(), Collections.singletonList(file), result, depth,
|
||||||
|
@ -326,10 +340,12 @@ public class CIndex implements IIndex {
|
||||||
findIncludedBy(linkageID, nextLevel, out, depth, handled);
|
findIncludedBy(linkageID, nextLevel, out, depth, handled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexInclude[] findIncludes(IIndexFile file) throws CoreException {
|
public IIndexInclude[] findIncludes(IIndexFile file) throws CoreException {
|
||||||
return findIncludes(file, 0);
|
return findIncludes(file, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexInclude[] findIncludes(IIndexFile file, int depth) throws CoreException {
|
public IIndexInclude[] findIncludes(IIndexFile file, int depth) throws CoreException {
|
||||||
List<IIndexInclude> result= new ArrayList<IIndexInclude>();
|
List<IIndexInclude> result= new ArrayList<IIndexInclude>();
|
||||||
findIncludes(Collections.singletonList(file), result, depth, new HashSet<Object>());
|
findIncludes(Collections.singletonList(file), result, depth, new HashSet<Object>());
|
||||||
|
@ -365,6 +381,7 @@ public class CIndex implements IIndex {
|
||||||
findIncludes(nextLevel, out, depth, handled);
|
findIncludes(nextLevel, out, depth, handled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized void acquireReadLock() throws InterruptedException {
|
public synchronized void acquireReadLock() throws InterruptedException {
|
||||||
if (++fReadLock == 1) {
|
if (++fReadLock == 1) {
|
||||||
int i= 0;
|
int i= 0;
|
||||||
|
@ -384,6 +401,7 @@ public class CIndex implements IIndex {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized void releaseReadLock() {
|
public synchronized void releaseReadLock() {
|
||||||
if (--fReadLock == 0) {
|
if (--fReadLock == 0) {
|
||||||
for (IIndexFragment fragment : fFragments) {
|
for (IIndexFragment fragment : fFragments) {
|
||||||
|
@ -396,6 +414,7 @@ public class CIndex implements IIndex {
|
||||||
return fReadLock;
|
return fReadLock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean hasWaitingReaders() {
|
public boolean hasWaitingReaders() {
|
||||||
for (IIndexFragment fragment : fFragments) {
|
for (IIndexFragment fragment : fFragments) {
|
||||||
if (fragment.hasWaitingReaders()) {
|
if (fragment.hasWaitingReaders()) {
|
||||||
|
@ -405,6 +424,7 @@ public class CIndex implements IIndex {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getLastWriteAccess() {
|
public long getLastWriteAccess() {
|
||||||
long result= 0;
|
long result= 0;
|
||||||
for (IIndexFragment fragment : fFragments) {
|
for (IIndexFragment fragment : fFragments) {
|
||||||
|
@ -413,6 +433,7 @@ public class CIndex implements IIndex {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexBinding[] findBindings(char[][] names, IndexFilter filter, IProgressMonitor monitor)
|
public IIndexBinding[] findBindings(char[][] names, IndexFilter filter, IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
||||||
|
@ -449,10 +470,10 @@ public class CIndex implements IIndex {
|
||||||
}
|
}
|
||||||
monitor.done();
|
monitor.done();
|
||||||
return flatten(result);
|
return flatten(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexBinding adaptBinding(IBinding binding) {
|
public IIndexBinding adaptBinding(IBinding binding) {
|
||||||
try {
|
try {
|
||||||
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
||||||
|
@ -471,6 +492,7 @@ public class CIndex implements IIndex {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexBinding[] findBindings(char[] name, IndexFilter filter, IProgressMonitor monitor)
|
public IIndexBinding[] findBindings(char[] name, IndexFilter filter, IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
return findBindings(name, true, filter, monitor);
|
return findBindings(name, true, filter, monitor);
|
||||||
|
@ -550,6 +572,7 @@ public class CIndex implements IIndex {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexBinding[] findBindingsForPrefix(char[] prefix, boolean filescope, IndexFilter filter,
|
public IIndexBinding[] findBindingsForPrefix(char[] prefix, boolean filescope, IndexFilter filter,
|
||||||
IProgressMonitor monitor) throws CoreException {
|
IProgressMonitor monitor) throws CoreException {
|
||||||
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
||||||
|
@ -579,6 +602,7 @@ public class CIndex implements IIndex {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexBinding[] findBindingsForContentAssist(char[] prefix, boolean filescope,
|
public IIndexBinding[] findBindingsForContentAssist(char[] prefix, boolean filescope,
|
||||||
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
||||||
|
@ -608,6 +632,7 @@ public class CIndex implements IIndex {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexBinding[] findBindings(char[] name, boolean filescope, IndexFilter filter, IProgressMonitor monitor)
|
public IIndexBinding[] findBindings(char[] name, boolean filescope, IndexFilter filter, IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
||||||
|
@ -637,10 +662,12 @@ public class CIndex implements IIndex {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexMacro[] findMacros(char[] name, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
public IIndexMacro[] findMacros(char[] name, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
return findMacros(name, false, true, filter, monitor);
|
return findMacros(name, false, true, filter, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexMacro[] findMacrosForPrefix(char[] name, IndexFilter filter, IProgressMonitor monitor)
|
public IIndexMacro[] findMacrosForPrefix(char[] name, IndexFilter filter, IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
return findMacros(name, true, false, filter, monitor);
|
return findMacros(name, true, false, filter, monitor);
|
||||||
|
@ -648,7 +675,7 @@ public class CIndex implements IIndex {
|
||||||
|
|
||||||
private IIndexMacro[] findMacros(char[] name, boolean isPrefix, boolean caseSensitive,
|
private IIndexMacro[] findMacros(char[] name, boolean isPrefix, boolean caseSensitive,
|
||||||
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
// macros can be represented multiple times when a header is parsed in c- and c++ context,
|
// Macros can be represented multiple times when a header is parsed in c- and c++ context,
|
||||||
// so there is no special case for indexes with single fragments.
|
// so there is no special case for indexes with single fragments.
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor= new NullProgressMonitor();
|
monitor= new NullProgressMonitor();
|
||||||
|
@ -708,10 +735,12 @@ public class CIndex implements IIndex {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFileSet createFileSet() {
|
public IIndexFileSet createFileSet() {
|
||||||
return new IndexFileSet();
|
return new IndexFileSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFile[] getAllFiles() throws CoreException {
|
public IIndexFile[] getAllFiles() throws CoreException {
|
||||||
HashMap<IIndexFileLocation, IIndexFile> result= new HashMap<IIndexFileLocation, IIndexFile>();
|
HashMap<IIndexFileLocation, IIndexFile> result= new HashMap<IIndexFileLocation, IIndexFile>();
|
||||||
for (IIndexFragment fragment : fFragments) {
|
for (IIndexFragment fragment : fFragments) {
|
||||||
|
@ -724,9 +753,7 @@ public class CIndex implements IIndex {
|
||||||
return result.values().toArray(new IIndexFile[result.size()]);
|
return result.values().toArray(new IIndexFile[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see org.eclipse.cdt.core.index.IIndex#getInlineNamespaces()
|
|
||||||
*/
|
|
||||||
public IIndexScope[] getInlineNamespaces() throws CoreException {
|
public IIndexScope[] getInlineNamespaces() throws CoreException {
|
||||||
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
if (SPECIALCASE_SINGLES && fFragments.length == 1) {
|
||||||
return fFragments[0].getInlineNamespaces();
|
return fFragments[0].getInlineNamespaces();
|
||||||
|
@ -740,7 +767,8 @@ public class CIndex implements IIndex {
|
||||||
arr[j]= (IIndexFragmentBinding) raw[j].getScopeBinding();
|
arr[j]= (IIndexFragmentBinding) raw[j].getScopeBinding();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IIndexBinding[] compBinding = getCompositesFactory(ILinkage.CPP_LINKAGE_ID).getCompositeBindings(preresult);
|
IIndexBinding[] compBinding =
|
||||||
|
getCompositesFactory(ILinkage.CPP_LINKAGE_ID).getCompositeBindings(preresult);
|
||||||
IIndexScope[] result = new IIndexScope[compBinding.length];
|
IIndexScope[] result = new IIndexScope[compBinding.length];
|
||||||
for (int i = 0; i < result.length; i++) {
|
for (int i = 0; i < result.length; i++) {
|
||||||
result[i]= (IIndexScope) ((ICPPNamespace) compBinding[i]).getNamespaceScope();
|
result[i]= (IIndexScope) ((ICPPNamespace) compBinding[i]).getNamespaceScope();
|
||||||
|
|
|
@ -28,26 +28,16 @@ public class IndexFileLocation implements IIndexFileLocation {
|
||||||
this.fullPath = fullPath;
|
this.fullPath = fullPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
@Override
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.index.IIndexFileLocation#getFullPath()
|
|
||||||
*/
|
|
||||||
public String getFullPath() {
|
public String getFullPath() {
|
||||||
return fullPath;
|
return fullPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
@Override
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.index.IIndexFileLocation#getURI()
|
|
||||||
*/
|
|
||||||
public URI getURI() {
|
public URI getURI() {
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof IIndexFileLocation) {
|
if (obj instanceof IIndexFileLocation) {
|
||||||
|
@ -56,10 +46,6 @@ public class IndexFileLocation implements IIndexFileLocation {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return uri.hashCode();
|
return uri.hashCode();
|
||||||
|
|
|
@ -89,6 +89,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
this.db = db;
|
this.db = db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int compare(long record1, long record2) throws CoreException {
|
public int compare(long record1, long record2) throws CoreException {
|
||||||
IString name1 = db.getString(db.getRecPtr(record1 + LOCATION_REPRESENTATION));
|
IString name1 = db.getString(db.getRecPtr(record1 + LOCATION_REPRESENTATION));
|
||||||
IString name2 = db.getString(db.getRecPtr(record2 + LOCATION_REPRESENTATION));
|
IString name2 = db.getString(db.getRecPtr(record2 + LOCATION_REPRESENTATION));
|
||||||
|
@ -215,6 +216,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
sourceFile.delete();
|
sourceFile.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void transferIncluders(IIndexFragmentFile sourceFile) throws CoreException {
|
public void transferIncluders(IIndexFragmentFile sourceFile) throws CoreException {
|
||||||
PDOMFile source= (PDOMFile) sourceFile;
|
PDOMFile source= (PDOMFile) sourceFile;
|
||||||
PDOMInclude include = source.getFirstIncludedBy();
|
PDOMInclude include = source.getFirstIncludedBy();
|
||||||
|
@ -239,6 +241,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void transferContext(IIndexFragmentFile sourceFile) throws CoreException {
|
public void transferContext(IIndexFragmentFile sourceFile) throws CoreException {
|
||||||
PDOMFile source= (PDOMFile) sourceFile;
|
PDOMFile source= (PDOMFile) sourceFile;
|
||||||
PDOMInclude include = source.getFirstIncludedBy();
|
PDOMInclude include = source.getFirstIncludedBy();
|
||||||
|
@ -288,49 +291,59 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
location= null;
|
location= null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getLinkageID() throws CoreException {
|
public int getLinkageID() throws CoreException {
|
||||||
Database db = fLinkage.getDB();
|
Database db = fLinkage.getDB();
|
||||||
return db.get3ByteUnsignedInt(record + LINKAGE_ID);
|
return db.get3ByteUnsignedInt(record + LINKAGE_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getTimestamp() throws CoreException {
|
public long getTimestamp() throws CoreException {
|
||||||
Database db = fLinkage.getDB();
|
Database db = fLinkage.getDB();
|
||||||
return db.getLong(record + TIME_STAMP);
|
return db.getLong(record + TIME_STAMP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setTimestamp(long timestamp) throws CoreException {
|
public void setTimestamp(long timestamp) throws CoreException {
|
||||||
Database db= fLinkage.getDB();
|
Database db= fLinkage.getDB();
|
||||||
db.putLong(record + TIME_STAMP, timestamp);
|
db.putLong(record + TIME_STAMP, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getContentsHash() throws CoreException {
|
public long getContentsHash() throws CoreException {
|
||||||
Database db = fLinkage.getDB();
|
Database db = fLinkage.getDB();
|
||||||
return db.getLong(record + CONTENT_HASH);
|
return db.getLong(record + CONTENT_HASH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setContentsHash(long hash) throws CoreException {
|
public void setContentsHash(long hash) throws CoreException {
|
||||||
Database db= fLinkage.getDB();
|
Database db= fLinkage.getDB();
|
||||||
db.putLong(record + CONTENT_HASH, hash);
|
db.putLong(record + CONTENT_HASH, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getScannerConfigurationHashcode() throws CoreException {
|
public int getScannerConfigurationHashcode() throws CoreException {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getEncodingHashcode() throws CoreException {
|
public int getEncodingHashcode() throws CoreException {
|
||||||
Database db = fLinkage.getDB();
|
Database db = fLinkage.getDB();
|
||||||
return db.getInt(record + ENCODING_HASH);
|
return db.getInt(record + ENCODING_HASH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setEncodingHashcode(int hashcode) throws CoreException {
|
public void setEncodingHashcode(int hashcode) throws CoreException {
|
||||||
Database db= fLinkage.getDB();
|
Database db= fLinkage.getDB();
|
||||||
db.putInt(record + ENCODING_HASH, hashcode);
|
db.putInt(record + ENCODING_HASH, hashcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean hasPragmaOnceSemantics() throws CoreException {
|
public boolean hasPragmaOnceSemantics() throws CoreException {
|
||||||
return (fLinkage.getDB().getByte(record + FLAGS) & FLAG_PRAGMA_ONCE_SEMANTICS) != 0;
|
return (fLinkage.getDB().getByte(record + FLAGS) & FLAG_PRAGMA_ONCE_SEMANTICS) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setPragmaOnceSemantics(boolean value) throws CoreException {
|
public void setPragmaOnceSemantics(boolean value) throws CoreException {
|
||||||
Database db = fLinkage.getDB();
|
Database db = fLinkage.getDB();
|
||||||
byte flags = db.getByte(record + FLAGS);
|
byte flags = db.getByte(record + FLAGS);
|
||||||
|
@ -377,6 +390,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
return rec != 0 ? new PDOMInclude(fLinkage, rec) : null;
|
return rec != 0 ? new PDOMInclude(fLinkage, rec) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexInclude getParsedInContext() throws CoreException {
|
public IIndexInclude getParsedInContext() throws CoreException {
|
||||||
return getFirstIncludedBy();
|
return getFirstIncludedBy();
|
||||||
}
|
}
|
||||||
|
@ -613,6 +627,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexInclude[] getIncludes() throws CoreException {
|
public IIndexInclude[] getIncludes() throws CoreException {
|
||||||
List<PDOMInclude> result= new ArrayList<PDOMInclude>();
|
List<PDOMInclude> result= new ArrayList<PDOMInclude>();
|
||||||
PDOMInclude include = getFirstInclude();
|
PDOMInclude include = getFirstInclude();
|
||||||
|
@ -623,6 +638,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
return result.toArray(new IIndexInclude[result.size()]);
|
return result.toArray(new IIndexInclude[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexMacro[] getMacros() throws CoreException {
|
public IIndexMacro[] getMacros() throws CoreException {
|
||||||
List<PDOMMacro> result= new ArrayList<PDOMMacro>();
|
List<PDOMMacro> result= new ArrayList<PDOMMacro>();
|
||||||
PDOMMacro macro = getFirstMacro();
|
PDOMMacro macro = getFirstMacro();
|
||||||
|
@ -633,10 +649,12 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
return result.toArray(new IIndexMacro[result.size()]);
|
return result.toArray(new IIndexMacro[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragment getIndexFragment() {
|
public IIndexFragment getIndexFragment() {
|
||||||
return fLinkage.getPDOM();
|
return fLinkage.getPDOM();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexName[] findNames(int offset, int length) throws CoreException {
|
public IIndexName[] findNames(int offset, int length) throws CoreException {
|
||||||
ArrayList<IIndexName> result= new ArrayList<IIndexName>();
|
ArrayList<IIndexName> result= new ArrayList<IIndexName>();
|
||||||
for (PDOMName name= getFirstName(); name != null; name= name.getNextInFile()) {
|
for (PDOMName name= getFirstName(); name != null; name= name.getNextInFile()) {
|
||||||
|
@ -788,6 +806,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
return records;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int compare(long record) throws CoreException {
|
public int compare(long record) throws CoreException {
|
||||||
IString name = db.getString(db.getRecPtr(record + PDOMFile.LOCATION_REPRESENTATION));
|
IString name = db.getString(db.getRecPtr(record + PDOMFile.LOCATION_REPRESENTATION));
|
||||||
int cmp= name.compare(rawKey, true);
|
int cmp= name.compare(rawKey, true);
|
||||||
|
@ -810,6 +829,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
return rec != 0 ? db.getString(rec) : null;
|
return rec != 0 ? db.getString(rec) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean visit(long record) throws CoreException {
|
public boolean visit(long record) throws CoreException {
|
||||||
if (rawSignificantMacros != null) {
|
if (rawSignificantMacros != null) {
|
||||||
this.record = record;
|
this.record = record;
|
||||||
|
@ -836,6 +856,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFileLocation getLocation() throws CoreException {
|
public IIndexFileLocation getLocation() throws CoreException {
|
||||||
if (location == null) {
|
if (location == null) {
|
||||||
Database db = fLinkage.getDB();
|
Database db = fLinkage.getDB();
|
||||||
|
@ -856,6 +877,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public ISignificantMacros getSignificantMacros() throws CoreException {
|
public ISignificantMacros getSignificantMacros() throws CoreException {
|
||||||
if (sigMacros == null) {
|
if (sigMacros == null) {
|
||||||
Database db= fLinkage.getDB();
|
Database db= fLinkage.getDB();
|
||||||
|
@ -865,6 +887,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
return sigMacros;
|
return sigMacros;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean hasContent() throws CoreException {
|
public boolean hasContent() throws CoreException {
|
||||||
return getTimestamp() != -1;
|
return getTimestamp() != -1;
|
||||||
}
|
}
|
||||||
|
@ -890,9 +913,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
fLinkage.getDB().putRecPtr(record + LAST_USING_DIRECTIVE, rec);
|
fLinkage.getDB().putRecPtr(record + LAST_USING_DIRECTIVE, rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see org.eclipse.cdt.core.index.IIndexFile#getUsingDirectives()
|
|
||||||
*/
|
|
||||||
public ICPPUsingDirective[] getUsingDirectives() throws CoreException {
|
public ICPPUsingDirective[] getUsingDirectives() throws CoreException {
|
||||||
return fLinkage.getUsingDirectives(this);
|
return fLinkage.getUsingDirectives(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue