NanoByte.Common  2.10.5
NanoByte.Common.Storage.ReadDirectoryBase Class Referenceabstract

Recursively iterates over all elements in a directory. More...

Inheritance diagram for NanoByte.Common.Storage.ReadDirectoryBase:
NanoByte.Common.Tasks.TaskBase NanoByte.Common.Tasks.ITask NanoByte.Common.Storage.CopyDirectory NanoByte.Common.Storage.MoveDirectory

Protected Member Functions

 ReadDirectoryBase ([Localizable(false)] string path)
 Creates a new directory read task. More...
override void Execute ()
 The actual code to be executed.
abstract void HandleDirectory (DirectoryInfo directory)
 Called once for every sub-directory below Source. More...
abstract void HandleFile (FileInfo file, FileInfo? hardlinkTarget=null)
 Called once for every file below Source. More...

Protected Attributes

readonly DirectoryInfo Source
 The directory to read. More...
- Protected Attributes inherited from NanoByte.Common.Tasks.TaskBase
CancellationToken CancellationToken
 Signaled when the user wishes to cancel the task execution. More...
 Used to retrieve credentials for specific Uris on demand; can be null. More...


override bool UnitsByte [get]
bool FollowSymlinks [get]
 Controls whether to follow symlinks. More...
- Properties inherited from NanoByte.Common.Tasks.TaskBase
abstract string Name [get]
object? Tag [get, set]
virtual bool CanCancel [get]
TaskState State [get, protected set]
 The current State of the task. More...
abstract bool UnitsByte [get]
 true if UnitsProcessed and UnitsTotal are measured in bytes; false if they are measured in generic units. More...
long UnitsProcessed [get, set]
 The number of units that have been processed so far. More...
long UnitsTotal [get, set]
 The total number of units that are to be processed; -1 for unknown. More...
- Properties inherited from NanoByte.Common.Tasks.ITask
string Name [get]
 A name describing the task in human-readable form. More...
object? Tag [get, set]
 An object used to associate the task with a specific process; can be null. More...
bool CanCancel [get]
 Indicates whether this task can be canceled once it has been started. More...

Additional Inherited Members

- Public Member Functions inherited from NanoByte.Common.Tasks.TaskBase
void Run (CancellationToken cancellationToken=default, ICredentialProvider? credentialProvider=null, IProgress< TaskSnapshot >? progress=null)
 Runs the task and blocks until it is complete.

Detailed Description

Recursively iterates over all elements in a directory.

Constructor & Destructor Documentation

◆ ReadDirectoryBase()

NanoByte.Common.Storage.ReadDirectoryBase.ReadDirectoryBase ( [Localizable(false)] string  path)

Creates a new directory read task.

pathThe path of the directory to read.

Member Function Documentation

◆ HandleDirectory()

abstract void NanoByte.Common.Storage.ReadDirectoryBase.HandleDirectory ( DirectoryInfo  directory)
protectedpure virtual

Called once for every sub-directory below Source.

directoryThe directory to handle.

Implemented in NanoByte.Common.Storage.CopyDirectory.

◆ HandleFile()

abstract void NanoByte.Common.Storage.ReadDirectoryBase.HandleFile ( FileInfo  file,
FileInfo?  hardlinkTarget = null 
protectedpure virtual

Called once for every file below Source.

fileThe file to handle.
hardlinkTargetA previously handled file that is hardlinked to file . May be null.

Implemented in NanoByte.Common.Storage.CopyDirectory.

Member Data Documentation

◆ Source

readonly DirectoryInfo NanoByte.Common.Storage.ReadDirectoryBase.Source

The directory to read.

Property Documentation

◆ FollowSymlinks

bool NanoByte.Common.Storage.ReadDirectoryBase.FollowSymlinks

Controls whether to follow symlinks.

The documentation for this class was generated from the following file: