HashCommand Class

Summary

Calculates the hash for one or more files (Command: h).

The builder is HashCommandBuilder.

graph BT Type-->Base0["BaseOutputCommand<IHashOutput>"] Base0-->Base1["BaseCommand"] click Base1 "/api/Cake.SevenZip.Commands/BaseCommand" Base1-->Base2["Object"] Type-.->Interface0["ICommand"] click Interface0 "/api/Cake.SevenZip.Commands/ICommand" Type-.->Interface1["ICanParseOutput"] Type-.->Interface2["IHaveArgumentFiles"] click Interface2 "/api/Cake.SevenZip.Arguments/IHaveArgumentFiles" Type-.->Interface3["IHaveArgumentDirectories"] click Interface3 "/api/Cake.SevenZip.Arguments/IHaveArgumentDirectories" Type-.->Interface4["IHaveArgument"] click Interface4 "/api/Cake.SevenZip.Arguments/IHaveArgument" Type-.->Interface5["ISupportSwitchIncludeFilenames"] click Interface5 "/api/Cake.SevenZip.Switches/ISupportSwitchIncludeFilenames" Type-.->Interface6["ISupportSwitchExcludeFilenames"] click Interface6 "/api/Cake.SevenZip.Switches/ISupportSwitchExcludeFilenames" Type-.->Interface7["ISupportSwitchRecurseSubdirectories"] click Interface7 "/api/Cake.SevenZip.Switches/ISupportSwitchRecurseSubdirectories" Type-.->Interface8["ISupportSwitchCompressionMethod"] click Interface8 "/api/Cake.SevenZip.Switches/ISupportSwitchCompressionMethod" Type-.->Interface9["ISupportSwitchCompressFilesOpenForWriting"] click Interface9 "/api/Cake.SevenZip.Switches/ISupportSwitchCompressFilesOpenForWriting" Type-.->Interface10["ISupportSwitchNtfsAlternateStreams"] click Interface10 "/api/Cake.SevenZip.Switches/ISupportSwitchNtfsAlternateStreams" Type-.->Interface11["ISupportSwitchSetHashFunction"] click Interface11 "/api/Cake.SevenZip.Switches/ISupportSwitchSetHashFunction" Type-.->Interface12["ISupportSwitch"] click Interface12 "/api/Cake.SevenZip.Switches/ISupportSwitch" Type["HashCommand"] class Type type-node

Syntax

public sealed class HashCommand : BaseOutputCommand<IHashOutput>, ICommand, ICanParseOutput, 
    IHaveArgumentFiles, IHaveArgumentDirectories, IHaveArgument, ISupportSwitchIncludeFilenames, 
    ISupportSwitchExcludeFilenames, ISupportSwitchRecurseSubdirectories, 
    ISupportSwitchCompressionMethod, ISupportSwitchCompressFilesOpenForWriting, 
    ISupportSwitchNtfsAlternateStreams, ISupportSwitchSetHashFunction, ISupportSwitch

Constructors

Name Summary
HashCommand() Initializes a new instance of the HashCommand class.

Properties

Name Value Summary
CommandChar string
Gets the command character. (e.g. "a", "u" or "e"...)
CompressFilesOpenForWriting SwitchCompressFilesOpenForWriting
Gets or sets the SwitchCompressFilesOpenForWriting.
CompressionMethod SwitchCompressionMethod
Gets or sets the compression method.
Directories DirectoryPathCollection
Gets or sets the list of Directories the command operates on.

For add and update, adding a directory will add the directory itself to the root of the archive including everything in it.

DirectoryContents DirectoryPathCollection
Gets or sets the list of Directory-contents the command operates on.

For add and update, adding a directory this way will add the files of the directory to the root of the archive but not the directory itself.

ExcludeFilenames SwitchExcludeFilenameCollection
Gets or sets the SwitchExcludeFilenameCollection.
Files FilePathCollection
Gets or sets the list of files this command operates on. These are single files. (I.e. to add to, or to remove from the archive).

For add and update, single files from the file-system will always be placed directly into the archive without any directory-structure.

Setting Files like this in add/update:
Files = new[] {
  new FilePath("C:\\some\\place\\a.txt"),
  new FilePath("C:\\some\\other\\place\\b.txt"),
  new FilePath("C:\\a\\totally\\different\\place\\c.txt")
};
Will result in an archive:
Archive.zip
- a.txt
- b.txt
- c.txt
without any directory structure.
HashFunctions SwitchSetHashFunctionCollection
Gets or sets the SwitchNtfsAlternateStreams.
IncludeFilenames SwitchIncludeFilenameCollection
Gets or sets the SwitchIncludeFilenameCollection.
NtfsAlternateStreams SwitchNtfsAlternateStreams
Gets or sets the SwitchNtfsAlternateStreams.
RecurseSubdirectories SwitchRecurseSubdirectories
Gets or sets the SwitchRecurseSubdirectories.
Switches IEnumerable<ISwitch>
Gets all supported switches.

Methods

Name Value Summary
BuildArgumentParams(ProcessArgumentBuilder) void
adds only the arguments to the builder. (i.e. Archive, files, directories).
BuildArguments(ProcessArgumentBuilder) void
Builds the arguments.
Inherited from BaseCommand

Extension Methods

Name Value Summary
Dump<HashCommand>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<HashCommand>(HashCommand[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<HashCommand>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
NotNull<HashCommand>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
ThrowIfNull<HashCommand>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<HashCommand>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin