private bool matches_case_insensitive(line l) { Debug.Assert(part != part_type.font); string line_part = this.line_part(l).ToLower(); return(compare(line_part, lo_text, lo_words)); }
public match(BitArray matches, font_info font, line line, int line_idx) { this.matches = matches; this.font = font; this.line = line; this.line_idx = line_idx; }
public List <filter_line.match_index> match_indexes(line l, info_type type) { List <filter_line.match_index> indexes = null; bool has_match_color = font_.match_fg != util.transparent || font_.match_bg != util.transparent; if (has_match_color) { foreach (filter_line line in items_) { var now = line.match_indexes(l, type); if (now.Count > 0) { if (indexes == null) { indexes = new List <filter_line.match_index>(); } // here, we need to set the match colors foreach (var index in now) { index.fg = font_.match_fg; index.bg = font_.match_bg; } indexes.AddRange(now); } } } return(indexes ?? empty_); }
public static line empty_line() { line l = new line(); for (int i = 0; i < l.parts.Length / 2; ++i) { l.parts[i * 2] = -1; l.parts[i * 2 + 1] = 0; } return l; }
// returns all the matches from all columns public List <match_index> match_indexes_any_column(line l) { List <match_index> indexes = new List <match_index>(); foreach (var type in info_type_io.searchable) { indexes.AddRange(match_indexes(l, type)); } return(indexes); }
public static bool matches(line l, IEnumerable <info_type> cols, search_for search) { // 1.6.27+ faster way to find out if the message is contained - just look at the full message (instead of looking at each part) if (matches_cell(l.raw_full_msg(), search)) { return(cols.Any(x => matches_cell(l.part(x), search))); } else { return(false); } }
private bool matches_case_sensitive(line l) { Debug.Assert(part != part_type.font); if (part == part_type.any) { return(matches_case_sensitive_any_column(l)); } string line_part = this.line_part(l); return(compare(line_part, text, words)); }
private bool matches_case_insensitive_any_column(line l) { string line_part = l.raw_full_msg().ToLower(); if (compare(line_part, lo_text, lo_words)) { // we need an extra step, so that we don't mistakenly match the text in the time/date column, for instance foreach (var type in info_type_io.searchable) { if (compare(l.part(type).ToLower(), lo_text, lo_words)) { return(true); } } } return(false); }
public List <filter_line.match_index> match_indexes(line l, info_type type) { List <filter_line.match_index> indexes = new List <filter_line.match_index>(); lock (this) foreach (var row in rows_) { indexes.AddRange(row.match_indexes(l, type)); } indexes.Sort((x, y) => { if (x.start != y.start) { return(x.start - y.start); } return(-(x.len - y.len)); }); return(indexes); }
public List <match_index> match_indexes(line l, info_type type) { if (part == part_type.font || part == part_type.case_sensitive_info) { return(empty_); } // 1.2.6 for now, care about match indexes only for msg column if (type != info_type.msg) { return(empty_); } // we only care about "positive" matches - those that have "containing", "startswith", regex, etc. switch (comparison) { case comparison_type.does_not_start_with: case comparison_type.does_not_contain: case comparison_type.contains_none: return(empty_); case comparison_type.equal: case comparison_type.not_equal: case comparison_type.starts_with: case comparison_type.contains: case comparison_type.contains_any: case comparison_type.regex: break; default: Debug.Assert(false); return(empty_); } return(case_sensitive ? matches_case_sensitive_with_indexes(l, type) : matches_case_insensitive_with_indexes(l, type)); }
public bool matches(line l) { return case_sensitive ? matches_case_sensitive(l) : matches_case_insensitive(l); }
private bool matches_case_insensitive_any_column(line l) { string line_part = l.raw_full_msg().ToLower(); if ( compare(line_part, lo_text, lo_words)) // we need an extra step, so that we don't mistakenly match the text in the time/date column, for instance foreach ( var type in info_type_io.searchable) if (compare(l.part(type).ToLower(), lo_text, lo_words)) return true; return false; }
private bool matches_case_insensitive(line l) { Debug.Assert( part != part_type.font ); if (part == part_type.any) return matches_case_insensitive_any_column(l); string line_part = this.line_part(l).ToLower() ; return compare(line_part, lo_text, lo_words); }
private string line_part(line l) { return l.part(part_type_io.to_info_type(part)); }
private List<match_index> matches_case_sensitive_with_indexes(line l, info_type type) { string line_part = l.part(type); return compare_with_indexes(line_part, text, words); }
private bool matches_case_sensitive(line l) { Debug.Assert( part != part_type.font ); string line_part = this.line_part(l); return compare(line_part, text, words); }
private match new_match(BitArray ba, line l, int idx, font_info f) { match m = create_match(ba, f, l, idx); return(m); }
private List<match_index> matches_case_insensitive_with_indexes(line l, info_type type) { string line_part = l.part(type).ToLower(); return compare_with_indexes(line_part, lo_text, lo_words, type); }
private List <match_index> matches_case_sensitive_with_indexes(line l, info_type type) { string line_part = l.part(type); return(compare_with_indexes(line_part, text, words, type)); }
public List< match_index > match_indexes(line l, info_type type) { if (part == part_type.font || part == part_type.case_sensitive_info) return empty_; // 1.2.6 for now, care about match indexes only for msg column if (type != info_type.msg) return empty_; // we only care about "positive" matches - those that have "containing", "startswith", regex, etc. switch (comparison) { case comparison_type.does_not_start_with: case comparison_type.does_not_contain: case comparison_type.contains_none: return empty_; case comparison_type.equal: case comparison_type.not_equal: case comparison_type.starts_with: case comparison_type.contains: case comparison_type.contains_any: case comparison_type.regex: break; default: Debug.Assert(false); return empty_; } return case_sensitive ? matches_case_sensitive_with_indexes(l, type) : matches_case_insensitive_with_indexes(l, type); }
// returns all the matches from all columns public List<match_index> match_indexes_any_column(line l) { List<match_index> indexes = new List<match_index>(); foreach ( var type in info_type_io.searchable) indexes.AddRange( match_indexes(l, type) ); return indexes; }
public static bool matches(line l, IEnumerable<info_type> cols, search_for search) { // 1.6.27+ faster way to find out if the message is contained - just look at the full message (instead of looking at each part) if (matches_cell(l.raw_full_msg(), search)) return cols.Any(x => matches_cell(l.part(x), search)); else return false; }
private string line_part(line l) { return(l.part(part_type_io.to_info_type(part))); }
public List<filter_line.match_index> match_indexes(line l, info_type type) { List<filter_line.match_index> indexes = new List<filter_line.match_index>(); lock (this) foreach ( var row in rows_) indexes.AddRange( row.match_indexes(l, type)); indexes.Sort((x, y) => { if (x.start != y.start) return x.start - y.start; return -(x.len - y.len); }); return indexes; }
public bool matches(line l) { return(case_sensitive ? matches_case_sensitive(l) : matches_case_insensitive(l)); }
public match(BitArray matches, font_info font, line line, int lineIdx) { this.matches = matches; this.font = font; this.line = line; line_idx = lineIdx; }
private List <match_index> matches_case_insensitive_with_indexes(line l, info_type type) { string line_part = l.part(type).ToLower(); return(compare_with_indexes(line_part, lo_text, lo_words)); }
private match new_match(BitArray ba, line l, int idx, font_info f ) { match m = create_match(ba, f, l, idx); return m; }