/// <summary> /// Initializes a new instance of the <see cref="DirectoryPathCollection"/> class. /// </summary> /// <param name="paths">The paths.</param> /// <param name="comparer">The comparer.</param> /// <exception cref="System.ArgumentNullException"><paramref name="comparer"/> is <c>null</c>.</exception> public DirectoryPathCollection(IEnumerable <DirectoryPath> paths, PathComparer comparer) { if (comparer == null) { throw new ArgumentNullException("comparer"); } _comparer = comparer; _paths = new HashSet <DirectoryPath>(paths, comparer); }
/// <summary> /// Initializes a new instance of the <see cref="FilePathCollection"/> class. /// </summary> /// <param name="paths">The paths.</param> /// <param name="comparer">The comparer.</param> public FilePathCollection(IEnumerable <FilePath> paths, PathComparer comparer) { if (comparer == null) { throw new ArgumentNullException(nameof(comparer)); } Comparer = comparer; _paths = new HashSet <FilePath>(paths, comparer); }
/// <summary> /// Initializes a new instance of the <see cref="Globber"/> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="environment">The environment.</param> public Globber(IFileSystem fileSystem, ICakeEnvironment environment) { if (fileSystem == null) { throw new ArgumentNullException("fileSystem"); } if (environment == null) { throw new ArgumentNullException("environment"); } _environment = environment; _parser = new GlobParser(environment); _visitor = new GlobVisitor(fileSystem, environment); _comparer = new PathComparer(environment.IsUnix()); }
/// <summary> /// Initializes a new instance of the <see cref="DirectoryPathCollection"/> class. /// </summary> /// <param name="comparer">The comparer.</param> public DirectoryPathCollection(PathComparer comparer) : this(Enumerable.Empty <DirectoryPath>(), comparer) { }
/// <summary> /// Initializes a new instance of the <see cref="FilePathCollection"/> class. /// </summary> /// <param name="comparer">The comparer.</param> public FilePathCollection(PathComparer comparer) : this(Enumerable.Empty <FilePath>(), comparer) { }
static PathComparer() { Default = new PathComparer(EnvironmentHelper.IsUnix()); }