|
Eclipse CDT Pre-release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.core.search.DOMSearchUtil
public class DOMSearchUtil
Utility class to have commonly used algorithms in one place for searching with the DOM.
Nested Class Summary | |
---|---|
static class |
DOMSearchUtil.CNameCollector
The CNameCollector used to get IASTNames from an IASTNode. |
static class |
DOMSearchUtil.CPPNameCollector
The CPPNameCollector used to get IASTNames from an IASTNode. |
Constructor Summary | |
---|---|
DOMSearchUtil()
|
Method Summary | |
---|---|
static org.eclipse.cdt.core.parser.ParserLanguage |
getLanguage(IPath path,
IProject project)
Returns the ParserLanguage corresponding to the IPath and IProject. |
static org.eclipse.cdt.core.parser.ParserLanguage |
getLanguageFromFile(IFile file)
This retrieves the ParserLanguage from an IFile. |
static Set |
getMatchesFromSearchEngine(ICSearchScope scope,
IASTName searchName,
ICSearchConstants.LimitTo limitTo)
This is a convenience method that uses the SearchEngine to find declarations, references, or both that correspond to the IASTName searchName found in the index. |
static Set |
getMatchesFromSearchEngine(ICSearchScope scope,
String searchPattern,
ICSearchConstants.LimitTo limitTo)
This is a convenience method that uses the SearchEngine to find everything in the index that matches to a String. |
static IASTName[] |
getNamesFromDOM(IASTName searchName,
ICSearchConstants.LimitTo limitTo)
This is used to get the names from the TU that the IASTName searchName belongs to. |
static String |
getSearchPattern(IASTName name)
Generates a search pattern String based on the IASTName passed as a parameter. |
static IASTName[] |
getSelectedNamesFrom(IASTTranslationUnit tu,
int offset,
int length,
org.eclipse.cdt.core.parser.ParserLanguage lang)
This is used to get an array of selected names in an IASTTranslationUnit based on the offset and length into that IASTTranslationUnit. |
static IASTName[] |
getSelectedNamesFrom(IFile file,
int offset,
int length)
This is used to get an array of selected names in an IFile based on the offset and length into that IFile. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DOMSearchUtil()
Method Detail |
---|
public static Set getMatchesFromSearchEngine(ICSearchScope scope, IASTName searchName, ICSearchConstants.LimitTo limitTo)
scope
- is used to limit the scope that SearchEngine searches the index againstsearchName
- is the IASTName whose delcarations/references are sought afterlimitTo
- used to specify whether to get declarations, references, or both, one of:
( CSearchPattern.DECLARATION | CSearchPattern.REFERENCES | CSearchPattern.ALL_OCCURRENCES )
public static Set getMatchesFromSearchEngine(ICSearchScope scope, String searchPattern, ICSearchConstants.LimitTo limitTo)
scope
- the scope to search within the indexsearchPattern
- the string used to search the index with
public static IASTName[] getSelectedNamesFrom(IASTTranslationUnit tu, int offset, int length, org.eclipse.cdt.core.parser.ParserLanguage lang)
tu
- offset
- length
- lang
-
public static IASTName[] getSelectedNamesFrom(IFile file, int offset, int length)
file
- the IFile whose selectionoffset
- length
-
public static org.eclipse.cdt.core.parser.ParserLanguage getLanguageFromFile(IFile file)
file
-
public static IASTName[] getNamesFromDOM(IASTName searchName, ICSearchConstants.LimitTo limitTo)
searchName
- the IASTName whose references/delcarations are to be retrievedlimitTo
- used to specify whether to get declarations, references, or both, one of:
( CSearchPattern.DECLARATION | CSearchPattern.REFERENCES | CSearchPattern.ALL_OCCURRENCES )
public static org.eclipse.cdt.core.parser.ParserLanguage getLanguage(IPath path, IProject project)
path
- project
-
public static String getSearchPattern(IASTName name)
name
-
|
Eclipse CDT Pre-release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |