-
Notifications
You must be signed in to change notification settings - Fork 6
/
IO.cs
29 lines (25 loc) · 821 Bytes
/
IO.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using LibHac;
using System.Windows.Forms;
namespace SwitchExplorer
{
internal class IO
{
// Thanks to Alex Barney for providing this code!
public static void PopulateTreeView(TreeNodeCollection nodes, RomfsDir root)
{
RomfsFile fileNode = root.FirstFile;
while (fileNode != null)
{
nodes.Add(fileNode.FullPath, fileNode.Name);
fileNode = fileNode.NextSibling;
}
RomfsDir dirNode = root.FirstChild;
while (dirNode != null)
{
TreeNode newNode = nodes.Add(dirNode.FullPath, dirNode.Name);
PopulateTreeView(newNode.Nodes, dirNode);
dirNode = dirNode.NextSibling;
}
}
}
}