aboutsummaryrefslogtreecommitdiff
path: root/src/api/wix/WixToolset.Data/Symbols/PatchSymbol.cs
blob: 31e68d76b142f988ad42efc3ebb92ba79fb40076 (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.Symbols;

    public static partial class SymbolDefinitions
    {
        public static readonly IntermediateSymbolDefinition Patch = new IntermediateSymbolDefinition(
            SymbolDefinitionType.Patch,
            new[]
            {
                new IntermediateFieldDefinition(nameof(PatchSymbolFields.FileRef), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(PatchSymbolFields.Sequence), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(PatchSymbolFields.PatchSize), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(PatchSymbolFields.Attributes), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(PatchSymbolFields.Header), IntermediateFieldType.Path),
                new IntermediateFieldDefinition(nameof(PatchSymbolFields.StreamRef), IntermediateFieldType.String),
            },
            typeof(PatchSymbol));
    }
}

namespace WixToolset.Data.Symbols
{
    public enum PatchSymbolFields
    {
        FileRef,
        Sequence,
        PatchSize,
        Attributes,
        Header,
        StreamRef,
    }

    public class PatchSymbol : IntermediateSymbol
    {
        public PatchSymbol() : base(SymbolDefinitions.Patch, null, null)
        {
        }

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

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

        public string FileRef
        {
            get => (string)this.Fields[(int)PatchSymbolFields.FileRef];
            set => this.Set((int)PatchSymbolFields.FileRef, value);
        }

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

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

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

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

        public string StreamRef
        {
            get => (string)this.Fields[(int)PatchSymbolFields.StreamRef];
            set => this.Set((int)PatchSymbolFields.StreamRef, value);
        }
    }
}