示例#1
0
 public PakEntry(PakPackage package, string path, int offset, int length)
 {
     Package = package;
     Path    = path;
     Offset  = offset;
     Length  = length;
 }
示例#2
0
文件: PakEntry.cs 项目: silky/sledge
 public PakEntry(PakPackage package, string path, int offset, int length)
 {
     Package = package;
     Path = path;
     Offset = offset;
     Length = length;
 }
示例#3
0
 public PakPackageStreamSource(PakPackage package)
 {
     _package = package;
     _stream = package.OpenFile(package.PackageFile);
     _folders = new Dictionary<string, HashSet<string>>();
     _files = new Dictionary<string, HashSet<string>>();
     foreach (var entry in package.GetEntries())
     {
         var split = entry.FullName.Split('/');
         var joined = "";
         for (var i = 0; i < split.Length; i++)
         {
             var sub = split[i];
             var name = joined.Length == 0 ? sub : joined + '/' + sub;
             if (i == split.Length - 1)
             {
                 // File name
                 if (!_files.ContainsKey(joined)) _files.Add(joined, new HashSet<string>());
                 _files[joined].Add(name);
             }
             else
             {
                 // Folder name
                 if (!_folders.ContainsKey(joined)) _folders.Add(joined, new HashSet<string>());
                 if (!_folders[joined].Contains(sub)) _folders[joined].Add(name);
             }
             joined = joined.Length == 0 ? sub : joined + '/' + sub;
         }
     }
 }
示例#4
0
 public PakPackageStreamSource(PakPackage package)
 {
     _package = package;
     _stream  = package.OpenFile(package.PackageFile);
     _folders = new Dictionary <string, HashSet <string> >();
     _files   = new Dictionary <string, HashSet <string> >();
     foreach (var entry in package.GetEntries())
     {
         var split  = entry.FullName.Split('/');
         var joined = "";
         for (var i = 0; i < split.Length; i++)
         {
             var sub  = split[i];
             var name = joined.Length == 0 ? sub : joined + '/' + sub;
             if (i == split.Length - 1)
             {
                 // File name
                 if (!_files.ContainsKey(joined))
                 {
                     _files.Add(joined, new HashSet <string>());
                 }
                 _files[joined].Add(name);
             }
             else
             {
                 // Folder name
                 if (!_folders.ContainsKey(joined))
                 {
                     _folders.Add(joined, new HashSet <string>());
                 }
                 if (!_folders[joined].Contains(sub))
                 {
                     _folders[joined].Add(name);
                 }
             }
             joined = joined.Length == 0 ? sub : joined + '/' + sub;
         }
     }
 }