pub struct FileFilter {
pub ignored: Vec<String>,
pub not_ignored: Vec<String>,
pub extensions: Vec<String>,
}Fields§
§ignored: Vec<String>§not_ignored: Vec<String>§extensions: Vec<String>Implementations§
Source§impl FileFilter
impl FileFilter
pub fn new(ignore: &[String], extensions: Vec<String>) -> Self
Sourcepub fn parse_submodules(&mut self)
pub fn parse_submodules(&mut self)
This function will also read a .gitmodules file located in the working directory. The named submodules’ paths will be automatically added to the ignored list, unless the submodule’s path is already specified in the not_ignored list.
Sourcepub fn is_file_in_list(&self, file_name: &Path, is_ignored: bool) -> bool
pub fn is_file_in_list(&self, file_name: &Path, is_ignored: bool) -> bool
Describes if a specified file_name is contained within the specified set of paths.
The is_ignored flag describes which set of paths is used as domains.
The specified file_name can be a direct or distant descendant of any paths in
the set.
Returns a true value of the the path/pattern that matches the given file_name.
If given file_name is not in the specified set, then false is returned.
Sourcepub fn is_source_or_ignored(&self, entry: &Path) -> bool
pub fn is_source_or_ignored(&self, entry: &Path) -> bool
A helper function that checks if entry satisfies the following conditions (in
ordered priority):
- Does
entry’s path use at least 1 of the listed fileextensions? (takes precedence) - Is
entrynot specified in list ofignoredpaths? - Is
entryspecified in the list of explicitlynot_ignoredpaths? (supersedes specifiedignoredpaths)
Sourcepub fn list_source_files(&self, root_path: &str) -> Result<Vec<FileObj>>
pub fn list_source_files(&self, root_path: &str) -> Result<Vec<FileObj>>
Walks a given root_path recursively and returns a Vec<FileObj> that
- uses at least 1 of the given
extensions - is not specified in the internal list of
ignoredpaths - is specified in the internal list
not_ignoredpaths (which supersedesignoredpaths)
Trait Implementations§
Source§impl Clone for FileFilter
impl Clone for FileFilter
Source§fn clone(&self) -> FileFilter
fn clone(&self) -> FileFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more