aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Tuples/PatchTuple.cs
blob: 268307c709e24199196d6bbdbef59b2e4697df8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Data
{
    using WixToolset.Data.Tuples;

    public static partial class TupleDefinitions
    {
        public static readonly IntermediateTupleDefinition Patch = new IntermediateTupleDefinition(
            TupleDefinitionType.Patch,
            new[]
            {
                new IntermediateFieldDefinition(nameof(PatchTupleFields.File_), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(PatchTupleFields.Sequence), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(PatchTupleFields.PatchSize), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(PatchTupleFields.Attributes), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(PatchTupleFields.Header), IntermediateFieldType.Path),
                new IntermediateFieldDefinition(nameof(PatchTupleFields.StreamRef_), IntermediateFieldType.String),
            },
            typeof(PatchTuple));
    }
}

namespace WixToolset.Data.Tuples
{
    public enum PatchTupleFields
    {
        File_,
        Sequence,
        PatchSize,
        Attributes,
        Header,
        StreamRef_,
    }

    public class PatchTuple : IntermediateTuple
    {
        public PatchTuple() : base(TupleDefinitions.Patch, null, null)
        {
        }

        public PatchTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.Patch, sourceLineNumber, id)
        {
        }

        public IntermediateField this[PatchTupleFields index] => this.Fields[(int)index];

        public string File_
        {
            get => (string)this.Fields[(int)PatchTupleFields.File_]?.Value;
            set => this.Set((int)PatchTupleFields.File_, value);
        }

        public int Sequence
        {
            get => (int)this.Fields[(int)PatchTupleFields.Sequence]?.Value;
            set => this.Set((int)PatchTupleFields.Sequence, value);
        }

        public int PatchSize
        {
            get => (int)this.Fields[(int)PatchTupleFields.PatchSize]?.Value;
            set => this.Set((int)PatchTupleFields.PatchSize, value);
        }

        public int Attributes
        {
            get => (int)this.Fields[(int)PatchTupleFields.Attributes]?.Value;
            set => this.Set((int)PatchTupleFields.Attributes, value);
        }

        public string Header
        {
            get => (string)this.Fields[(int)PatchTupleFields.Header]?.Value;
            set => this.Set((int)PatchTupleFields.Header, value);
        }

        public string StreamRef_
        {
            get => (string)this.Fields[(int)PatchTupleFields.StreamRef_]?.Value;
            set => this.Set((int)PatchTupleFields.StreamRef_, value);
        }
    }
}