IFileWriteTracker Interface
Tracks the state of files being written to and their source content. This helps determine when a file should be overwritten when using Unwritten.
Namespace
Statiq.Common
Implementing Types
graph BT Type["IFileWriteTracker"] class Type type-node Implementing0["TestFileWriteTracker"]-.->Type click Implementing0 "/api/Statiq.Testing/TestFileWriteTracker"

Syntax

public interface IFileWriteTracker

Properties

Name Property Type Summary
CurrentActualWritesCount int
Gets the count of how many files were actually written.
CurrentContent IEnumerable<KeyValuePair<NormalizedPath, int>>
Gets the path and hash code for all current file content.
CurrentTotalWritesCount int
Gets the count of how many files were written, whether actually or already existed.
CurrentWrites IEnumerable<KeyValuePair<NormalizedPath, int>>
Gets the path and hash code for all current file writes.
PreviousContent IEnumerable<KeyValuePair<NormalizedPath, int>>
Gets the path and hash code for all previous file content (from before the most recent Reset().
PreviousWrites IEnumerable<KeyValuePair<NormalizedPath, int>>
Gets the path and hash code for all previous file writes (from before the most recent Reset().

Methods

Name Return Value Summary
Reset() void
Resets the tracking for another execution.
RestoreAsync(IReadOnlyFileSystem, IFile) Task<string>
Restores the state saved by SaveAsync(IReadOnlyFileSystem, IFile) to the previous state.
SaveAsync(IReadOnlyFileSystem, IFile) Task
Saves the current state to a file.
TrackContent(NormalizedPath, int) void
Tracks data that was written using a hash code of it's content.
TrackWrite(NormalizedPath, int, bool) void
Tracks a written file using a hash code that represents the file state after the write operation.
TryGetCurrentContent(NormalizedPath, int) bool
Attempts to get a hash code for written content.
TryGetCurrentWrite(NormalizedPath, int) bool
Attempts to get a hash code for a written file.
TryGetPreviousContent(NormalizedPath, int) bool
Attempts to get a hash code for previously written content.
TryGetPreviousWrite(NormalizedPath, int) bool
Attempts to get a hash code for a previously written file.

Extension Methods