HashCommandBuilder Class

Summary

Builder for HashCommand.
graph BT Type-->Base0["BaseOutputBuilder<HashCommandBuilder, IHashOutput>"] Base0-->Base1["object"] Type-.->Interface0["ISupportArgumentBuilder<IHaveArgumentFiles>"] Type-.->Interface1["ISupportArgumentBuilder<IHaveArgumentDirectories>"] Type-.->Interface2["ISupportSwitchBuilder<ISupportSwitchIncludeFilenames>"] Type-.->Interface3["ISupportSwitchBuilder<ISupportSwitchExcludeFilenames>"] Type-.->Interface4["ISupportSwitchBuilder<ISupportSwitchRecurseSubdirectories>"] Type-.->Interface5["ISupportSwitchBuilder<ISupportSwitchCompressFilesOpenForWriting>"] Type-.->Interface6["ISupportSwitchBuilder<ISupportSwitchCompressionMethod>"] Type-.->Interface7["ISupportSwitchBuilder<ISupportSwitchNtfsAlternateStreams>"] Type-.->Interface8["ISupportSwitchBuilder<ISupportSwitchSetHashFunction>"] Type["HashCommandBuilder"] class Type type-node

Syntax

public sealed class HashCommandBuilder : BaseOutputBuilder<HashCommandBuilder, IHashOutput>, 
    ISupportArgumentBuilder<IHaveArgumentFiles>, ISupportArgumentBuilder<IHaveArgumentDirectories>, 
    ISupportSwitchBuilder<ISupportSwitchIncludeFilenames>, 
    ISupportSwitchBuilder<ISupportSwitchExcludeFilenames>, 
    ISupportSwitchBuilder<ISupportSwitchRecurseSubdirectories>, 
    ISupportSwitchBuilder<ISupportSwitchCompressFilesOpenForWriting>, 
    ISupportSwitchBuilder<ISupportSwitchCompressionMethod>, 
    ISupportSwitchBuilder<ISupportSwitchNtfsAlternateStreams>, 
    ISupportSwitchBuilder<ISupportSwitchSetHashFunction>

Examples

Task("GetHash")
    .Does(() =>
{
    SevenZip(m => m
        .InHashMode()
        .WithFiles(File("foo.txt"))
        .WithHashFunction(SwitchSetHashFunction.Sha1)
        .WithCommandOutput(o =>
        {
            Information("7Zip version is:" + o.Information);
            var file = o.Files.Single(); // only one file was given above
            var hash = file.Hashes.Single(); // only one hash-function was given above
            Information($"{hash.HashFunction} of {file.FilePath} is: {hash.Hash}");
        }));
});

Properties

Name Value Summary
OutputCommand BaseOutputCommand<IHashOutput>
Gets the output command.

Extension Methods

Name Value Summary
WithCompressFilesOpenForWriting<HashCommandBuilder>() T
WithCompressionMethod<HashCommandBuilder>(Action<SwitchCompressionMethod>) T
fluent setter for ISupportSwitchCompressionMethod using an action.
WithCompressionMethodDictionarySize<HashCommandBuilder>(int) T
fluent setter for the method of ISupportSwitchCompressionMethod.
WithCompressionMethodLevel<HashCommandBuilder>(int) T
fluent setter for the method of ISupportSwitchCompressionMethod.
WithCompressionMethodMethod<HashCommandBuilder>(string) T
fluent setter for the method of ISupportSwitchCompressionMethod.
WithCompressionMethodSortFilesByType<HashCommandBuilder>(bool) T
fluent setter for the method of ISupportSwitchCompressionMethod.
WithDirectories<HashCommandBuilder>(DirectoryPathCollection) T
See Cake.SevenZip.Builder.ArgumentDirectoriesBuilder.WithDirectories``1(``0,DirectoryPath[]).
WithDirectories<HashCommandBuilder>(DirectoryPath[]) T
fluent setter for Directories.

See the comments on Files, Directories and DirectoryContents regarding files and directory structures.

WithDirectoryContents<HashCommandBuilder>(DirectoryPathCollection) T
See Cake.SevenZip.Builder.ArgumentDirectoriesBuilder.WithDirectoryContents``1(``0,DirectoryPath[]).
WithDirectoryContents<HashCommandBuilder>(DirectoryPath[]) T
fluent setter for DirectoryContents.

See the comments on Files, Directories and DirectoryContents regarding files and directory structures.

WithExcludeFilenames<HashCommandBuilder>(RecurseType, string, string[]) T
fluent setter for ISupportSwitchExcludeFilenames.
WithExcludeFilenames<HashCommandBuilder>(string, string[]) T
fluent setter for ISupportSwitchExcludeFilenames.
WithFiles<HashCommandBuilder>(FilePathCollection) T
See Cake.SevenZip.Builder.ArgumentFilesBuilder.WithFiles``1(``0,FilePath[]).
WithFiles<HashCommandBuilder>(FilePath[]) T
fluent setter for Files.

See the comments on Files, Directories and DirectoryContents regarding files and directory structures.

WithHashFunction<HashCommandBuilder>(SwitchSetHashFunction, SwitchSetHashFunction[]) T
fluent setter for ISupportSwitchSetHashFunction.
WithIncludeFilenames<HashCommandBuilder>(RecurseType, string, string[]) T
fluent setter for ISupportSwitchIncludeFilenames.
WithIncludeFilenames<HashCommandBuilder>(string, string[]) T
fluent setter for ISupportSwitchIncludeFilenames.
WithNtfsAlternateStreams<HashCommandBuilder>() T
WithRecurseSubdirectories<HashCommandBuilder>(RecurseType) T

See Also

GitHub Discussion