Package com.embabel.agent.tools.file
Interface PatternSearch
-
- All Implemented Interfaces:
-
com.embabel.agent.tools.DirectoryBased
public interface PatternSearch implements DirectoryBased
Adds low level pattern search methods to the com.embabel.agent.tools.DirectoryBased interface
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classPatternSearch.PatternMatchRepresents a matching file with context
-
Method Summary
Modifier and Type Method Description StringfindPatternInProject(String pattern, String globPattern)List<PatternSearch.PatternMatch>findPatternInProject(Regex pattern, String globPattern, Boolean useParallelSearch)Finds files containing the specified pattern using glob patterns BooleanmatchesGlob(String path, String globPattern)Checks if a file path matches a glob pattern -
-
Method Detail
-
findPatternInProject
String findPatternInProject(String pattern, String globPattern)
-
findPatternInProject
List<PatternSearch.PatternMatch> findPatternInProject(Regex pattern, String globPattern, Boolean useParallelSearch)
Finds files containing the specified pattern using glob patterns
- Parameters:
pattern- The regex pattern to search forglobPattern- Glob pattern to match filesuseParallelSearch- Whether to use parallel processing for faster searching- Returns:
List of matching files with their relevant content snippets
-
matchesGlob
Boolean matchesGlob(String path, String globPattern)
Checks if a file path matches a glob pattern
- Parameters:
path- The file path to checkglobPattern- The glob pattern to match against- Returns:
true if the path matches the pattern
-
-
-
-