| | | 1 | | namespace DeltaSharp.Format; |
| | | 2 | | |
| | | 3 | | /// <summary>Describes a decoded delta command without retaining its encoded bytes or insert payload.</summary> |
| | | 4 | | public readonly ref struct DeltaCommand |
| | | 5 | | { |
| | | 6 | | /// <summary>Gets the operation represented by this command.</summary> |
| | 692860 | 7 | | public readonly DeltaCommandEnum Command { get; } |
| | | 8 | | |
| | | 9 | | /// <summary>Gets the zero-based source byte offset for a copy command; unused for other commands.</summary> |
| | 699450 | 10 | | 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"/ |
| | 2225450 | 13 | | 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 | | { |
| | 617020 | 21 | | Command = command; |
| | 617020 | 22 | | Position = position; |
| | 617020 | 23 | | Length = length; |
| | 617020 | 24 | | } |
| | | 25 | | |
| | | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary>Identifies the operations in a delta command stream.</summary> |
| | | 29 | | public 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 | | } |