public VArchiveFile(IrosArc arc, string filename) { _arc = arc; _filename = filename; _position = 0; _size = arc.GetFileSize(filename); }
public IEnumerable <OverrideFile> GetOverrides(string path) { if (_archive != null) { foreach (var cf in Conditionals) { string file = System.IO.Path.Combine(cf.Folder, path); if (_archive.HasFile(file)) { yield return new OverrideFile() { File = file, CName = path, CFolder = cf, Size = _archive.GetFileSize(file), Archive = _archive } } ; } foreach (string extra in ExtraFolders) { string file = System.IO.Path.Combine(extra, path); if (_archive.HasFile(file)) { yield return new OverrideFile() { File = file, CName = path, CFolder = null, Size = _archive.GetFileSize(file), Archive = _archive } } ; } if (_archive.HasFile(path)) { yield return new OverrideFile() { File = path, CName = path, CFolder = null, Size = _archive.GetFileSize(path), Archive = _archive } } ; } else { string file; foreach (var cf in Conditionals) { file = System.IO.Path.Combine(BaseFolder, cf.Folder, path); if (FileExists(file)) { yield return new OverrideFile() { File = file, CName = path, CFolder = cf, Size = (int)new System.IO.FileInfo(file).Length } } ; } foreach (string extra in ExtraFolders) { file = System.IO.Path.Combine(BaseFolder, extra, path); if (FileExists(file)) { yield return new OverrideFile() { File = file, CName = path, CFolder = null, Size = (int)new System.IO.FileInfo(file).Length } } ; } file = System.IO.Path.Combine(BaseFolder, path); if (FileExists(file)) { yield return new OverrideFile() { File = file, CName = path, CFolder = null, Size = (int)new System.IO.FileInfo(file).Length } } ; } }