public List <DirConfig> LoadLegacyConfig(string configPath) { _logger.Trace("Loading legacy config file: {0}", configPath); var rules = new List <MatchRule>(); using (var sr = new StreamReader(configPath)) { string line; while ((line = sr.ReadLine()) != null) { line = Regex.Replace(line, @"^\s*#.*", ""); if (String.IsNullOrWhiteSpace(line)) { continue; } string[] s = line.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); if (s[0] != "include" && s[0] != "exclude") { throw new Exception("Invalid config line: " + line); } rules.Add(new MatchRule(s[0] == "include", s[1])); } } var ret = new DirConfig(configPath, ".", rules); _logger.Trace(ret.ToString()); return(new List <DirConfig>() { ret }); }
public GrepMatcher(DirConfig config) : base(config) { _contents = Settings.Compress ? new CompressedFileStore() : (IFileStore) new FileStore(); }
public PathMatcher(DirConfig config) : base(config) { }
public Matcher(DirConfig config) { this.Config = config; _pathmatcher = new PathMatcher(config); _grepmatcher = new GrepMatcher(config); }
public AbstractMatcher(DirConfig config) { this.Config = config; }