about
11/12/2022
RustTextFinder Repository
RustTextFinder Repository
Search for files containing specified text
Quick Status
Concept:
- Find all files in a directory subtree with text that matches a specified regular expression.
- Find all files that have specified extensions (patterns).
- List all directories and their files in some directory subtree.
Design:
-
new() -> TextFinder Create newTextFinder which holds a regex string. -
find(&self, file_path: &str) -> bool returns true if file content matches internal regex string. -
regex(&mut self, re:&str) Replace current regex string with re. -
get_regex(&self) -> &str Retrieve regex string.
Operation:
- creates an instance of CmdLineParser parser
- uses that to evaluate the program's option parameters.
- It then creates an instance of DirNav<TfAppl> dn, supplying it with the starting path, file patterns, and recursion predicate, all extracted from parser.
- calls dn.visit, starting at parser.abs_path(), converted to a std::Path.
Build:
Status:
Tested on both Windows 10 and Ubuntu Linux