aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/api')
-rw-r--r--src/api/wix/WixToolset.Extensibility/Data/BundleVariableNameRule.cs33
-rw-r--r--src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs26
-rw-r--r--src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs3
3 files changed, 58 insertions, 4 deletions
diff --git a/src/api/wix/WixToolset.Extensibility/Data/BundleVariableNameRule.cs b/src/api/wix/WixToolset.Extensibility/Data/BundleVariableNameRule.cs
new file mode 100644
index 00000000..eb6f7543
--- /dev/null
+++ b/src/api/wix/WixToolset.Extensibility/Data/BundleVariableNameRule.cs
@@ -0,0 +1,33 @@
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
3namespace WixToolset.Extensibility.Data
4{
5 using System;
6
7 /// <summary>
8 /// When validating a bundle variable name, which special restrictions to ignore.
9 /// </summary>
10 [Flags]
11 public enum BundleVariableNameRule
12 {
13 /// <summary>
14 /// Enforce all special restrictions.
15 /// </summary>
16 EnforceAllRestrictions = 0x0,
17
18 /// <summary>
19 /// Allow names of built-in variables.
20 /// </summary>
21 CanBeBuiltIn = 0x1,
22
23 /// <summary>
24 /// Allow names of well-known variables.
25 /// </summary>
26 CanBeWellKnown = 0x2,
27
28 /// <summary>
29 /// Allow names that are not built-in and are not well-known and start with 'Wix'.
30 /// </summary>
31 CanHaveReservedPrefix = 0x4,
32 }
33}
diff --git a/src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs b/src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs
index 43f65fc8..3753d16d 100644
--- a/src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs
+++ b/src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs
@@ -33,15 +33,35 @@ namespace WixToolset.Extensibility.Services
33 bool ValidateBundleMsiPropertyName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string propertyName); 33 bool ValidateBundleMsiPropertyName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string propertyName);
34 34
35 /// <summary> 35 /// <summary>
36 /// Validates a Bundle variable name and displays an error for an illegal value. 36 /// Validates a Bundle variable name that is being used to declare a Variable in the bundle manifest and displays an error for an illegal value.
37 /// </summary> 37 /// </summary>
38 /// <param name="sourceLineNumbers"></param> 38 /// <param name="sourceLineNumbers"></param>
39 /// <param name="elementName"></param> 39 /// <param name="elementName"></param>
40 /// <param name="attributeName"></param> 40 /// <param name="attributeName"></param>
41 /// <param name="variableName"></param> 41 /// <param name="variableName"></param>
42 /// <param name="allowBuiltIn">Whether to bypass checks for reserved values.</param>
43 /// <returns>Whether the name is valid.</returns> 42 /// <returns>Whether the name is valid.</returns>
44 bool ValidateBundleVariableName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string variableName, bool allowBuiltIn); 43 bool ValidateBundleVariableNameDeclaration(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string variableName);
44
45 /// <summary>
46 /// Validates a Bundle variable name that is being used to reference a Variable and displays an error for an illegal value.
47 /// </summary>
48 /// <param name="sourceLineNumbers"></param>
49 /// <param name="elementName"></param>
50 /// <param name="attributeName"></param>
51 /// <param name="variableName"></param>
52 /// <param name="nameRule"></param>
53 /// <returns>Whether the name is valid.</returns>
54 bool ValidateBundleVariableNameValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string variableName, BundleVariableNameRule nameRule);
55
56 /// <summary>
57 /// Validates a Bundle variable name that is being used to set its value and displays an error for an illegal value.
58 /// </summary>
59 /// <param name="sourceLineNumbers"></param>
60 /// <param name="elementName"></param>
61 /// <param name="attributeName"></param>
62 /// <param name="variableName"></param>
63 /// <returns>Whether the name is valid.</returns>
64 bool ValidateBundleVariableNameTarget(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string variableName);
45 65
46 /// <summary> 66 /// <summary>
47 /// Validates a bundle condition and displays an error for an illegal value. 67 /// Validates a bundle condition and displays an error for an illegal value.
diff --git a/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs b/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs
index a8246b9b..3a3c2ceb 100644
--- a/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs
+++ b/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs
@@ -246,8 +246,9 @@ namespace WixToolset.Extensibility.Services
246 /// </summary> 246 /// </summary>
247 /// <param name="sourceLineNumbers">Source line information about the owner element.</param> 247 /// <param name="sourceLineNumbers">Source line information about the owner element.</param>
248 /// <param name="attribute">The attribute containing the value to get.</param> 248 /// <param name="attribute">The attribute containing the value to get.</param>
249 /// <param name="nameRule">A rule for the contents of the value. If the contents do not follow the rule, an error is thrown.</param>
249 /// <returns>The attribute's value.</returns> 250 /// <returns>The attribute's value.</returns>
250 string GetAttributeBundleVariableNameValue(SourceLineNumber sourceLineNumbers, XAttribute attribute); 251 string GetAttributeBundleVariableNameValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, BundleVariableNameRule nameRule = BundleVariableNameRule.CanBeWellKnown | BundleVariableNameRule.CanHaveReservedPrefix);
251 252
252 /// <summary> 253 /// <summary>
253 /// Get a guid attribute value and displays an error for an illegal guid value. 254 /// Get a guid attribute value and displays an error for an illegal guid value.