< Summary

Information
Class: DeltaSharp.Format.DeltaCommand
Assembly: DeltaSharp
File(s): /home/runner/work/DeltaSharp/DeltaSharp/src/DeltaSharp/Format/DeltaCommand.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 39
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Command()100%11100%
get_Position()100%11100%
get_Length()100%11100%
.ctor(...)100%11100%

File(s)

/home/runner/work/DeltaSharp/DeltaSharp/src/DeltaSharp/Format/DeltaCommand.cs

#LineLine coverage
 1namespace DeltaSharp.Format;
 2
 3/// <summary>Describes a decoded delta command without retaining its encoded bytes or insert payload.</summary>
 4public readonly ref struct DeltaCommand
 5{
 6    /// <summary>Gets the operation represented by this command.</summary>
 6928607    public readonly DeltaCommandEnum Command { get; }
 8
 9    /// <summary>Gets the zero-based source byte offset for a copy command; unused for other commands.</summary>
 69945010    public readonly ulong Position { get; }
 11
 12    /// <summary>Gets the output length, insert or copy byte count, or checksum value, according to <see cref="Command"/
 222545013    public readonly ulong Length { get; }
 14
 15    /// <summary>Initializes a command with the supplied operands without validating them.</summary>
 16    /// <param name="command">The operation to represent.</param>
 17    /// <param name="position">The source byte offset for a copy command; normally zero for other commands.</param>
 18    /// <param name="length">The target length, insert or copy byte count, or checksum value for the operation.</param>
 19    public DeltaCommand(DeltaCommandEnum command, ulong position, ulong length)
 20    {
 61702021        Command = command;
 61702022        Position = position;
 61702023        Length = length;
 61702024    }
 25
 26}
 27
 28/// <summary>Identifies the operations in a delta command stream.</summary>
 29public enum DeltaCommandEnum
 30{
 31    /// <summary>Declares the total reconstructed target length in bytes.</summary>
 32    Length,
 33    /// <summary>Appends literal bytes following the command header to the target.</summary>
 34    Insert,
 35    /// <summary>Appends a range of bytes from the original source to the target.</summary>
 36    Copy,
 37    /// <summary>Supplies the target checksum and terminates the patch.</summary>
 38    Checksum
 39}