示例#1
0
 /// <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();
 }
示例#2
0
 public ZipArchiveEntryDirectory(ZipFileSystem root, TOCDirectory directory)
 {
     this.root = root;
     this.directory = directory;
 }
示例#3
0
 public FileIndex(TOCDirectory TD)
 {
     this.TD = TD;
 }
示例#4
0
                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;
                }
示例#5
0
 public DirectoryIndex(TOCDirectory TD)
 {
     this.TD = TD;
 }
示例#6
0
 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>();
 }