forked from microsoft/component-detection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIComponentStreamEnumerableFactory.cs
31 lines (29 loc) · 2.25 KB
/
IComponentStreamEnumerableFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using System.IO;
namespace Microsoft.ComponentDetection.Contracts
{
public interface IComponentStreamEnumerableFactory
{
/// <summary>
/// Returns an enumerable of <see cref="IComponentStream"/> which are representative of the contents of underlying files that matched the
/// provided search pattern and exclusion function. Each stream is disposed on the end of a single iteration of a foreach loop.
/// </summary>
/// <param name="directory">The directory to search "from", e.g. the top level directory being searched.</param>
/// <param name="searchPatterns">The patterns to use in the search.</param>
/// <param name="directoryExclusionPredicate">Predicate which indicates which directories should be excluded.</param>
/// <param name="recursivelyScanDirectories">Indicates whether the streams should enumerate files from sub directories.</param>
/// <returns></returns>
IEnumerable<IComponentStream> GetComponentStreams(DirectoryInfo directory, IEnumerable<string> searchPatterns, ExcludeDirectoryPredicate directoryExclusionPredicate, bool recursivelyScanDirectories = true);
/// <summary>
/// Returns an enumerable of <see cref="IComponentStream"/> which are representative of the contents of underlying files that matched the
/// provided search and exclusion functions. Each stream is disposed on the end of a single iteration of a foreach loop.
/// </summary>
/// <param name="directory">The directory to search "from", e.g. the top level directory being searched.</param>
/// <param name="fileMatchingPredicate">Predicate which indicates what files should be included.</param>
/// <param name="directoryExclusionPredicate">Predicate which indicates which directories should be excluded.</param>
/// <param name="recursivelyScanDirectories">Indicates whether the streams should enumerate files from sub directories.</param>
/// <returns></returns>
IEnumerable<IComponentStream> GetComponentStreams(DirectoryInfo directory, Func<FileInfo, bool> fileMatchingPredicate, ExcludeDirectoryPredicate directoryExclusionPredicate, bool recursivelyScanDirectories = true);
}
}