static void DumpGT2Toc(string[] args) { if (!File.Exists(args[1])) { Console.Error.WriteLine("VOL file '{0}' doesn't exist!", args[1]); return; } using (VolFile theVol = new VolFile(args[1])) { if (!theVol.CheckAndCacheHeaderDetails()) { Console.WriteLine("File is not a GT2.vol (incorrect GTFS signature, not enough entries, or total entries less than files)"); return; } theVol.ParseToc(new VolFile.TocFileNotify(EmbeddedFileNotify)); } }
static void ExplodeVol(string[] args) { bool decompGZ = (args.Length >= 4); if (!File.Exists(args[1])) { Console.Error.WriteLine("VOL file '{0}' doesn't exist!", args[1]); return; } using (VolFile theVol = new VolFile(args[1])) { if (!theVol.CheckAndCacheHeaderDetails()) { Console.WriteLine("File is not a GT2.vol (incorrect GTFS signature, not enough entries, or total entries less than files)"); return; } theVol.ParseToc(new VolFile.TocFileNotify(EmbeddedFileNotify)); theVol.Explode(args[2], decompGZ, new VolFile.ExplodeProgressCallback(WriteToConsole)); } }
public WorkUnit( string dir, EmbeddedFileInfo efiParam, VolFile volFile, bool decompGZ, ManualResetEvent compEvent, ExplodeProgressCallback epc ) { efi = efiParam; destFile = new FileStream( Path.Combine(dir, efi.name), FileMode.Create, FileAccess.ReadWrite, FileShare.None, 8192, false ); fileVolAddress = volFile.volMappingAddrAsNum + efi.fileAddress; shouldDecompAfter = (decompGZ && efi.name.EndsWith(".gz")); finishedHandle = compEvent; callback = epc; }