diff options
author | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:56:09 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:56:09 -0700 |
commit | 69b15d96cebdbb7201b1849b4f62786633d70b8d (patch) | |
tree | 4b65de8679e4b4ab81b69edcccbac1ae9f55a16d /src/WixToolset.Data/Bind | |
parent | a8656a87887d6cb2c54f4bbeacee37f7074f1032 (diff) | |
download | wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.tar.gz wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.tar.bz2 wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.zip |
Introduce WiX Intermediate Representation
Diffstat (limited to 'src/WixToolset.Data/Bind')
-rw-r--r-- | src/WixToolset.Data/Bind/BindPath.cs | 60 | ||||
-rw-r--r-- | src/WixToolset.Data/Bind/BindVariable.cs | 33 |
2 files changed, 93 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Bind/BindPath.cs b/src/WixToolset.Data/Bind/BindPath.cs new file mode 100644 index 00000000..823a57c9 --- /dev/null +++ b/src/WixToolset.Data/Bind/BindPath.cs | |||
@@ -0,0 +1,60 @@ | |||
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 System; | ||
6 | using WixToolset.Data.Bind; | ||
7 | |||
8 | /// <summary> | ||
9 | /// Bind path representation. | ||
10 | /// </summary> | ||
11 | public class BindPath | ||
12 | { | ||
13 | /// <summary> | ||
14 | /// Creates an unnamed bind path. | ||
15 | /// </summary> | ||
16 | /// <param name="path">Path for the bind path.</param> | ||
17 | public BindPath(string path) : this(String.Empty, path, BindStage.Normal) | ||
18 | { | ||
19 | } | ||
20 | |||
21 | /// <summary> | ||
22 | /// Creates a named bind path. | ||
23 | /// </summary> | ||
24 | /// <param name="name">Name of the bind path.</param> | ||
25 | /// <param name="path">Path for the bind path.</param> | ||
26 | /// <param name="stage">Stage for the bind path.</param> | ||
27 | public BindPath(string name, string path, BindStage stage = BindStage.Normal) | ||
28 | { | ||
29 | this.Name = name; | ||
30 | this.Path = path; | ||
31 | this.Stage = stage; | ||
32 | } | ||
33 | |||
34 | /// <summary> | ||
35 | /// Name of the bind path or String.Empty if the path is unnamed. | ||
36 | /// </summary> | ||
37 | public string Name { get; set; } | ||
38 | |||
39 | /// <summary> | ||
40 | /// Path for the bind path. | ||
41 | /// </summary> | ||
42 | public string Path { get; set; } | ||
43 | |||
44 | /// <summary> | ||
45 | /// Stage for the bind path. | ||
46 | /// </summary> | ||
47 | public BindStage Stage { get; set; } | ||
48 | |||
49 | /// <summary> | ||
50 | /// Parses a normal bind path from its string representation | ||
51 | /// </summary> | ||
52 | /// <param name="bindPath">String representation of bind path that looks like: [name=]path</param> | ||
53 | /// <returns>Parsed normal bind path.</returns> | ||
54 | public static BindPath Parse(string bindPath) | ||
55 | { | ||
56 | string[] namedPath = bindPath.Split(new char[] { '=' }, 2); | ||
57 | return (1 == namedPath.Length) ? new BindPath(namedPath[0]) : new BindPath(namedPath[0], namedPath[1]); | ||
58 | } | ||
59 | } | ||
60 | } | ||
diff --git a/src/WixToolset.Data/Bind/BindVariable.cs b/src/WixToolset.Data/Bind/BindVariable.cs new file mode 100644 index 00000000..06c004e1 --- /dev/null +++ b/src/WixToolset.Data/Bind/BindVariable.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 | |||
3 | namespace WixToolset.Data.Rows | ||
4 | { | ||
5 | /// <summary> | ||
6 | /// Specialization of a row for the WixVariable table. | ||
7 | /// </summary> | ||
8 | public sealed class BindVariable | ||
9 | { | ||
10 | /// <summary> | ||
11 | /// Gets or sets the source line number. | ||
12 | /// </summary> | ||
13 | public SourceLineNumber SourceLineNumbers { get; set; } | ||
14 | |||
15 | /// <summary> | ||
16 | /// Gets or sets the variable identifier. | ||
17 | /// </summary> | ||
18 | /// <value>The variable identifier.</value> | ||
19 | public string Id { get; set; } | ||
20 | |||
21 | /// <summary> | ||
22 | /// Gets or sets the variable's value. | ||
23 | /// </summary> | ||
24 | /// <value>The variable's value.</value> | ||
25 | public string Value { get; set; } | ||
26 | |||
27 | /// <summary> | ||
28 | /// Gets or sets whether this variable is overridable. | ||
29 | /// </summary> | ||
30 | /// <value>Whether this variable is overridable.</value> | ||
31 | public bool Overridable { get; set; } | ||
32 | } | ||
33 | } | ||