Skip to content

Instantly share code, notes, and snippets.

@JeremyKuhne
Created March 9, 2018 01:07
Show Gist options
  • Save JeremyKuhne/35183723d62ec852b53a193a3233369b to your computer and use it in GitHub Desktop.
Save JeremyKuhne/35183723d62ec852b53a193a3233369b to your computer and use it in GitHub Desktop.
FileSystemEnumerator
namespace System.IO.Enumeration
{
public abstract class FileSystemEnumerator<TResult> : CriticalFinalizerObject, IEnumerator<TResult>
{
public FileSystemEnumerator(string directory, EnumerationOptions options = null) { }
protected virtual bool ShouldIncludeEntry(ref FileSystemEntry entry);
protected virtual bool ShouldRecurseIntoEntry(ref FileSystemEntry entry);
protected abstract TResult TransformEntry(ref FileSystemEntry entry);
protected virtual void OnDirectoryFinished(ReadOnlySpan<char> directory);
// This will return the native error code when errors are hit
protected virtual bool ContinueOnError(int error);
public TResult Current { get; }
object IEnumerator.Current { get; }
public bool MoveNext();
public void Reset();
public void Dispose();
protected virtual void Dispose(bool disposing);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment