use globset::{Glob, GlobSet, GlobSetBuilder};
use grep_matcher::{LineMatchKind, LineTerminator, Match, Matcher, NoCaptures, NoError};
use grep_regex::{RegexMatcher, RegexMatcherBuilder};
use grep_searcher::{BinaryDetection, MmapChoice, Searcher, SearcherBuilder, Sink, SinkMatch};
use ignore::{WalkBuilder, WalkState};
use std::collections::HashSet;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use unicode_width::UnicodeWidthStr;
use crate::glob_list::split_globs;
mod highlight;
mod matcher;
mod path_filter;
mod replace;
mod walk;
mod worker;
pub use highlight::split_for_highlight;
pub(crate) use matcher::Pattern;
pub(crate) use matcher::query_error;
use matcher::*;
pub use path_filter::PathFilter;
pub(crate) use path_filter::invalid_globs;
pub use replace::preserve_case;
use replace::*;
pub(crate) use replace::{
expand_replacement, replace_in_file, replace_in_text, trim_leading_context,
};
pub(crate) use walk::as_typed;
#[cfg(test)]
pub(crate) use walk::collect_matches_in_text;
pub use walk::line_may_match;
#[cfg(test)]
pub(crate) use walk::search_workspace;
pub use walk::search_workspace_streaming_filtered;
use walk::*;
pub use worker::SearchEvent;
pub use worker::SearchRequest;
pub use worker::search_worker_loop;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SearchHit {
pub path: PathBuf,
pub line_no: usize,
pub line_text: String,
pub matches: usize,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
pub struct SearchOpts {
pub case_sensitive: bool,
pub whole_word: bool,
pub use_regex: bool,
pub preserve_case: bool,
}
#[cfg(test)]
mod tests;