main
cs 77 lines 3.93 KB
Raw
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.Extensibility.Services
4 {
5 using WixToolset.Data;
6 using WixToolset.Extensibility.Data;
7
8 /// <summary>
9 /// Interface provided to help with bundle validation.
10 /// </summary>
11 public interface IBundleValidator
12 {
13
14 /// <summary>
15 /// Validates path is relative and canonicalizes it.
16 /// For example, "a\..\c\.\d.exe" => "c\d.exe".
17 /// </summary>
18 /// <param name="sourceLineNumbers"></param>
19 /// <param name="elementName"></param>
20 /// <param name="attributeName"></param>
21 /// <param name="relativePath"></param>
22 /// <returns>The original value if not relative, otherwise the canonicalized relative path.</returns>
23 string GetCanonicalRelativePath(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string relativePath);
24
25 /// <summary>
26 /// Validates an MsiProperty name value and displays an error for an illegal value.
27 /// </summary>
28 /// <param name="sourceLineNumbers"></param>
29 /// <param name="elementName"></param>
30 /// <param name="attributeName"></param>
31 /// <param name="propertyName"></param>
32 /// <returns>Whether the name is valid.</returns>
33 bool ValidateBundleMsiPropertyName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string propertyName);
34
35 /// <summary>
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>
38 /// <param name="sourceLineNumbers"></param>
39 /// <param name="elementName"></param>
40 /// <param name="attributeName"></param>
41 /// <param name="variableName"></param>
42 /// <returns>Whether the name is valid.</returns>
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);
65
66 /// <summary>
67 /// Validates a bundle condition and displays an error for an illegal value.
68 /// </summary>
69 /// <param name="sourceLineNumbers"></param>
70 /// <param name="elementName"></param>
71 /// <param name="attributeName"></param>
72 /// <param name="condition"></param>
73 /// <param name="phase"></param>
74 /// <returns>Whether the condition is valid.</returns>
75 bool ValidateBundleCondition(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string condition, BundleConditionPhase phase);
76 }
77 }