diff options
Diffstat (limited to 'src/WixToolset.Data/Tuples/FileTuple.cs')
-rw-r--r-- | src/WixToolset.Data/Tuples/FileTuple.cs | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Tuples/FileTuple.cs b/src/WixToolset.Data/Tuples/FileTuple.cs new file mode 100644 index 00000000..6c184b63 --- /dev/null +++ b/src/WixToolset.Data/Tuples/FileTuple.cs | |||
@@ -0,0 +1,140 @@ | |||
1 | // 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. | ||
2 | |||
3 | namespace WixToolset.Data | ||
4 | { | ||
5 | using WixToolset.Data.Tuples; | ||
6 | |||
7 | public static partial class TupleDefinitions | ||
8 | { | ||
9 | public static readonly IntermediateTupleDefinition File = new IntermediateTupleDefinition( | ||
10 | TupleDefinitionType.File, | ||
11 | new[] | ||
12 | { | ||
13 | new IntermediateFieldDefinition(nameof(FileTupleFields.File), IntermediateFieldType.String), | ||
14 | new IntermediateFieldDefinition(nameof(FileTupleFields.Component_), IntermediateFieldType.String), | ||
15 | new IntermediateFieldDefinition(nameof(FileTupleFields.ShortFileName), IntermediateFieldType.String), | ||
16 | new IntermediateFieldDefinition(nameof(FileTupleFields.LongFileName), IntermediateFieldType.String), | ||
17 | new IntermediateFieldDefinition(nameof(FileTupleFields.FileSize), IntermediateFieldType.Number), | ||
18 | new IntermediateFieldDefinition(nameof(FileTupleFields.Version), IntermediateFieldType.String), | ||
19 | new IntermediateFieldDefinition(nameof(FileTupleFields.Language), IntermediateFieldType.String), | ||
20 | new IntermediateFieldDefinition(nameof(FileTupleFieldsOriginal.ReadOnly), IntermediateFieldType.Bool), | ||
21 | new IntermediateFieldDefinition(nameof(FileTupleFieldsOriginal.Hidden), IntermediateFieldType.Bool), | ||
22 | new IntermediateFieldDefinition(nameof(FileTupleFieldsOriginal.System), IntermediateFieldType.Bool), | ||
23 | new IntermediateFieldDefinition(nameof(FileTupleFieldsOriginal.Vital), IntermediateFieldType.Bool), | ||
24 | new IntermediateFieldDefinition(nameof(FileTupleFieldsOriginal.Checksum), IntermediateFieldType.Bool), | ||
25 | new IntermediateFieldDefinition(nameof(FileTupleFieldsOriginal.Compressed), IntermediateFieldType.Bool), | ||
26 | }, | ||
27 | typeof(FileTuple)); | ||
28 | } | ||
29 | } | ||
30 | |||
31 | namespace WixToolset.Data.Tuples | ||
32 | { | ||
33 | public enum FileTupleFields | ||
34 | { | ||
35 | File, | ||
36 | Component_, | ||
37 | ShortFileName, | ||
38 | LongFileName, | ||
39 | FileSize, | ||
40 | Version, | ||
41 | Language, | ||
42 | ReadOnly, | ||
43 | Hidden, | ||
44 | System, | ||
45 | Vital, | ||
46 | Checksum, | ||
47 | Compressed, | ||
48 | } | ||
49 | |||
50 | public class FileTuple : IntermediateTuple | ||
51 | { | ||
52 | public FileTuple() : base(TupleDefinitions.File, null, null) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | public FileTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.File, sourceLineNumber, id) | ||
57 | { | ||
58 | } | ||
59 | |||
60 | public IntermediateField this[FileTupleFields index] => this.Fields[(int)index]; | ||
61 | |||
62 | public string File | ||
63 | { | ||
64 | get => (string)this.Fields[(int)FileTupleFields.File]?.Value; | ||
65 | set => this.Set((int)FileTupleFields.File, value); | ||
66 | } | ||
67 | |||
68 | public string Component_ | ||
69 | { | ||
70 | get => (string)this.Fields[(int)FileTupleFields.Component_]?.Value; | ||
71 | set => this.Set((int)FileTupleFields.Component_, value); | ||
72 | } | ||
73 | |||
74 | public string ShortFileName | ||
75 | { | ||
76 | get => (string)this.Fields[(int)FileTupleFields.ShortFileName]?.Value; | ||
77 | set => this.Set((int)FileTupleFields.ShortFileName, value); | ||
78 | } | ||
79 | |||
80 | public string LongFileName | ||
81 | { | ||
82 | get => (string)this.Fields[(int)FileTupleFields.LongFileName]?.Value; | ||
83 | set => this.Set((int)FileTupleFields.LongFileName, value); | ||
84 | } | ||
85 | |||
86 | public int FileSize | ||
87 | { | ||
88 | get => (int)this.Fields[(int)FileTupleFields.FileSize]?.Value; | ||
89 | set => this.Set((int)FileTupleFields.FileSize, value); | ||
90 | } | ||
91 | |||
92 | public string Version | ||
93 | { | ||
94 | get => (string)this.Fields[(int)FileTupleFields.Version]?.Value; | ||
95 | set => this.Set((int)FileTupleFields.Version, value); | ||
96 | } | ||
97 | |||
98 | public string Language | ||
99 | { | ||
100 | get => (string)this.Fields[(int)FileTupleFields.Language]?.Value; | ||
101 | set => this.Set((int)FileTupleFields.Language, value); | ||
102 | } | ||
103 | |||
104 | public bool ReadOnly | ||
105 | { | ||
106 | get => (bool)this.Fields[(int)FileTupleFields.ReadOnly]?.Value; | ||
107 | set => this.Set((int)FileTupleFields.ReadOnly, value); | ||
108 | } | ||
109 | |||
110 | public bool Hidden | ||
111 | { | ||
112 | get => (bool)this.Fields[(int)FileTupleFields.Hidden]?.Value; | ||
113 | set => this.Set((int)FileTupleFields.Hidden, value); | ||
114 | } | ||
115 | |||
116 | public bool System | ||
117 | { | ||
118 | get => (bool)this.Fields[(int)FileTupleFields.System]?.Value; | ||
119 | set => this.Set((int)FileTupleFields.System, value); | ||
120 | } | ||
121 | |||
122 | public bool Vital | ||
123 | { | ||
124 | get => (bool)this.Fields[(int)FileTupleFields.Vital]?.Value; | ||
125 | set => this.Set((int)FileTupleFields.Vital, value); | ||
126 | } | ||
127 | |||
128 | public bool Checksum | ||
129 | { | ||
130 | get => (bool)this.Fields[(int)FileTupleFields.Checksum]?.Value; | ||
131 | set => this.Set((int)FileTupleFields.Checksum, value); | ||
132 | } | ||
133 | |||
134 | public bool? Compressed | ||
135 | { | ||
136 | get => (bool?)this.Fields[(int)FileTupleFields.Compressed]?.Value; | ||
137 | set => this.Set((int)FileTupleFields.Compressed, value); | ||
138 | } | ||
139 | } | ||
140 | } | ||