Skip to content

Commit 7eb401e

Browse files
committed
Port obvious things from UnshieldSharp
1 parent ba97381 commit 7eb401e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

SabreTools.Serialization/Wrappers/InstallShieldArchiveV3.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Collections.Generic;
12
using System.IO;
23
using SabreTools.Models.InstallShieldArchiveV3;
34

@@ -12,6 +13,41 @@ public partial class InstallShieldArchiveV3 : WrapperBase<Archive>
1213

1314
#endregion
1415

16+
#region Extension Properties
17+
18+
/// <inheritdoc cref="Archive.Directories"/>
19+
public Models.InstallShieldArchiveV3.Directory[] Directories => Model.Directories ?? [];
20+
21+
/// <inheritdoc cref="Archive.Files"/>
22+
public Models.InstallShieldArchiveV3.File[] Files => Model.Files ?? [];
23+
24+
/// <summary>
25+
/// Map of all directories found in the archive
26+
/// </summary>
27+
public Dictionary<string, Models.InstallShieldArchiveV3.File> FileMap
28+
{
29+
get
30+
{
31+
// Build the file map if not already
32+
if (_fileMap == null)
33+
{
34+
_fileMap = [];
35+
foreach (var file in Model.Files ?? [])
36+
{
37+
if (file?.Name == null)
38+
continue;
39+
40+
_fileMap[file.Name] = file;
41+
}
42+
}
43+
44+
return _fileMap;
45+
}
46+
}
47+
private Dictionary<string, Models.InstallShieldArchiveV3.File>? _fileMap = null;
48+
49+
#endregion
50+
1551
#region Constructors
1652

1753
/// <inheritdoc/>

0 commit comments

Comments
 (0)