Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 7ea7302bae91a43c688aacc46d1b69809b02a479 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
/*******************************************************************************
 * Copyright (c) 2003, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corp. - Rational Software - initial implementation
 *******************************************************************************/
/*
 * Created on May 31, 2003
 */
package org.eclipse.cdt.core.search;

/**
 * @author bgheorgh
 */
import org.eclipse.cdt.internal.core.search.processing.*;


/**
 * <p>
 * This interface defines the constants used by the search engine.
 * </p>
 * <p>
 * This interface declares constants only; it is not intended to be implemented.
 * </p>
 * @see org.eclipse.cdt.core.search.SearchEngine
 */
public interface ICSearchConstants {
	/**
	 * The nature of searched element or the nature
	 * of match in unknown.
	 */
	public static final SearchFor UNKNOWN_SEARCH_FOR = new SearchFor( -1 );
	public static final LimitTo UNKNOWN_LIMIT_TO = new LimitTo( -1 );
	
	/* Nature of searched element */
	
	/**
	 * The searched element is a type.
	 */
	public static final SearchFor TYPE = new SearchFor( 0 );

	/**
	 * The searched element is a function.
	 */
	public static final SearchFor FUNCTION = new SearchFor( 1 );

	/**
	* The searched element is a namespace.
    */
	public static final SearchFor NAMESPACE = new SearchFor( 2 );
	
	/**
	 * The searched element is a method (member function).
	 */
	public static final SearchFor METHOD = new SearchFor( 3 );

	/**
	 * The searched element is a field (member variable).
     */
	public static final SearchFor FIELD = new SearchFor( 4 );
	
	/**
	 * The searched element is a variable.
	 * More selective than using TYPE
	 */
	public static final SearchFor VAR = new SearchFor( 5 );

	/**
	 * The searched element is a class. 
	 * More selective than using TYPE
	 */
	public static final SearchFor CLASS = new SearchFor( 6 );

	/**
	 * The searched element is a struct.
	 * More selective than using TYPE
	 */
	public static final SearchFor STRUCT = new SearchFor( 7 );

	/**
	 * The searched element is a enum.
	 * More selective than using TYPE
	 */
	public static final SearchFor ENUM = new SearchFor( 8 );
	
	/**
	 * The searched element is a union.
	 * More selective than using TYPE
	 */
	public static final SearchFor UNION = new SearchFor( 9 );
	
	public static final SearchFor MACRO = new SearchFor( 10 );
	
	public static final SearchFor CLASS_STRUCT = new SearchFor( 11 );

	public static final SearchFor TYPEDEF = new SearchFor( 12 );
	
	public static final SearchFor INCLUDE = new SearchFor( 13 );
	
	public static final SearchFor DERIVED = new SearchFor( 14 );
	
	public static final SearchFor ENUMTOR = new SearchFor( 15 );
	
	public static final SearchFor FRIEND = new SearchFor( 16 );
	
	public static final SearchFor FWD_CLASS = new SearchFor ( 17 );
		
	public static final SearchFor FWD_STRUCT = new SearchFor ( 18 );
		
	public static final SearchFor FWD_UNION = new SearchFor ( 19 );
	
	/* Nature of match */
	
	/**
	 * The search result is a declaration.
	 * Can be used in conjunction with any of the nature of searched elements
	 * so as to better narrow down the search.
	 */
	public static final LimitTo DECLARATIONS = new LimitTo( 0 ); 

	/**
	 * The search result is a type that implements an interface. 
	 * Used in conjunction with either TYPE or CLASS or INTERFACE, it will
	 * respectively search for any type implementing/extending an interface, or
	 * rather exclusively search for classes implementing an interface, or interfaces 
	 * extending an interface.
	 */
	public static final LimitTo DEFINITIONS = new LimitTo( 1 );

	/**
	 * The search result is a reference.
	 * Can be used in conjunction with any of the nature of searched elements
	 * so as to better narrow down the search.
	 * References can contain implementers since they are more generic kind
	 * of matches.
	 */
	public static final LimitTo REFERENCES = new LimitTo( 2 );

	/**
	 * The search result is a declaration, a reference, or an implementer 
	 * of an interface.
	 * Can be used in conjunction with any of the nature of searched elements
	 * so as to better narrow down the search.
	 */
	public static final LimitTo ALL_OCCURRENCES = new LimitTo( 3 );

	
	/* Syntactic match modes */
	
	/**
	 * The search pattern matches exactly the search result,
	 * that is, the source of the search result equals the search pattern.
	 */
	int EXACT_MATCH = 0;
	/**
	 * The search pattern is a prefix of the search result.
	 */
	int PREFIX_MATCH = 1;
	/**
	 * The search pattern contains one or more wild cards ('*') where a 
	 * wild-card can replace 0 or more characters in the search result.
	 */
	int PATTERN_MATCH = 2;


	/* Case sensitivity */
	
	/**
	 * The search pattern matches the search result only
	 * if cases are the same.
	 */
	boolean CASE_SENSITIVE = true;
	/**
	 * The search pattern ignores cases in the search result.
	 */
	boolean CASE_INSENSITIVE = false;
	

	/* Waiting policies */
	
	/**
	 * The search operation starts immediately, even if the underlying indexer
	 * has not finished indexing the workspace. Results will more likely
	 * not contain all the matches.
	 */
	int FORCE_IMMEDIATE_SEARCH = IJob.ForceImmediate;
	/**
	 * The search operation throws an <code>org.eclipse.core.runtime.OperationCanceledException</code>
	 * if the underlying indexer has not finished indexing the workspace.
	 */
	int CANCEL_IF_NOT_READY_TO_SEARCH = IJob.CancelIfNotReady;
	/**
	 * The search operation waits for the underlying indexer to finish indexing 
	 * the workspace before starting the search.
	 */
	int WAIT_UNTIL_READY_TO_SEARCH = IJob.WaitUntilReady;
	
	public static final String EXTERNAL_SEARCH_LINK_PREFIX = "cdtlnk"; //$NON-NLS-1$
	
	public class SearchFor{
		private SearchFor( int value )
		{
			this.value = value;
		}
		private final int value;
	}
	
	public class LimitTo {
		private LimitTo( int value )
		{
			this.value = value;
		}
		private final int value;
	}
}

Back to the top