Add performance optimized methods and remove obsolete CreateDirectoryRow
Rob Mensching committed
Jul 11, 2020 at 00:04 UTC
295cc50990666333c6f021416b273dbc43b57ac5
1 file changed
+21
-17
src/WixToolset.Extensibility/Services/IParseHelper.cs
+21
-17
@@ -85,26 +85,23 @@ namespace WixToolset.Extensibility.Services
85
/// <param name="id">Optional identifier for the new row.</param>
86
/// <param name="parentId">Optional identifier for the parent row.</param>
87
/// <param name="name">Long name of the directory.</param>
88
- /// <param name="sectionInlinedDirectoryIds">Inline directory ids for the section.</param>
88
/// <param name="shortName">Optional short name of the directory.</param>
89
/// <param name="sourceName">Optional source name for the directory.</param>
90
/// <param name="shortSourceName">Optional short source name for the directory.</param>
91
/// <returns>Identifier for the newly created row.</returns>
93
- Identifier CreateDirectorySymbol(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, string name, ISet<string> sectionInlinedDirectoryIds, string shortName = null, string sourceName = null, string shortSourceName = null);
94
-
95
- [Obsolete]
96
- Identifier CreateDirectoryRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, string name, ISet<string> sectionInlinedDirectoryIds, string shortName = null, string sourceName = null, string shortSourceName = null);
92
+ Identifier CreateDirectorySymbol(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, string name, string shortName = null, string sourceName = null, string shortSourceName = null);
93
94
/// <summary>
95
/// Creates directories using the inline directory syntax.
96
/// </summary>
97
/// <param name="section">Section to add the new symbol to.</param>
98
/// <param name="sourceLineNumbers">Source line information.</param>
99
+ /// <param name="attribute">Attribute containing the inline syntax.</param>
100
/// <param name="parentId">Optional identifier of parent directory.</param>
104
- /// <param name="attribute">The attribute to parse.</param>
105
- /// <param name="sectionInlinedDirectoryIds">Inline directory ids for the section.</param>
101
+ /// <param name="inlineSyntax">Optional inline syntax to override attribute's value.</param>
102
+ /// <param name="sectionCachedInlinedDirectoryIds">Mapping of inline directory syntax to ids for the section.</param>
103
/// <returns>Identifier of the leaf directory created.</returns>
107
- string CreateDirectoryReferenceFromInlineSyntax(IntermediateSection section, SourceLineNumber sourceLineNumbers, string parentId, XAttribute attribute, ISet<string> sectionInlinedDirectoryIds);
104
+ string CreateDirectoryReferenceFromInlineSyntax(IntermediateSection section, SourceLineNumber sourceLineNumbers, XAttribute attribute, string parentId, string inlineSyntax, IDictionary<string, string> sectionCachedInlinedDirectoryIds);
105
106
/// <summary>
107
/// Creates a Registry symbol in the active section.
@@ -131,6 +128,14 @@ namespace WixToolset.Extensibility.Services
128
/// <returns>The generated 8.3-compliant short file/directory name.</returns>
129
string CreateShortName(string longName, bool keepExtension, bool allowWildcards, params string[] args);
130
131
+ /// <summary>
132
+ /// Create a WixSimpleReference symbol in the active section.
133
+ /// </summary>
134
+ /// <param name="sourceLineNumbers">Source line information for the row.</param>
135
+ /// <param name="symbolName">The symbol name of the simple reference.</param>
136
+ /// <param name="primaryKey">The primary key of the simple reference.</param>
137
+ void CreateSimpleReference(IntermediateSection section, SourceLineNumber sourceLineNumbers, string symbolName, string primaryKey);
138
+
139
/// <summary>
140
/// Create a WixSimpleReference symbol in the active section.
141
/// </summary>
@@ -139,6 +144,14 @@ namespace WixToolset.Extensibility.Services
144
/// <param name="primaryKeys">The primary keys of the simple reference.</param>
145
void CreateSimpleReference(IntermediateSection section, SourceLineNumber sourceLineNumbers, string symbolName, params string[] primaryKeys);
146
147
+ /// <summary>
148
+ /// Create a WixSimpleReference symbol in the active section.
149
+ /// </summary>
150
+ /// <param name="sourceLineNumbers">Source line information for the row.</param>
151
+ /// <param name="symbolDefinition">The symbol definition of the simple reference.</param>
152
+ /// <param name="primaryKey">The primary key of the simple reference.</param>
153
+ void CreateSimpleReference(IntermediateSection section, SourceLineNumber sourceLineNumbers, IntermediateSymbolDefinition symbolDefinition, string primaryKey);
154
+
155
/// <summary>
156
/// Create a WixSimpleReference symbol in the active section.
157
/// </summary>
@@ -264,15 +277,6 @@ namespace WixToolset.Extensibility.Services
277
/// <returns>The attribute's identifier value or a special value if an error occurred.</returns>
278
string GetAttributeIdentifierValue(SourceLineNumber sourceLineNumbers, XAttribute attribute);
279
267
- /// <summary>
268
- /// Gets the attribute value as inline directory syntax.
269
- /// </summary>
270
- /// <param name="sourceLineNumbers">Source line information.</param>
271
- /// <param name="attribute">Attribute containing the value to get.</param>
272
- /// <param name="resultUsedToCreateReference">Flag indicates whether the inline directory syntax should be processed to create a directory row or to create a directory reference.</param>
273
- /// <returns>Inline directory syntax split into array of strings or null if the syntax did not parse.</returns>
274
- string[] GetAttributeInlineDirectorySyntax(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool resultUsedToCreateReference);
275
-
280
/// <summary>
281
/// Get an integer attribute value and displays an error for an illegal integer value.
282
/// </summary>