次の方法で共有


IDirectoryCache.EnumerateFiles<TResult> Method

Definition

Enumerates files in the given directory only (non-recursively).

public:
generic <typename TResult>
 System::Collections::Generic::IEnumerable<TResult> ^ EnumerateFiles(System::String ^ path, System::String ^ pattern, Microsoft::Build::FileSystem::FindPredicate ^ predicate, Microsoft::Build::FileSystem::FindTransform<TResult> ^ transform);
public System.Collections.Generic.IEnumerable<TResult> EnumerateFiles<TResult> (string path, string pattern, Microsoft.Build.FileSystem.FindPredicate predicate, Microsoft.Build.FileSystem.FindTransform<TResult> transform);
abstract member EnumerateFiles : string * string * Microsoft.Build.FileSystem.FindPredicate * Microsoft.Build.FileSystem.FindTransform<'Result> -> seq<'Result>
Public Function EnumerateFiles(Of TResult) (path As String, pattern As String, predicate As FindPredicate, transform As FindTransform(Of TResult)) As IEnumerable(Of TResult)

Type Parameters

TResult

The desired return type.

Parameters

path
String

The directory to enumerate, specified as a full normalized path.

pattern
String

A search pattern supported by the platform which is guaranteed to return a superset of relevant files.

predicate
FindPredicate

A predicate to test whether a file should be included.

transform
FindTransform<TResult>

A transform from ReadOnlySpan<char> to TResult.

Returns

IEnumerable<TResult>

Remarks

The pattern parameter may match more files than what the caller is interested in. In other words, predicate can return false even if the implementation enumerates only files whose names match the pattern. The implementation is free to ignore the pattern and call the predicate for all files on the given path.

Applies to