/// <summary> /// Creates a new ZipFileSystem /// </summary> /// <param name="stream">The stream</param> /// <param name="leaveOpen">If false, the stream is disposed with the ZipFileSystem</param> public ZipFileSystem(Stream stream, bool leaveOpen) { za = new ZipArchive(stream, ZipArchiveMode.Read, leaveOpen); this.root = new TOCDirectory(); this.root.FullName = ""; this.root.Name = ""; LoadTOC(); }
public ZipArchiveEntryDirectory(ZipFileSystem root, TOCDirectory directory) { this.root = root; this.directory = directory; }
public FileIndex(TOCDirectory TD) { this.TD = TD; }
public TOCDirectory Create(string path) { var parts = path.Split('/'); var cd = TD; for (int i = 0; i < parts.Length; i++) { var part = parts[i]; var fod = cd.DirectoryTable.Where(x => x.Name == part).FirstOrDefault(); if (fod == null) { fod = new TOCDirectory(cd, part); cd.DirectoryTable.Add(fod); } cd = fod; } return cd; }
public DirectoryIndex(TOCDirectory TD) { this.TD = TD; }
public TOCDirectory(TOCDirectory Parent, string Name) { this.Name = Name; this.Parent = Parent; this.FullName = Parent.RelativeTo(Name); this.DirectoryTable = new List<TOCDirectory>(); this.FileTable = new List<TOCFile>(); }