@@ -149,7 +149,7 @@ indexstoredb_symbol_name(indexstoredb_symbol_t symbol) {
149
149
// / @param receiver a function to be called for each symbol, the CString of the symbol will be passed in to this function.
150
150
// / The function should return a boolean indicating whether the looping should continue.
151
151
bool
152
- indexstoredb_for_each_symbol_name (indexstoredb_index_t index, indexstoredb_for_each_symbol_receiver receiver) {
152
+ indexstoredb_for_each_symbol_name (indexstoredb_index_t index, indexstoredb_symbol_name_receiver receiver) {
153
153
// indexSystem has foreachsymbolName.
154
154
auto obj = (IndexStoreDBObject<std::shared_ptr<IndexSystem>> *)index;
155
155
return obj->value ->foreachSymbolName ([&](StringRef ref) -> bool {
@@ -175,6 +175,38 @@ indexstoredb_for_each_canonical_symbol_occurence_by_name(
175
175
});
176
176
}
177
177
178
+ // / loops through each canonical symbol that matches the pattern, perform the passed in function
179
+ // / @param index an IndexStoreDB object which contains the symbols.
180
+ // / @param AnchorStart when true, symbol names should only be considered matching when the first characters of the symbol name match the pattern.
181
+ // / @param AnchorEnd when true, symbol names should only be considered matching when the first characters of the symbol name match the pattern.
182
+ // / @param Subsequence when true, symbols will be matched even if the pattern is not matched contiguously.
183
+ // / @param IgnoreCase when true, symbols may be returned even if the case of letters does not match the pattern.
184
+ // / @param receiver a function to be called for each canonical occurence that matches the pattern.
185
+ // / The SymbolOccurenceRef of the symbol will be passed in to this function.
186
+ // / The function should return a boolean indicating whether the looping should continue.
187
+ bool
188
+ indexstoredb_for_each_canonical_symbol_occurence_containing_pattern (
189
+ indexstoredb_index_t index,
190
+ const char *_Nonnull Pattern,
191
+ bool AnchorStart,
192
+ bool AnchorEnd,
193
+ bool Subsequence,
194
+ bool IgnoreCase,
195
+ indexstoredb_symbol_occurrence_receiver_t receiver)
196
+ {
197
+ auto obj = (IndexStoreDBObject<std::shared_ptr<IndexSystem>> *)index;
198
+ return obj->value ->foreachCanonicalSymbolOccurrenceContainingPattern (
199
+ Pattern,
200
+ AnchorStart,
201
+ AnchorEnd,
202
+ Subsequence,
203
+ IgnoreCase,
204
+ [&](SymbolOccurrenceRef occur
205
+ ) -> bool {
206
+ return receiver (make_object (occur));
207
+ });
208
+ }
209
+
178
210
indexstoredb_symbol_t
179
211
indexstoredb_symbol_occurrence_symbol (indexstoredb_symbol_occurrence_t occur) {
180
212
auto obj = (IndexStoreDBObject<SymbolOccurrenceRef> *)occur;
0 commit comments