public PakEntry(PakPackage package, string path, int offset, int length) { Package = package; Path = path; Offset = offset; Length = length; }
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; } } }
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; } } }