Esempio n. 1
0
 /// <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);
 }
Esempio n. 2
0
 /// <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);
 }
Esempio n. 3
0
        /// <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());
        }
Esempio n. 4
0
 /// <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)
 {
 }
Esempio n. 5
0
 /// <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)
 {
 }
Esempio n. 6
0
 static PathComparer()
 {
     Default = new PathComparer(EnvironmentHelper.IsUnix());
 }