Example #1
0
        public static void DumpTreeNode(GGPKFileStream stream, TreeNode n, string path, bool skipExisting=false)
        {
            if (n.IsFileNode) {
            var fileNode = n.Element.Left;
            var filePath = Path.Combine(path, fileNode.FileName);
            if (skipExisting && File.Exists(filePath))
              return;
            ExportFileNode(stream, n.Element.Left, filePath);
              }
              else if (n.IsDirectoryTreeNode) {
            var dir = n.Element.Right;
            var subPath = Path.Combine(path, dir.Node.Name);
            Directory.CreateDirectory(subPath);

            foreach (var child in dir.Children) {
              DumpTreeNode(stream, child, subPath, skipExisting);
            }
              }
        }
Example #2
0
 public static void BrowseTree(PathOfExile.GGPK.TreeNode node, string path)
 {
     if (node.IsFileNode)
     {
         var fileNode = node.FileNode;
         var filePath = Path.Combine(path, fileNode.FileName);
         //if (filePath.ToLower().Contains("filter"))
         strGGPKTree += filePath + "\n";
     }
     else if (node.IsDirectoryTreeNode)
     {
         var dirNode = node.DirectoryTreeNode;
         var subPath = Path.Combine(path, dirNode.Node.Name);
         foreach (var child in dirNode.Children)
         {
             BrowseTree(child, subPath);
         }
     }
 }
Example #3
0
 public void DumpTreeNode(TreeNode n, string path, bool skipExisting = false)
 {
     using (var fs = GetStream()) {
     DumpTreeNode(fs, n, path, skipExisting);
       }
 }