Catch up a few files missed in the Great Tuple to Symbol rename
Rob Mensching committed
Jul 1, 2020 at 13:16 UTC
634fc916f620ee46c1634327e66328fabb68c9d1
7 files changed
-242
src/WixToolset.Data/ISymbolDefinitionCreator.cs
renamed
src/WixToolset.Data/IntermediateSymbol.cs
renamed
src/WixToolset.Data/IntermediateSymbolDefinition.cs
renamed
src/WixToolset.Data/IntermediateSymbolExtensions.cs
renamed
src/WixToolset.Data/Section.cs
deleted
-242
@@ -1,242 +0,0 @@
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
-#if false
6
- using System;
7
- using System.Collections.Generic;
8
- using System.Diagnostics;
9
- using System.Globalization;
10
- using System.Linq;
11
- using System.Xml;
12
-
13
- /// <summary>
14
- /// Section in an object file.
15
- /// </summary>
16
- public sealed class Section
17
- {
18
- /// <summary>
19
- /// Creates a new section as part of an intermediate.
20
- /// </summary>
21
- /// <param name="id">Identifier for section.</param>
22
- /// <param name="type">Type of section.</param>
23
- /// <param name="codepage">Codepage for resulting database.</param>
24
- public Section(string id, SectionType type, int codepage)
25
- {
26
- this.Id = id;
27
- this.Type = type;
28
- this.Codepage = codepage;
29
-
30
- this.Tables = new TableIndexedCollection();
31
- }
32
-
33
- /// <summary>
34
- /// Gets the identifier for the section.
35
- /// </summary>
36
- /// <value>Section identifier.</value>
37
- public string Id { get; private set; }
38
-
39
- /// <summary>
40
- /// Gets the type of the section.
41
- /// </summary>
42
- /// <value>Type of section.</value>
43
- public SectionType Type { get; private set; }
44
-
45
- /// <summary>
46
- /// Gets the codepage for the section.
47
- /// </summary>
48
- /// <value>Codepage for the section.</value>
49
- public int Codepage { get; private set; }
50
-
51
- /// <summary>
52
- /// Gets the tables in the section.
53
- /// </summary>
54
- /// <value>Tables in section.</value>
55
- public TableIndexedCollection Tables { get; private set; }
56
-
57
- /// <summary>
58
- /// Gets the source line information of the file containing this section.
59
- /// </summary>
60
- /// <value>The source line information of the file containing this section.</value>
61
- public SourceLineNumber SourceLineNumbers { get; private set; }
62
-
63
- /// <summary>
64
- /// Gets the identity of the intermediate the section is contained within.
65
- /// </summary>
66
- public string IntermediateId { get; internal set; }
67
-
68
- /// <summary>
69
- /// Gets the identity of the library when the section is contained within one.
70
- /// </summary>
71
- public string LibraryId { get; internal set; }
72
-
73
- /// <summary>
74
- /// Ensures a table is added to the section's table collection.
75
- /// </summary>
76
- /// <param name="tableDefinition">Table definition for the table.</param>
77
- /// <returns>Table in the section.</returns>
78
- public Table EnsureTable(TableDefinition tableDefinition)
79
- {
80
- Table table;
81
- if (!this.Tables.TryGetTable(tableDefinition.Name, out table))
82
- {
83
- table = new Table(this, tableDefinition);
84
- this.Tables.Add(table);
85
- }
86
-
87
- return table;
88
- }
89
-
90
- /// <summary>
91
- /// Parse a section from the xml.
92
- /// </summary>
93
- /// <param name="reader">XmlReader where the intermediate is persisted.</param>
94
- /// <param name="tableDefinitions">TableDefinitions to use in the intermediate.</param>
95
- /// <returns>The parsed Section.</returns>
96
- internal static Section Read(XmlReader reader, TableDefinitionCollection tableDefinitions)
97
- {
98
- Debug.Assert("section" == reader.LocalName);
99
-
100
- int codepage = 0;
101
- bool empty = reader.IsEmptyElement;
102
- string id = null;
103
- SectionType type = SectionType.Unknown;
104
-
105
- while (reader.MoveToNextAttribute())
106
- {
107
- switch (reader.Name)
108
- {
109
- case "codepage":
110
- codepage = Convert.ToInt32(reader.Value, CultureInfo.InvariantCulture);
111
- break;
112
- case "id":
113
- id = reader.Value;
114
- break;
115
- case "type":
116
- switch (reader.Value)
117
- {
118
- case "bundle":
119
- type = SectionType.Bundle;
120
- break;
121
- case "fragment":
122
- type = SectionType.Fragment;
123
- break;
124
- case "module":
125
- type = SectionType.Module;
126
- break;
127
- case "patchCreation":
128
- type = SectionType.PatchCreation;
129
- break;
130
- case "product":
131
- type = SectionType.Product;
132
- break;
133
- case "patch":
134
- type = SectionType.Patch;
135
- break;
136
- default:
137
- throw new XmlException();
138
- }
139
- break;
140
- }
141
- }
142
-
143
- if (null == id && (SectionType.Unknown != type && SectionType.Fragment != type))
144
- {
145
- throw new XmlException();
146
- }
147
-
148
- if (SectionType.Unknown == type)
149
- {
150
- throw new XmlException();
151
- }
152
-
153
- Section section = new Section(id, type, codepage);
154
- section.SourceLineNumbers = SourceLineNumber.CreateFromUri(reader.BaseURI);
155
-
156
- List<Table> tables = new List<Table>();
157
- if (!empty)
158
- {
159
- bool done = false;
160
-
161
- while (!done && reader.Read())
162
- {
163
- switch (reader.NodeType)
164
- {
165
- case XmlNodeType.Element:
166
- switch (reader.LocalName)
167
- {
168
- case "table":
169
- tables.Add(Table.Read(reader, section, tableDefinitions));
170
- break;
171
- default:
172
- throw new XmlException();
173
- }
174
- break;
175
- case XmlNodeType.EndElement:
176
- done = true;
177
- break;
178
- }
179
- }
180
-
181
- if (!done)
182
- {
183
- throw new XmlException();
184
- }
185
- }
186
-
187
- section.Tables = new TableIndexedCollection(tables);
188
-
189
- return section;
190
- }
191
-
192
- /// <summary>
193
- /// Persist the Section to an XmlWriter.
194
- /// </summary>
195
- /// <param name="writer">XmlWriter which reference will be persisted to.</param>
196
- internal void Write(XmlWriter writer)
197
- {
198
- writer.WriteStartElement("section", Intermediate.XmlNamespaceUri);
199
-
200
- if (null != this.Id)
201
- {
202
- writer.WriteAttributeString("id", this.Id);
203
- }
204
-
205
- switch (this.Type)
206
- {
207
- case SectionType.Bundle:
208
- writer.WriteAttributeString("type", "bundle");
209
- break;
210
- case SectionType.Fragment:
211
- writer.WriteAttributeString("type", "fragment");
212
- break;
213
- case SectionType.Module:
214
- writer.WriteAttributeString("type", "module");
215
- break;
216
- case SectionType.Product:
217
- writer.WriteAttributeString("type", "product");
218
- break;
219
- case SectionType.PatchCreation:
220
- writer.WriteAttributeString("type", "patchCreation");
221
- break;
222
- case SectionType.Patch:
223
- writer.WriteAttributeString("type", "patch");
224
- break;
225
- }
226
-
227
- if (0 != this.Codepage)
228
- {
229
- writer.WriteAttributeString("codepage", this.Codepage.ToString());
230
- }
231
-
232
- // save the rows in table order
233
- foreach (Table table in this.Tables.OrderBy(t => t.Name))
234
- {
235
- table.Write(writer);
236
- }
237
-
238
- writer.WriteEndElement();
239
- }
240
- }
241
-#endif
242
-}